Script to freeze-keyframe selection X frames before cursor

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
lehtiniemi
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Script to freeze-keyframe selection X frames before cursor

Post by lehtiniemi »

I'm looking for a script that would keyframe my currently selected bone/layer/points X frames before cursor position.

When doing Family Guy -kinda animation where people stay in position, change position every now and then, the characters stay in the same position for while, then one thing changes, then they stay again. When I add a new keyframe for example moving looking down, I _always_ need to add the previous keyframe again 3-5 frames before the new keyframe.

I'd really like to find a script that would duplicate the current position keyframes some frames before the current position automatically. I remember there's some script called bone time machine, this might solve this, I have to try it.

Any suggestions? Or maybe ASPRO has this as a feature already?
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Script to freeze-keyframe selection X frames before curs

Post by Víctor Paredes »

If I understood the idea, the Hold keyframe feature should work for you.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
lehtiniemi
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script to freeze-keyframe selection X frames before curs

Post by lehtiniemi »

Hi!

Thanks for the reply! Yes, this basically does what I need, but often the previous keyframes are pages away in the timeline. I would need something like "Hold previous keyframes to this cursor position" or "Copy previous keyframes to cursor position". Is there perhaps a way to do this?

The new Freeze-function also got a lot smarter so it is getting there as well but it still requires going back, adding keyframes, then coming back and creating the new keyframes. The major issue is "drifting" which I would like prevent with some one-click solution.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Script to freeze-keyframe selection X frames before curs

Post by Víctor Paredes »

In that case, isn't better to just use Step interpolation as default and then add interpolation to only the keys you want?
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

Re: Script to freeze-keyframe selection X frames before curs

Post by Breinmeester »

I just added this to our in house bone tool. What i did was travel back in the timeline from the current frame and find the first former keyframe for that anim channel and copy it to the current frame.
lehtiniemi
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script to freeze-keyframe selection X frames before curs

Post by lehtiniemi »

Breinmeester, this is exactly what I would need! I just mailed someone on the forum, asking for a custom script like that on commission.

Is your custom bone-tool script for sale (or that script part of it you described)? You can pm me if you are willing to sell a script like that, that would help so much. It would need to go back for selected bones/points (or even bones only) to the first keyframe that occurs before current frame and copy that to current frame on each bone. The keyframes shouldn't be required to be in on the same frame so this operation would need to be done for each bone separately since sometimes the keyframes could occur on different frame numbers for different bones.

I find myself going back multiple pages on timeline just to find the previous freeze point all the time so this would be such a workflow improvement!

Victor, thanks for the tip! Still, besides the problem described above, I find it's somewhat faster to freeze poses than keep changing keyframe types. But on the other hand, I haven't tried working like that so I'll give that technique a go as well! Thanks for the tip again!
lehtiniemi
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script to freeze-keyframe selection X frames before curs

Post by lehtiniemi »

Wrote a script to do this:

viewtopic.php?f=12&t=28908
Post Reply