is it possible to run assimp commandline tool with

2019-08-31 02:46发布

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);

标签: php exec assimp
1条回答
Anthone
2楼-- · 2019-08-31 03:53

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

查看更多
登录 后发表回答