Friday, March 1, 2013

Blender-->maya pipeline. Setting a reference network

Getting the stuff from blender to maya had its quirks.
I'm gonna share this mini tutorial with the hope it will save somebody else the frustration that I had to go through.

If  you pose your assets and export them together to an fbx file, this is what you are going to get in maya.

To get around the mesed up translations and rotations, I had to apply all object's coordinates. This in blender terms means that their local origin is going to move to the world origin.
That unfortunately stacks them on top of each other
Each is on its own sepparate layer in blender, so its easy to toggle that mess off and work on stuff individually.

Another thing I did was making sure my scale is the same in both packages. To do this I set up the metric system in both to be consistent. One grid square=1 meter (scale =.01 in blender). I set the same values in maya in advance.

Then I export it with the following settings. 

modifiers are being applied on export, so I made sure that all subdiv modifiers in the scene are removed. 

Maya's default world orientation is y=up, -z=forward. Whats nice though is that it kept the parent-child relationships between objects, so It kept my null controllers and turned them into locators. This makes it easy to move objects in the scene that have multiple meshes.


So why is referencing useful? It allows you to make changes to your model and rig after you have skinned it. It's also a neat way of isolating data blocks in separate files - making it more manageable. It means being able to  swap different versions of geometry and your rig with a few clicks. - load a low poly proxy (cubes), continue to improve a rig after you have started doing animation on it (in my case its adding facial controls after finishing body animation). It means being able to track down issues easier. It does add to the loading time though.

One thing that I found with my last animation project is that while you can edit referenced files in Maya to a certain extend, every edit you make to them of course stays in the maya scene file, its not done to the (in this case FBX) reference. 

It's a good rule of thumb to keep edits to a minimum, as it contaminates the scene and increases the chance of problems. So I never do stuff like editing the geometry of an object that is referenced in the scene. The reference edits list window in maya keeps track of everything you've done to the reference. Sometimes if a scene is broken (crashes on load), its a good idea to load it without its references loaded, find the problematic ones and clean up their list a bit.

In this case, maya is storing only the new locations of the controller objects and unfortunatelly the frozen transformations command that I did before moving them into place.
Blender rotates all the stuff accordingly and adds rotational offset to the values in the fbx. I had to zero them out in maya.

Referenced objects paths:
If you use the file manager to load and reference a file, by default maya will use the full path of the file. As a result if you move your projects folder to a new place, new computer or drive- all of your reference links will become invalid and you will have to manually relink them. It doesnt sound like a big deal, but if you have a big and complex network that can become an issue on an operating system such as windows, where you cant create symbolic links. So the computers at university have maya on windows, while I use maya on linux at home. Maya on windows has poorer performance and tends to crash more often. Submitting my source files to uni computers meant that all the reference links would get broken and likely my tutors will be unable to open them without having to spend at least half an hour relinking the files. As an extra annoyance both maya 2013 on windows and linux have a bug where when it prompts you for the new path and you give it , it doesnt apply it and also makes you wait for ages to search the files and fail.

So what was the solution to that one? It's pretty tough to find with google and after searching I found that other people have had the issue but their solution was sort of wrong and wasnt really a solution.
At the same time I was pretty sure that maya has the ability to use local paths for anything that is inside the project folder. However to make all the paths local I had to change them manually, without using the file browser. So after renaming each to use local links, now all my references just work out of the box, wherever you move the project folder.But it's my suspicion that whoever opens it after me has to make sure they set the project folder location.

MAYA BUG: Unfortunately Maya 2013 (and older?) has a bug where it does allow you to use fbx files as references, but does NOT allow you to have local path linking for fbx files (only full paths- even tried with fbx files created by Maya). That forced me to import my blender fbx files to maya, save them as maya binary files and then replace the fbx references that I have with mb ones. It means that every time I make changes to my models in blender, Instead of updating automagically where they are referenced, I will have to manually import them in maya and save them as mb/ma files. :(

Autodesk, please fix this bug!!
Do let me know if you know a better solution. :)

No comments:

Post a Comment