MR Bake Bone Dynamics

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Greenlaw
Posts: 9534
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Bake Bone Dynamics

Post by Greenlaw »

Oh, but you know what probably does work?

In 13.5, copy the keyframes to a Regular Action and then click the Export button in the Actions window.

Now, you can apply the Action to the bones in 14.1 after importing it by using the Import button in the Actions window.

I don't have time to try this right now but I'm pretty sure it will work. Let me know what happens if you get a chance to try it yourself. :)
Daxel
Posts: 1029
Joined: Wed Mar 27, 2019 8:34 pm

Re: MR Bake Bone Dynamics

Post by Daxel »

Greenlaw wrote: Tue Apr 02, 2024 4:35 pm I don't have time to try this right now but I'm pretty sure it will work. Let me know what happens if you get a chance to try it yourself. :)
It worked!

A few things to note:

I had to remake the bone physics settings of each dynamic bone not only because the numbers were different, but because the same numbers also didn't produce the same results at all.

The exported action, containing just 20 keyframes for one single bone weights 60+ MB! That doesn't sound reasonable at all, but it works. I just hope nothing explodes when I try to export the total 1242 keyframes of the 10-20 dynamic bones I have. I just made a quick test, and with that insane increase in frames and bones the action's weight goes all the way up to 61MB! Good news I guess! And import worked fine aswell.

Thanks for your help!

And sorry Eugene if these posts are a little bit off topic... I guess it could be helpful for another user that comes here after trying this script in Moho14.

Also, if Victor or Mike are reading, please consider baking physics as a built in option.
User avatar
Greenlaw
Posts: 9534
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Bake Bone Dynamics

Post by Greenlaw »

Oh, yeah...I guess that makes sense. Eugene did say LM made changes to how dynamics works, and that's probably what you ran into.

Anyway, thanks for the report! Glad you got something that works now. :)
User avatar
KuzKuz
Posts: 519
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Bake Bone Dynamics

Post by KuzKuz »

The problem with baking bones in version 14 is that bone dynamics do not update when changing frames via the API.
There is one solution, but it might not be very convenient. I can make it so that the user manually changes frames and presses a button to record the bone transformations.
The script can then reproduce these transformations in the frames where the user collected the data. It might be better than nothing.
Let me know if this option works for you and if it's worth writing the script.
User avatar
Greenlaw
Posts: 9534
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Bake Bone Dynamics

Post by Greenlaw »

Oh, shoot...I totally forgot about this. Thanks for the reminder.
Daxel
Posts: 1029
Joined: Wed Mar 27, 2019 8:34 pm

Re: MR Bake Bone Dynamics

Post by Daxel »

KuzKuz wrote: Mon Jun 03, 2024 3:51 pm The problem with baking bones in version 14 is that bone dynamics do not update when changing frames via the API.
There is one solution, but it might not be very convenient. I can make it so that the user manually changes frames and presses a button to record the bone transformations.
The script can then reproduce these transformations in the frames where the user collected the data. It might be better than nothing.
Let me know if this option works for you and if it's worth writing the script.
I would definitely use it. We would have to press the next frame button and then the record button for each frame, right? It would be nice if the record button had the "next frame" action included so it's only one button per frame but I don't know if that is possible.
User avatar
KuzKuz
Posts: 519
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Bake Bone Dynamics

Post by KuzKuz »

Daxel wrote: Mon Jun 03, 2024 4:39 pm We would have to press the next frame button and then the record button for each frame, right?
Yes. But this can only work if the user manually changes the frame by pressing the right arrow key on the keyboard.
Unfortunately, this doesn't work if the script changes the frame instead of the user.
Post Reply