|
Hi guys,
does anybody of you know a good FBX import batch script?
I’m starting to write something on my own, but if there are any other sources it’ll be very helpful. ;)
The script should allow to select a folder with fbx-files, import each file individually and save it optional as a mb or ma file extension with the same name as the fbx-file.
Thanks for your help,
Chris
|
|
|
|
I found this but I don’t know why it’s not working with Maya 2012. Also it doesn’t recurse folders.
string $path = "c:\test"; string $filelist[] = `getFileList -folder $path -filespec "*.fbx"`; string $newFileList[]; int $cnt; string $parts[];
for ($i=0;$i<size($filelist);$i++){
$cnt = `tokenize $filelist[$i] "." $parts`; //strip out "." from fbx suffix $newFileList[$i] = $parts[0]; FBXImport -f ($path + $filelist[$i]) -t; //open the fbx file file -rename ($path + ($newFileList[$i]+".mb")); //rename to .mb file -f -save -options "v=0" -type "mayaBinary"; //save the .mb string $confirmUI = `confirmDialog -title "Convert FBX"
-message ($path + $filelist[$i] + "has been converted to " + $path + $newFileList[$i]+".mb")
-button "OK"`; file -f -new; //create a new scene }
|
|
|