是否可以使用php运行assimp命令行工具

时间:2014-07-24 09:40:05

标签: php exec assimp

我使用以下命令将3d模型转换为assimp Assimp,并且在Windows上运行正常:

assimp2json seaknight.obj seaknight.json 

我需要知道如何从PHP运行此命令?我知道有从PHP运行shell执行的功能,但它不起作用,我没有收到任何错误。

使用的是PHP代码。

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

另一个是

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

1 个答案:

答案 0 :(得分:1)

自己找到

工作代码在

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

不需要包含.exe,删除它后命令工作

相关问题