Hello all, I'm writing a script for my work and before I start I wanna make sure everything is working perfectly. So heres what I want to do.
Copy a animation (keys, tangent, and basically all the animation info) from one character to another character but I want to save all info (translate, rotate, and etc) to my hd. Then later I can grab all those save files (anim data) and blend them to my character. Blend means if I saved a file (anim data from my character) and it start at frame 1 to 50 then later on I wanna grab my other file and it start at frame 51 to 100 I want my original character to start blending the animation from 51 to 100.
now what I want to ask if anybody can give me an advice (not the code ) on doing this, any problems I need to be aware of, I'm open minded so please let me know what I need to put and not to put on my script.
I did something kind of similar a long time ago, but it was for importing .fbx files and chaining them together end to end. I don't recall any particular hurdles not related to dealing with the FBX importer. Once the data was in, I am pretty sure it was just a matter of setting the current time and copying and pasting keys.
Your case will be a bit different since you will set individual keys one at a time with data, but it sounds pretty straight-forward. Of course, they all do at first
The trickiest parts were 1)figuring out your naming conventions and mappings. When you're dealing with different characters you either want controls named the same so the proper channels go to the proper controls. Or you want some way to specify which channels go to which controls if your character source and destination controls are named differently.
2a)the math for the time offset for pasting the animation at a different time than the source animation. So that frame 1 of your source starts at frame 51 of your destination
2b)the math for the value offset for pasting a source animation that goes from say value 1 to value 50 so that in your destination animation it actually goes from value 51 to value 100.
(obviously 2a and 2b are really the same math)
reading the times and values and such and actually making the file and reading it back in are all pretty straightforward. There are just so many options you might want to change based on the situation that it's a lot to keep track of and check for.
As soon as i work out some bugs on my AnimWriter script I plan on releasing it into the wild here, but in the meantime zooXferAnim is a nice peice of code to look at.