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

Post » Tue May 17, 2011 3:58 am

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
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Tue May 17, 2011 4:58 am

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
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am

Post » Mon May 16, 2011 11:33 pm

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
Amanda Leis
 
Posts: 3518
Joined: Sun Dec 24, 2006 1:57 am

Post » Tue May 17, 2011 10:08 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
Alexandra walker
 
Posts: 3441
Joined: Wed Sep 13, 2006 2:50 am


Return to IV - Oblivion