I have a scene of an animated rig made up of referenced objects. Namespaces needs to get cleaned away prior to the scene being exported but doing so seems to disconnect some node I wasn’t aware of, resulting in animation data going missing once you re-open the Maya-scene.
What I do:
I loop thru all joints (MFnIkJoint) and transforms (MFnTransform) in the scene and add them to two lists. I then loop thru these lists and just look for the namespace prefix(es). I save the old name and then I strip away the namespace like here below, export and then I restore the name to it’s original name.
# obj - the joint or transform object
import re
nameList = re.split("[:]", obj.name())
if len(nameList) != 1: # Has namespace prefix
obj.setName(nameList[-1])
It appears that when I do this rename, some other node connection gets disconnected. So when the scene is saved after export, and later re-opened, the animations are GONE and the character is back in T-pose. Everything looks fine in the Outliner and in the Namespace editor (ie: it looks like how it did prior to exporting).
Now I’m no expert on rigging and animations so I’m not exactly sure what nodes are affected (disconnected) by this forced renaming. All help is appreciated.¨
What I want to know:
-What nodes are losing their connection(s) when I do the above? It’s more than just the joints and transforms.
-Can the lost connections be retrieved?