About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Splitting Animations
Author Message
Brainache Offline
Member

Post: #1
Splitting Animations
Hey there - is there any way to split an animation into multiple smaller animations via keyframes?

ie: animation.save( start_key, end_key, name)

or via mesh editor?

or by copying frames from an existing animation to a new one and saving it perhaps?
05-26-2009 06:39 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: Splitting Animations
there is no automatic function for this,
but you can load an animation
then use the AnimKeys::removeOrn, removeRot, .. to remove selected keyframes
and then save the animation to a custom file
05-26-2009 07:00 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #3
Re: Splitting Animations
Sounds good.. If my source animation has 200 frames... will there be 200 entries for each type of key? (rot, pos, etc...) regardless of wether there was actually a value change on the frame?

ie: if there is only a position change at frame 20... i would still remove frame 20 from orn,rot,pos, and scl? ( at work atm so cant test this before asking smile)

Also - it looks like I need to do this for every bone.. correct?

thanks
05-26-2009 07:05 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: Splitting Animations
you'd just need to do a simple iteration throught all keyframes (for example check each keyframe time) if it doesnt fit in the desired range then remove it
yes, for each bone
05-26-2009 07:08 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #5
Re: Splitting Animations
Gotya - Where I am a bit confused is.. I dont see how to relate time to animation frame...

If my animation has 200 frames... How do I know what time frame 50 is at? Is there a set playback rate?
05-26-2009 07:27 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
Re: Splitting Animations
each animation keyframe has its 'time' member
05-26-2009 07:40 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #7
Re: Splitting Animations
Yep.. I gotya there... and I have a prototype working that strips out AnimKeys using removeOrn (scl,pos,rot) based on a start_time and end_time...
( oddly tho.. Animation.length() reports the same time before and after removal of Animkeys)

My qustion about the time vs keyframe is... how do I know what start_time and end_time should be?

For example: In Fragmotion ( my animation tool ).. I have an animatoin that is say.. 200 frames long..
I think I foud my answer while typing this... in FragMo.. when I export.. I choose a Frames Per Sec amount.. usually 30...

So... frame 50 would occur at (30 fps .. like 1.66 T)...

What does Animation.length() calc off?
05-26-2009 07:55 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #8
Re: Splitting Animations
hmm... I am removing the start_time from the remaining AnimKeys.. still hasnt changes Animation.length() ( even when i load the new animation...) ...
05-26-2009 08:01 PM
Find all posts by this user Quote this message in a reply
kaito Offline
Member

Post: #9
Re: Splitting Animations
Brainache Wrote:Hey there - is there any way to split an animation into multiple smaller animations via keyframes?

ie: animation.save( start_key, end_key, name)

Let me participate in your conversation.

Is no better split into several files the animation from fragmotion, and then create multiple .anim files from mesheditor.

This way we can blend animations if necessary.

Regards.
05-26-2009 08:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
Re: Splitting Animations
to change Animation length
please use
Animation::length
05-26-2009 08:40 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #11
Re: Splitting Animations
Ah.. just have to set it.. ok smile.. I thought it was a calculation...


Kaito:

What you suggest would work as well... however, I have many models with standard animation frames... If I can do it this way, I can automate the process so my artists ( or I ) doesnt have to manually split up the animations...

Same end result tho smile
05-26-2009 08:58 PM
Find all posts by this user Quote this message in a reply
Post Reply