Converting all MA files to FBX without changing GUIDs

I have many Maya files in a project that are directly imported as MA files.

Annoyingly, this means that every machine where work will be done on the project needs to have Maya installed.

I would like to convert all of the MA files to FBX - that’s an easy enough batch operation. But then all the FBX files get exported as a NEW asset - they don’t replace the existing unity Model/Magic-Semi-Prefab in the scene. Worse still, these models (and their contents, like their internal meshes) are referenced throughout the game and instantiated in all sorts of weird ways. So I really do need a transparent replacement.

So, is there a way that I can replace all the MA files in my project with FBX equivalents of themselves, re-using the same GUIDs? It would seem that since Unity actually implements MA import as FBX emport then import, if Unity caches the FBX files as temporaries (in Libary folder?) then I could even use those files as the FBX’s?


You should be able to do something like this:

  1. Delete .ma file
  2. Place .fbx
  3. Rename .ma.meta to .fbx.meta

In theory this could work. You might need to rename something more in meta file.

You can do this with a python script and calling the script with mayapy. Note that the FBXExport command doesn’t seem to script via Python, so you’ll have to construct a MEL string and pass that.

FBX’s didn’t 100% replace the guids. I’m not sure if this is because some of the models I was replacing date from 2012, or if I accidentally alt-tabbed to Unity at some point whilst running the script, at which point the GUID cache decided to give all the new FBX’s new guids no matter what you did to their meta files.