[Closed] getSubAnimNames with custom attributes
I need to use save/load animation on some character rigs but some tracks are not transferring to the new rig properly because they haven’t been animated, only the value has been changed on the controller.
I have made a script that goes through every controller in the scene and sets keys on the first and last frame of the time bar. This is transfers the animation perfectly, but of course there are roughly 14,000 controllers being collected and keyed resulting in file sizes to jump and most of these controllers don’t need to be keyed in the first place.
I am now trying to use subAnims to recursively cycle through specified areas of the object to collect fewer controllers. The problem I am running in to is that it seems I cannot access subAnims stored inside custom attributes because, of course, the custom attributes are not being recognized as subAnims. Basically, the ca def is acting like a wall keeping me from getting inside.
I am currently setting up a 2nd function to check if there are defs and if there are then to start the process again on the ca def. But, I am expecting this will start getting messy in the code and will definitely be inefficient since this check would have to happen on every subAnim.
Can anybody think of an easy way to get around this or an alternate method of collecting controllers I could try?
Hey Mat. This is a pain and you are going about it the right way. A good solution is to pass the nodes that you to the saved animation file. You can do with directly using the built in functions for writting the XML file that are used by Save Load animation. You can find these in the scripts folders. Have a look in 3ds Max 9\stdplugs\stdscripts\baseLib for the scripts.
Another solution is to write a tool that writes the value at the first frame of the time line to a file. So it would have either hard coded objects and tracks or you would recurse the hierarchy and get all the values. store them in a file, possibly an XML file of your own design and then set those to the rigs first before you load the animation.