Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

FBX import batch?

FBX import batch?

Anonymous
Not applicable
435 Views
1 Reply
Message 1 of 2

FBX import batch?

Anonymous
Not applicable
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
0 Likes
436 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
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 "." $parts`; //strip out "." from fbx suffix
$newFileList = $parts;
FBXImport -f ($path + $filelist) -t; //open the fbx file
file -rename ($path + ($newFileList+".mb")); //rename to .mb
file -f -save -options "v=0" -type "mayaBinary"; //save the .mb
string $confirmUI = `confirmDialog -title "Convert FBX"
-message ($path + $filelist + "has been converted to " + $path + $newFileList+".mb")
-button "OK"`;
file -f -new; //create a new scene
}
0 Likes