I have a hierarchy that I need to:
- break apart
- doSomething()
- put it back together the same way it was before.
I know how to break things for sure, and have plan about what I need to do when they are flat in hierarchy. The problem is how do I parent them back?
Details
This is related to my previous question:
Freeze scale transform on a parent object with animated child (MAYA MEL/Python script)
I need to freeze scale transforms on all nodes in a hierarchy. Problem is that nodes have translate animations on them, and if I try to freeze scale on a parent node, it's child animation gets weird. However it looks like there is a solution, but I need help with implementation of it. I want to:
- Group each object
- Parent each group to the world
- Bake animation to the world space (getting rid of the group node)
- Freeze scale transform
- re Parent them back
It works when I do it manually, so everything should be ok. But if you think there is better way to achieve my main goal, please do tell me.
So, I've been thinking to write all nodes to a string and call them from there, but I don't know how to handle branches. For example: If it was a branchless hierarchy (one parent and one child all along) I could call them by two, and parent easily. But branches make names in string go like "parent, child, child, child, parent..."
Probably I'm thinking too much and in wrong direction. Any ideas?