Tuesday, January 11, 2011

Animation Transfer Script

A friend of mine was asking me if it is possible to have a script that can save the animation data into a text file and load the saved animation data text file into another object. So I wrote a simple Python script that could perform such operation. It saves the keys as well as its animation curves and tangents.

The GUI is pretty simple to navigate. There are two tabs, LOAD and SAVE. To save out animation data into a text file, first select the object with the animation that you like to save out. Then click 'Browse' to browse to a directory where you want to save the text file containing the animation data. You can specify the start frame and end frame, as well as choosing the channels you like to save such as translate, rotate, scale and visibility. I made an additional custom attribute if you ever need one. The 'Save Data' button executes the saving data script. And to load the animation data, all you need to do is to choose your object, click 'Browse' to select your saved animation data text file, and decide whether if you like to remove the current keys on the selected object by ticking the checkbox. A click on 'Load Data' will executes the loading data script.

That is all.

Download link: Python File : jwAnimTransfer.py

** Note that this script is very simple. It can only save 1 object's animation at one time. Not that great, I know! Well, if you have any suggestions to make it more useful, let me know. Thanks!

No comments:

Post a Comment