Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / FBX import batch?
  RSS 2.0 ATOM  

FBX import batch?
Rate this thread
 
42581
 
Permlink of this thread  
avatar
  • Total Posts: 25
  • Joined: 01 September 2006 07:16 AM

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



Replies: 0
avatar
  • esr911
  • Posted: 07 March 2012 12:32 AM

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 -($path $filelist[$i]) -t//open the fbx file
file -rename ($path + ($newFileList[$i]+".mb")); //rename to .mb
file --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 --new; //create a new scene
}


Replies: 0