Create step keyframes for each inbetween frame?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

sas8140
Posts: 8
Joined: Fri May 31, 2024 8:37 pm

Create step keyframes for each inbetween frame?

Post by sas8140 »

Hello, I'm a newbie to Moho!

So if you have keyframe A (frame 1) and keyframe B (frame 12), Moho will automatically work out the inbetween frames.

The problem is when you go to an inbetween (frame 8 for example) and try and edit, it will mess up the smooth interpolation between the original two keys. This isn't a problem in other programs where the inbetweens are stamped in (which has it's own drawbacks).

I was wondering if there's a way or script to freeze step keyframes on every frame between two specified keyframes which would then make each frame editable without affecting any of the timing or adjacent frames.

Are there any other novel ways of getting around this? Another way is to approach it entirely frame by frame by using primarily step keyframes.

Thanks!
User avatar
KuzKuz
Posts: 611
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: Create step keyframes for each inbetween frame?

Post by KuzKuz »

Hello. My tools, MR Pose Tool viewtopic.php?t=36267 and MR Tween Machine viewtopic.php?t=35794, have a built-in Smart Bake feature that automatically bakes neighboring frames to prevent destroying the interpolation of adjacent frames.
However, keep in mind that if the keys have Bezier interpolation, it will change in any case.
sas8140
Posts: 8
Joined: Fri May 31, 2024 8:37 pm

Re: Create step keyframes for each inbetween frame?

Post by sas8140 »

KuzKuz wrote: Sun Jun 02, 2024 12:32 pm Hello. My tools, MR Pose Tool viewtopic.php?t=36267 and MR Tween Machine viewtopic.php?t=35794, have a built-in Smart Bake feature that automatically bakes neighboring frames to prevent destroying the interpolation of adjacent frames.
However, keep in mind that if the keys have Bezier interpolation, it will change in any case.
Cool! Will definitely check this out, thank you. But I didn't quite get your last point? If the original keys have Bezier interpolation, and you make an adjustment to one of the inbetweens, will it always kick the timing off? Or can you effectively freeze the all surrounding frames...
User avatar
KuzKuz
Posts: 611
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: Create step keyframes for each inbetween frame?

Post by KuzKuz »

If the Bezier curve shape is simple enough, adding a new key can approximately preserve the interpolation from the Bezier key to the new one.
However, if the shape is more complex, it may change significantly. Therefore, I generally do not use Bezier interpolation, and my scripts are not adapted to it.
sas8140
Posts: 8
Joined: Fri May 31, 2024 8:37 pm

Re: Create step keyframes for each inbetween frame?

Post by sas8140 »

KuzKuz wrote: Sun Jun 02, 2024 1:02 pm If the Bezier curve shape is simple enough, adding a new key can approximately preserve the interpolation from the Bezier key to the new one.
However, if the shape is more complex, it may change significantly. Therefore, I generally do not use Bezier interpolation, and my scripts are not adapted to it.
I will investigate this, thanks again.
User avatar
Greenlaw
Posts: 10405
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Create step keyframes for each inbetween frame?

Post by Greenlaw »

By all means, use KuzKuz's tool. It's awesome.

Alternatively, you can use Moho's Deep Copy Range and Paste Deep Frames commands to bake a range. For example, when the animation is in the Bones layer, select the range and Deep Copy Range/Deep Paste the selection into itself. The result is a baked range of frames. Note that if there are keyframes in layers nested under the selected group, they will also have their range baked. Layers that have no keyframes, however, will not be baked. I'm just mentioning this method in case you can't install the script for any reason.
Last edited by Greenlaw on Sun Jun 02, 2024 11:02 pm, edited 1 time in total.
Daxel
Posts: 1084
Joined: Wed Mar 27, 2019 8:34 pm

Re: Create step keyframes for each inbetween frame?

Post by Daxel »

Greenlaw wrote: Sun Jun 02, 2024 4:42 pm By all means, use KuzKuz's tool. It's awesome.

Alternatively, you can use Moho's Deep Copy Range and Paste Deep Frames commands to bake a range. For example, when the animation is in the Bones layer, select the range and Deep Copy Range/Deep Paste the selection into itself. The result is a baked range of frames. Note that if there are keyframes in layers nested under the selected group, they will also have their range baked. Layers that have no keyframes, however, will not be baked. Just mentioning this method in case you can't install the script for any reason.
Clever use of deep copy range. Made me wonder if we can use it to bake bone dynamics.
Daxel
Posts: 1084
Joined: Wed Mar 27, 2019 8:34 pm

Re: Create step keyframes for each inbetween frame?

Post by Daxel »

By the way you mention you are a newbie, so it's with mentioning that a common way of holding frames is to use the freeze bones/points button, the one with the key icon at the top of the timeline panel. Another way of doing the same for a specific channel is to double click in the channel line in the timeline.
User avatar
KuzKuz
Posts: 611
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: Create step keyframes for each inbetween frame?

Post by KuzKuz »

Deep Copy Range is also an option, but it's worth noting that it will create keys for all bones, including all smart bones.
This can be inconvenient if you only need to bake certain bones, such as just the character's arm.
Additionally, if you animate on twos, this can also be a problem since keys will be created on every frame.
Unfortunately, Deep Copy Range cannot bake bone dynamics.
User avatar
Greenlaw
Posts: 10405
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Create step keyframes for each inbetween frame?

Post by Greenlaw »

Daxel wrote: Sun Jun 02, 2024 6:56 pm Clever use of deep copy range. Made me wonder if we can use it to bake bone dynamics.
If baking Bone Dynamics is what you need, KuzKuz has a tool for this, too... (He's thought of almost everything!) :D

MR Bake Bone Dynamics
Daxel
Posts: 1084
Joined: Wed Mar 27, 2019 8:34 pm

Re: Create step keyframes for each inbetween frame?

Post by Daxel »

KuzKuz wrote: Sun Jun 02, 2024 7:25 pm Unfortunately, Deep Copy Range cannot bake bone dynamics.

Thank you for confirming.


Greenlaw wrote: Mon Jun 03, 2024 4:39 am
If baking Bone Dynamics is what you need, KuzKuz has a tool for this, too... (He's thought of almost everything!) :D

Sadly dynamics changed in Moho 14 so that tool no longer works in that version. We talked about it here: viewtopic.php?p=217284&hilit=dynamics+bake#p217284
User avatar
lucasfranca
Posts: 180
Joined: Sat Oct 07, 2017 11:47 pm

Re: Create step keyframes for each inbetween frame?

Post by lucasfranca »

Greenlaw wrote: Mon Jun 03, 2024 4:39 am
Daxel wrote: Sun Jun 02, 2024 6:56 pm Clever use of deep copy range. Made me wonder if we can use it to bake bone dynamics.
If baking Bone Dynamics is what you need, KuzKuz has a tool for this, too... (He's thought of almost everything!) :D

MR Bake Bone Dynamics
I keep version 13.5 installed, so I open the project there, bake when necessary, save and open it again in 14. To tell the truth, I keep versions 13, 13.5 and 14 on my PC.
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.

I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.

https://youtube.com/animai2D
User avatar
Greenlaw
Posts: 10405
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Create step keyframes for each inbetween frame?

Post by Greenlaw »

Daxel wrote: Mon Jun 03, 2024 9:54 am Sadly dynamics changed in Moho 14 so that tool no longer works in that version. We talked about it here: viewtopic.php?p=217284&hilit=dynamics+bake#p217284
Ugh...yeah, I guess I knew that at one time and then completely forgot about it. Thanks for the reminder, though. :(
sas8140
Posts: 8
Joined: Fri May 31, 2024 8:37 pm

Re: Create step keyframes for each inbetween frame?

Post by sas8140 »

Thank you @greenlaw and @daxel for you replies!

I've tried the script and deep copy and also freeze bones, but for me they still affect previous frames, especially if the interpolation is bezier.

For eg I tried the deep copy /paste between a range and suddenly the bone movement became linear speed and lost the interpolation of the motion graph I had on it before. In CelAction for example you can bake in specific interpolations that include ease in and out. I'm sure Moho can do this, I'm just not figuring it out - instead of freezing just adjacent keyframes you'd be freezing all keyframes within a certain range so the interpolation is 'stamped' in, even if it's a complex one. Any help is appreciated :)
User avatar
KuzKuz
Posts: 611
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: Create step keyframes for each inbetween frame?

Post by KuzKuz »

I can write a script that will bake the keys. It won't take long. Is it better to bake from the first selected key to the last selected key, or should I use the playback range for this?
Post Reply