Delete all animation except frame 1

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
keisern
Posts: 38
Joined: Mon May 01, 2006 11:05 am
Location: Norway
Contact:

Delete all animation except frame 1

Post by keisern »

We're in full production of an animated TV-series, and have a lot of similar scenes that we need to animate.

When setting up characters from one scene to the next we use the previous scene, copy the last pose to frame 1 and start deleting all the animation from the scene. Very time-consuming stuff.

Is there a way to script this, like the "remove animation from document" command in the animation menu? Except we want to keep frame 1 in the scene?

I haven't touched LUA before, are there any tutorials or documentation on anime's scripting features?
Halvseint, animated talkshow on NRK
www.nrk.no/halvseint
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

One workaround is to use the "rescale keyframes" option, set it to scale the entire animation, and make the "new end frame" 2. Unfortunately you can't set it to 1, so you'll end up with an extra frame. But if you've copied the last frame to frame 1, the two frames will be identical. You can render the animation starting from frame 2 instead of 1, and the render won't include the extra frame.

Alternatively, you can delete frame 2 -- either manually, or with the tool I uploaded to delete a frame on all layers.
keisern
Posts: 38
Joined: Mon May 01, 2006 11:05 am
Location: Norway
Contact:

Post by keisern »

Thanks for your reply.

I tried the scale keyframes option, and it almost worked. It seems it didn't keep the scaling and flipping keys, and lead to some strange poses for our characters :)

But your idea lead me to the "copy current frame" menu item, which I discovered was a very nice thing. It copies the entire document's keyframes to any frame. The resulting keyframes have to manually be deleted, but it's still easier than doing it all by hand.

Now, if I could wrap my head around the lua language and make a script that deletes all animation from 2 and out, that'd be heaven. It would be nice to have an option of selecting a frame range in the "delete all animation" menu item, but I guess a script could do it.
Halvseint, animated talkshow on NRK
www.nrk.no/halvseint
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

I'm going to guess that the reason it didn't keep the scaling and flipping is because you didn't have a key frame for those parts on the final frame. If you key everything on the last frame before you rescale, it should work. But I wasn't aware of the menu option you mention here -- I'm going to have to look into that.
keisern
Posts: 38
Joined: Mon May 01, 2006 11:05 am
Location: Norway
Contact:

Post by keisern »

I took the liberty of modifying your delete key script to delete all frames from 2 and out.

It works quite well, but only on one layer at a time. It was really slow and crashed when I tried to make it delete sublayer keyframes as well.

The only thing is that it doesn't delete switchlayer, bone lock and curvature keys. Does anyone know how you can get around this?

http://www.machineboy.com/files/mf_key_delete.zip

extract to scripts/tool

If anyone can edit this to delete *every* keyframe from 2 and out, I'd really appreciate it!
Halvseint, animated talkshow on NRK
www.nrk.no/halvseint
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

Cool, I'll download your version, too. Might come in handy for me as well. I hope someone else can answer the question about working on the other keys as well, because I don't know what the syntax is for those elements.

Another useful thing would be if one of these tools could work inside an Action deleting keys only within a selected Action without harming the main timeline.
bearc0025
Posts: 14
Joined: Tue Apr 04, 2006 6:31 pm
Contact:

Any progress on this?

Post by bearc0025 »

Hi,

I'm trying to do the same thing. Has a better solution been found?

Thanks!
[url=http:///www.thebooples.com/]Booples[/url] - Children's Bible song DVD
IndieAnim - independent animation forum
Post Reply