Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Batch import obj/fbx?

Anonymous

Batch import obj/fbx?

Anonymous
Not applicable

Hi,

I was wondering if there is a script or a way in maya to batch import meshes?

Thanks!

Reply
Accepted solutions (2)
21,231 Views
23 Replies
Replies (23)

dankeating3d
Explorer
Explorer

I ran into this issue today. I couldn't figure out what it was in my settings that I needed to change to get batch importing to work. Instead I wrote a small script to get around the problem.

 

So if you run into this issue you could try this script

string $files[] = ` fileDialog2 -fileFilter ("*" + ".fbx") -fm 4 -okc "Select Files"`;
for ($file in $files){
    FBXImport -file $file;
}

blog post about script:
https://www.artstation.com/dankeating/blog/WRME/batch-fbx-import-for-maya

NickolasWilson
Explorer
Explorer

I had the same problem importing multiple fbx files, around 200 in my case, so I googled this issue and found this solution by artist Daniel Keating.
https://www.artstation.com/blogs/dankeating/WRME/batch-fbx-import-for-maya
It doesn't require a Maya reset or anything: it's just 3 lines of MELScript, and the import window that follows allows you to select multiple fbx files. Hope that helps anyone else on this path! If it has, give Daniel Keating a thanks on their post!

NickolasWilson
Explorer
Explorer

And then I read the final post in this thread, where Daniel has posted his solution already 😄 @dankeating3d Thank you!

0 Likes

andrew.greenleeZLBFD
Explorer
Explorer

I found why this was happening to me. Back story is, I always preferred to use the File options (in prefs) "OS Native" which shows a windows window instead of a Maya window. Hated the Maya I/O gui for years, it was slow to populate on some servers and had trouble remembering my bookmarks (prolly due to work workspace practices and proprietary stuff). 

 

Anywho, changed my settings back to Maya default for File preferences and my fbx batching script started working. I had tested resetting prefs and that worked, but then had the idea to try just the file related pref on a whim and sure enough that was causing some sort of conflict/ behavior that would block my script from running processes on multiple files in a folder. That is likely the issue for some others here.  Probably why I often got naming coflicts/namespace errors on fbx imports regardless of settings. . .