Page 1 of 1

Bake Bones Script

Posted: Sun Feb 05, 2017 11:33 am
by dkwroot
WHAT DOES THIS SCRIPT DO?
This script will bake the point motion from a bone layer onto a mesh. This allows the user to create motions and blends of motions using bones and then bake those alterations to keyframes on the vector layer.

HOW DO I USE IT?
Simply activate the script from the script menu and choose the interval you wish to bake to. The script will do the rest. Be aware that the script can take a while if there is a lot of point motion to bake.

DOWNLOAD: n/a

EDIT:
I greatly improved the speed of the script.

Re: Bake Bones Script

Posted: Tue Feb 07, 2017 2:43 am
by funksmaname
COol! thanks as always :)
I've not tried yet - is there an option to just 'bake current frame'? that could be useful too!
Keep up the good work mate.

Re: Bake Bones Script

Posted: Tue Feb 07, 2017 3:29 am
by dkwroot
No, it bakes all frames. Keyframes that aren't needed can be deleted manually.

Re: Bake Bones Script

Posted: Tue Feb 07, 2017 3:57 am
by funksmaname
very true :)

Re: Bake Bones Script

Posted: Tue Feb 07, 2017 4:21 am
by synthsin75
Hayasidist has one to bake current frame only.

Re: Bake Bones Script

Posted: Tue Feb 07, 2017 11:36 am
by hayasidist
it's here ... http://www.mediafire.com/file/374qob23a ... s_bake.lua It does all (well most!) transforms on vector layers - bone motion / layer motion / shape order ...

It's been around since 11.1 - read about it here: http://www.kelleytown.com/forum/animato ... hichpage=2
and here http://lostmarble.com/forum/viewtopic.p ... 6&p=170901

Re: Bake Bones Script

Posted: Fri Feb 10, 2017 7:45 am
by chucky
Pretty, pretty, pretty cool.

Re: Bake Bones Script

Posted: Tue Aug 01, 2017 1:14 am
by Broughtvulture
hayasidist wrote:it's here ... http://www.mediafire.com/file/374qob23a ... s_bake.lua It does all (well most!) transforms on vector layers - bone motion / layer motion / shape order ...

It's been around since 11.1 - read about it here: http://www.kelleytown.com/forum/animato ... hichpage=2
and here http://lostmarble.com/forum/viewtopic.p ... 6&p=170901
I've tried out and really likef both the dr_bake bones & hs_bake, but it would be better if they had shared one another's features. It would be a real time saver if the dr_bake_bone stored layer translation information, which the hs_bake does; but none the less hs_bake would be better with the option to bake all frames rather than only the one frame.

I'll keep watch if there are any future updates on these scripts. Thanks again for the time saving scripts.

Re: Bake Bones Script

Posted: Tue Aug 01, 2017 4:08 pm
by Ahroo
OK, at the risk of sounding like a complete idiot....what does "baking" mean? How is that different from freezing? What does it actually do? Thanks!

Re: Bake Bones Script

Posted: Tue Aug 01, 2017 6:19 pm
by Broughtvulture
It's all good, I didn't know what the term meant in terms of 2D animation; until I checked out these cool scripts.

In terms of these scripts, baking means to transfer all the position, rotation, and scale points from a parent layer such as a folder or bone and combine the frames into the vector layer itself. Meaning the vector layer can now become independent of the bone or folder layer it was once stored in while still inheriting the properties of movement it had while it was still within the folder or bone layer.

Here is an example, just for further clarification. A vector layer is within a folder, you move the folder layer's position. This automatically moves the vector layer's position. If you bake the vector layer, using the hs_bake script it will store the folder layer's movement info into the vector layer. If you don't bake it, but move the vector layer out of the folder layer; your vector layer would not keep the folder layer's movement changes.

Hope that helps you understand what the scripts do. These scripts have really made Moho 12.2 a better and more reliable program for me to use. It has made me more interested in scripting, so hopefully I can find out how they did this and share it.

Re: Bake Bones Script

Posted: Wed Aug 02, 2017 10:34 am
by hayasidist
Ahroo wrote:OK, at the risk of sounding like a complete idiot....what does "baking" mean? How is that different from freezing? What does it actually do? Thanks!
freeze = add keyframes for all the movable things so, when you move them later in the timeline, they start moving from the "freeze" position not some previous key frame.

(e.g. you have a shape with four points -- on frame 5 you move 2 of them; on frame 10 you move the other 2. If you haven't done anything else all the points start moving from frame 1. But if at frame 5 you "freeze" all the points, the second two points start moving at frame 5)


(my) bake = create a copy with no keyframes and with all the motion captured in a "frame 0" design.

The basis of my idea is to create a handoff between "traditional" moho animation (bones etc) and frame by frame -- IOW rig your character - move it using bones etc; then you need some motion where doing it fbf is "easier" (e.g. you need to change the view from face-on to looking down on the top of their head) so bake the vectors at the end of the "traditional" action to create the starting layers for an fbf sequence ...

Broughtvulture wrote:hs_bake would be better with the option to bake all frames rather than only the one frame
... interesting idea -- in effect turn traditional into an fbf sequence?!.. I'll keep it in mind...

But if you're heading into the realms of scripting, you might like to try a script that does something along the lines of:

for frame = 1 to MohoDoc:AnimDuration() do
> set timeline to frame (see http://www.mohoscripting.com/index.php? ... face&id=47)
> call bv_bake_noUI
end

and create bv_bake_noUI from hs_bake taking out the UI and defaulting to (say) current camera...

Re: Bake Bones Script

Posted: Thu Aug 03, 2017 2:10 am
by Broughtvulture
hayasidist wrote: ... interesting idea -- in effect turn traditional into an fbf sequence?!.. I'll keep it in mind...
Fbf sequence, yeah; Also I'm assuming all the frames will be within the same layer.

Although this isn't really an issue for me; I think this would improving Moho. It would make things more organized, since after finishing an animation you can reduce the file size by minimizing the amount of layers within the file down to just vectors. But in all honesty, I'm using it as a method of masking(hiding overlapping layers) so I don't have to trace what I need to not show or duplicate an entire folder with bones and stuff just to hide parts that overlap.
hayasidist wrote:But if you're heading into the realms of scripting, you might like to try a script that does something along the lines of:

for frame = 1 to MohoDoc:AnimDuration() do
> set timeline to frame (see http://www.mohoscripting.com/index.php? ... face&id=47)
> call bv_bake_noUI
end

and create bv_bake_noUI from hs_bake taking out the UI and defaulting to (say) current camera...
This is technically my 3rd day and I'm kind of getting the hang of scripting, but things like UIs, Matrix, Dialog boxes, as well as some other stuff not concerning layers or meshes are still beyond me. I wish I could, but I can't even break down your code and figure out how your able to select the folder/bone layer based on the vector layers position.

I'm kind of nervous about messing with the script, so I decided to create a whole new script. I'm currently trying to find out how to select the vector's parent layer, so far the LayerByAbsoluteID keeps selecting the wrong layer and type. But I'll stop here, since this thread is more about the scripts and not really how to make them.

Either way, it's pretty cool to get your input on it. Should I make a new thread for this type of help?

Re: Bake Bones Script

Posted: Thu Aug 03, 2017 10:52 am
by hayasidist
Broughtvulture wrote:Either way, it's pretty cool to get your input on it. Should I make a new thread for this type of help
yeah! and maybe do a search of scripting and/or the unofficial (but better than the stuff that comes with the s/ware) scripting docs: http://www.mohoscripting.com/index.php to see about parent layers -- e.g. http://www.mohoscripting.com/index.php? ... ent&id=499 -- before you post the next question ! :wink: :)

Re: Bake Bones Script

Posted: Thu Aug 03, 2017 2:40 pm
by dkwroot
If you're new to scripting with Moho, I'd suggest checking out the scripts recipes thread. Users have shared solutions to a lot of redundant tasks that often appear in coding.

viewtopic.php?f=12&t=30605