Unity and FBX
I'm having a play around with Unity and just wondering how everybody else deals with fbx animation data from Maya?
We've had fbx support in the pipeline for years and I'm just doing some spring cleaning so I can take data into Unity. Now the problem is this, using FBX we can use the FBXExportBakeComplexAnimation to frameSample our rigs bound skeleton for output, all well and good. But the skeleton is nested under a few transforms in the Rig's hierarchy and when we export selected on the skeleton, these parent transform nodes are taken into the FBX, and then onto Unity.
So the question is, how do you remove them, stop them from being processed at all in the FBX without having to pre-process the scene, deference it and pre the rig structures prior to calling the FBX output? As I see it theres 2 things missing from the FBX options, 1: "output without namespaces" and 2: "ExportBakeRootsTo World"
Not sure about getting rid of the parent transforms, besides unparenting right before export. A few notes though: The newest version of Unity requires that the top of the bind hierarchy be a joint, not just a transform/group. Also, we keep the namespaces, and actually regex the fbx text file to append/modify namespaces when necessary.
You might be able to do some of what you want in Unity's asset pre-processor, but not sure.
3ds Max has an Export Selected feature, aside from Export (which includes the entire scene). Does Maya not have this? Typically, I tell the artists "Anything hidden will not export." Then our export function selects all visible objects and exports the selected objects. (I automatically filter rig objects and other things.)
Sorry I miss understood. You'll need to unparent the skeleton from anything you don't want exported.[/edit]
I've had to deal with this in the FBX export pipline also. It would be pretty useful if they had options in the FBX exporter to strip namespaces and parent transforms but so far I don't think there is.
The way I have dealt with this in the past is to reference in an unrigged version of the character's export skeleton and connect it to the rigged one (via direct connections to rotate/translate or via constraints if that isn't possible for some reason) and then export with the FBXExportBakeComplexAnimation flag you mentioned before. Then after exporting you can remove the reference and that way it isn't too destructive to the scene. Getting rid of namespaces can also be handled during this pre-export stage by using the "defaultNamespace" flag when referencing in the export skeleton (although doing this relies on there being no clashing names already existing in the root namespace otherwise objects will be renamed as they are brought in). Obviously this method also relies on you having a method of finding the export skeleton file based on the rig currently being processed. I wouldn't call this a super elegant solution by any means but it certainly works :).
Another way to get rid of the namespaces which we have used before is to strip them in the unity asset pre-preocess as patconnole suggested. That was written by someone else though so I couldn't tell you exactly how it works. It sounded like it was just a bit of c# that modifies object names on import so shouldn't be too hard to work out.
Yeah thats pretty much what I ended up doing, but rather than reference in a copy of the skeleton I just duplicated the current output skeleton and bound it up. Just seems like something that the FBX code should do by default, might stick a suggestion into Autodesk.