is it possible to run assimp commandline tool with

2019-08-31 03:13发布

问题:

I used following command to convert the 3d models with the assimp Assimp, and it is working fine on Windows:

assimp2json seaknight.obj seaknight.json 

I need to know how can I run this command from the PHP? I know that there re functions to run the shell execution from PHP, but it didn't work and I don't get any error.

PHP code is used is follows.

system("D:\assimp2json-2.0-win32\Release\assimp2json.exe assimp2json seaknight.obj seaknight.json");

and another one is

$old_path = getcwd();
chdir('D:\assimp2json-2.0-win32\Release');
$output = shell_exec('assimp2json.exe assimp2json seaknight.obj seaknight.json');
chdir($old_path);

回答1:

Found it myself

working code is below

$old_path = getcwd();
chdir('D:\assimp2json-2.0-win32\Release');
$output = shell_exec('assimp2json monster.blend monster.json');
chdir($old_path);

no need to include the .exe, after remove it the command worked



标签: php exec assimp