Removing key of every n-th frame from the animation in Blend

Post » Mon Dec 05, 2011 7:40 pm

Is there any script to download, or function in Blender that allows to remove recorded I-key (location, rotation, etc.) from every n-th frame in an animation?

Let's say that I have an animation which has 20 frames, and each frame has an I-key with position and rotation data of the object. And I want to remove such I-key from every 2nd frame (in other words to clear recorded position / rotation / and other data from 2nd, 4th, 6th, ..., 20th frame).

For short anims that's not a problem, I can do that manually, but if the animation has 1000 frames or more, and each with an I-key, that's starting to be quite a daunting task ;p
User avatar
Natalie Harvey
 
Posts: 3433
Joined: Fri Aug 18, 2006 12:15 pm

Post » Mon Dec 05, 2011 10:54 pm

Is there any script to download, or function in Blender that allows to remove recorded I-key (location, rotation, etc.) from every n-th frame in an animation?

Let's say that I have an animation which has 20 frames, and each frame has an I-key with position and rotation data of the object. And I want to remove such I-key from every 2nd frame (in other words to clear recorded position / rotation / and other data from 2nd, 4th, 6th, ..., 20th frame).

For short anims that's not a problem, I can do that manually, but if the animation has 1000 frames or more, and each with an I-key, that's starting to be quite a daunting task ;p


You should look at the Blender web page for animation tutorials dealing with "Key Reduction", generally its never a good idea to delete keys on a Nth basis as you could delete an important key -> its always better to procedurially reduce the keying that will clean up the keying of Imported, Merged or Simulated Animations.
User avatar
Farrah Lee
 
Posts: 3488
Joined: Fri Aug 17, 2007 10:32 pm

Post » Tue Dec 06, 2011 1:15 am

I haven't done that in Blender, but in MAX I would just reduce the frame count to half and then back up again, and MAX would drop the alternate frames for me on the reduction. There was a clear distinction between the duration and the number of frames for an animation sequence, even though the frame rate connects the two. Halving the duration would double the frame rate and keep the same number of frames, but halving the frame count would keep the frame rate and halve the duration.
User avatar
claire ley
 
Posts: 3454
Joined: Fri Aug 04, 2006 7:48 pm

Post » Tue Dec 06, 2011 8:14 am

SaidenStorm -

I can understand that it's not good to remove every n-th frame, but for this case the drawbacks of having important key removed are not that noticeable.
What I want to achieve is to create slow and long animations of objects following a given path. I just create path from Bezier curves, and set the object to follow it. Then I use Blender's script that bakes constraints to IPOs. What it does is to add a key to every frame. So when I have an animation 40 sec long (1000 frames) that's a lot of keys. So I wanted to remove some of them.


ghastley -

There's possible to change frame rate in Blender, but from what I tested it only affects playback's speed, and not the current data of the animation, so it doesn't change the number of keys.


------------
Anyway, very much thank you both for answers, as it put things into perspective for me, and by randomly pressing the buttons in Blender I've found a different solution ;]

So now, I just create animation with only 100 frames, then bake it to IPOs (what gives 100 keys). And then go to IPO editor where all movement is represented by curves on x/y axis. And it's possible to modify the size of those curves there like any other objects in Blender. Next I scale animation curves by 10 factor (or more) along x axis which represents the time. This makes animation 1000 frames long with only 100 keys. Perfect for my needs. And it avoids a bad habit of deleting a key from every n-th frame ;]
Once again thanks for the answers.
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am


Return to IV - Oblivion