...save bone deformations in a switch layer
Moderators: Víctor Paredes, Belgarath, slowtiger
...save bone deformations in a switch layer
I would love to deform a vector object (with masking) using pin bones and then save every one of those deformations to its own switch layer. Every time I manipulate the bones on frame 0 and then select a new layer, the bones (and the resultant deformation) reset. I don't want or need any sort of interpolation, but I do need the smooth, simultaneous deformation of multiple vectors that the pin bones give me.
Any ideas?
Thank you greatly in advance.
-Drewmass.
Any ideas?
Thank you greatly in advance.
-Drewmass.
- neeters_guy
- Posts: 1626
- Joined: Mon Sep 14, 2009 7:33 pm
- Contact:
Re: ...save bone deformations in a switch layer
You can use svgs to bake the points deformations from bones. For example, export the desired frames as individual svgs. Then import back into Moho and put into switch layer. Simple shapes are best. The more complex the shapes, it may not be worth it if you have to rebuild the masking setup, style attributes, etc.
- synthsin75
- Posts: 10254
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: ...save bone deformations in a switch layer
If you don't need switch interpolation, just move the needed bones on frame one (so they're keyed) and duplicate the bone group for each switch sublayer.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: ...save bone deformations in a switch layer
Just curious but does exporting deformed art and reimporting as separate svgs preserve the point order so that you can use Switch Layer Interpolation if you wish to? I'd like to try it myself but checking to see if anybody else has already done this. Thanks in advance for any info.neeters_guy wrote:You can use svgs to bake the points deformations from bones. For example, export the desired frames as individual svgs. Then import back into Moho and put into switch layer. Simple shapes are best. The more complex the shapes, it may not be worth it if you have to rebuild the masking setup, style attributes, etc.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- neeters_guy
- Posts: 1626
- Joined: Mon Sep 14, 2009 7:33 pm
- Contact:
Re: ...save bone deformations in a switch layer
I just did a few tests and, yes, it does work. You can even export svgs like sequence images instead of frame at a time. Very cool, however there are some gotchas (naturally):
1) There is a scaling issue with imported svg. Since stroke size depends on project size, usually the imported svg fills the screen and the stroke is too thick. So some clean up is required.
2) On complicated meshes, sometimes the point order can get botched up. Haven't figured out a fix yet.
3) Finally, if you export masking, you'll need rebuild these after importing.
But all in all, it's a pretty neat technique. One interesting application is you can create a master face rig and use bones and smart bones to create variations of eyes, eyebrows, mouths, etc. To me, point pushing is the most tedious part of animating so this could be a terrific timesaver.
(side note: I think hayasidist has a script somewhere that bakes points and, years ago, heyvern mentioned a glitchy hack to do the same thing.)
1) There is a scaling issue with imported svg. Since stroke size depends on project size, usually the imported svg fills the screen and the stroke is too thick. So some clean up is required.
2) On complicated meshes, sometimes the point order can get botched up. Haven't figured out a fix yet.
3) Finally, if you export masking, you'll need rebuild these after importing.
But all in all, it's a pretty neat technique. One interesting application is you can create a master face rig and use bones and smart bones to create variations of eyes, eyebrows, mouths, etc. To me, point pushing is the most tedious part of animating so this could be a terrific timesaver.
(side note: I think hayasidist has a script somewhere that bakes points and, years ago, heyvern mentioned a glitchy hack to do the same thing.)
Re: ...save bone deformations in a switch layer
Good info and thanks for sharing your discoveries! I want to give this a shot when I'm not so busy, and your warnings about what to watch out for is definitely going to help. 

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- synthsin75
- Posts: 10254
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: ...save bone deformations in a switch layer
Maybe disable auto-scaling for imported vectors?neeters_guy wrote:1) There is a scaling issue with imported svg. Since stroke size depends on project size, usually the imported svg fills the screen and the stroke is too thick. So some clean up is required.
Here's that Vern post...still works in 12.1: http://lostmarble.com/forum/viewtopic.php?f=9&t=22824(side note: I think hayasidist has a script somewhere that bakes points and, years ago, heyvern mentioned a glitchy hack to do the same thing.)
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: ...save bone deformations in a switch layer
Wow, that's a pretty cool trick! I would have never assumed that could work.synthsin75 wrote:Here's that Vern post...still works in 12.1: http://lostmarble.com/forum/viewtopic.php?f=9&t=22824
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: ...save bone deformations in a switch layer
Thanks for all the great info so far!
What I am trying to do, specifically, is animate a mustache in switch layers using pin bone deformations. I am animating the mouth shapes point-by-point which is working well, but the mustache has a bunch of masked strokes in it that would be a pain to animate that way. I would love to make a bone layer with my vector mustache in it, duplicate the layer, put it in another switch layer, deform it, and have the deformations remain on frame 0. What is the purpose of having everything reset on frame 0, even if you have intentionally deformed it? And even if I deform it on frame 1 and copy it back to frame 0, it still seems to reset.
Thoughts?

What I am trying to do, specifically, is animate a mustache in switch layers using pin bone deformations. I am animating the mouth shapes point-by-point which is working well, but the mustache has a bunch of masked strokes in it that would be a pain to animate that way. I would love to make a bone layer with my vector mustache in it, duplicate the layer, put it in another switch layer, deform it, and have the deformations remain on frame 0. What is the purpose of having everything reset on frame 0, even if you have intentionally deformed it? And even if I deform it on frame 1 and copy it back to frame 0, it still seems to reset.
Thoughts?

Re: ...save bone deformations in a switch layer
I watched heyvern's tutorial which was great, but if you have layers with masking you have to drag each layer out of its masking group to freeze the points and then reassemble and re-mask each group. It will do the trick, but feels like it's still more labor intensive than it should be.
Although...did heyvern post the script he made that condenses the process to one button?
Thanks again,
-Drewmass
Although...did heyvern post the script he made that condenses the process to one button?
Thanks again,
-Drewmass
Re: ...save bone deformations in a switch layer
To me, it sounds like you may be complicating your setup unnecessarily. There are other approaches to mouth animation that might be less work intensive. It really depends on how you intend to animate this. Based on what you written so far, here are some suggestions:
1. Set up a Smart Bone Dial action and create all your mouth poses using one set of artwork in a single animation--don't bother with a switch layer. Separate each animation by maybe 10 frames to make it easier to stop at each animation on the SBD. When you animate, used Step mode for the SBD (suggest using Use Copy Previous Key so this doesn't interfere with other keyframing modes.) When animating the mouth, you can simply dial to the mouth shape you want. Since you're not interested in interpolation, this should just snap to each keyframed pose.
The nice thing about this method is that it's also very easy to add more poses, even with nested groups and multiple masks, without affecting poses you may have already keyframed (assuming you're not going to obsess about the order of the poses.)
2. Use Morph Actions to save presets for all your mouth poses, and set them up with Step frames to prevent interpolation. Name the poses with a clear prefix and description, like 'Mouth.Neutral', 'Mouth.Open', 'Mouth.Sad', etc. Now, when animating, just select the pose you want from Actions and insert the pose.
If you're using Moho 12 (as opposed to ASP), the nice thing is that you can finally save your Actions as a file and import them to other scenes. So, for example, when you create a new mouth pose while animating a scene, you can now easily import the new pose to your master character rig project file to use in your next scene.
3. Personally, I usually just copy the pose group that's closest to the next pose I wish to create in a switch layer, masks and all, and edit that art as a new pose, and move it the end of the list so it doesn't affect any existing animations. Most of the time, I prefer to control this with an SBD set to Step, and Interpolation set to Copy Previous Key...this way, nearly all my character animation keyframes appear in a single bone layer, including the Switch Layer animations. I find this easier than drilling down into the layers hierarchy for Switch Layer keyframes. It's a little more work to update the Smart Bone Actions but creating the artwork itself can be pretty quick and easy. And once it's set up, it's very fast for lipsync animation.
For 'specials', I may just edit an existing pose on the timeline and save that pose as a Regular or Morph Action to reuse later. I usually won't bother adding this edited pose as a new Switch Layer drawing if it's not a pose that will be frequently re-used.
--
I don't know if any of these approaches helps you but maybe this will help you consider other, possibly more efficient options. There are countless ways to set up and animate mouths in Moho, and some methods can work much better than others depending on the production's designs and animation style.
In my experience, when I find something I'm doing is getting hard to do, then I'm probably doing it the hard way.
1. Set up a Smart Bone Dial action and create all your mouth poses using one set of artwork in a single animation--don't bother with a switch layer. Separate each animation by maybe 10 frames to make it easier to stop at each animation on the SBD. When you animate, used Step mode for the SBD (suggest using Use Copy Previous Key so this doesn't interfere with other keyframing modes.) When animating the mouth, you can simply dial to the mouth shape you want. Since you're not interested in interpolation, this should just snap to each keyframed pose.
The nice thing about this method is that it's also very easy to add more poses, even with nested groups and multiple masks, without affecting poses you may have already keyframed (assuming you're not going to obsess about the order of the poses.)
2. Use Morph Actions to save presets for all your mouth poses, and set them up with Step frames to prevent interpolation. Name the poses with a clear prefix and description, like 'Mouth.Neutral', 'Mouth.Open', 'Mouth.Sad', etc. Now, when animating, just select the pose you want from Actions and insert the pose.
If you're using Moho 12 (as opposed to ASP), the nice thing is that you can finally save your Actions as a file and import them to other scenes. So, for example, when you create a new mouth pose while animating a scene, you can now easily import the new pose to your master character rig project file to use in your next scene.
3. Personally, I usually just copy the pose group that's closest to the next pose I wish to create in a switch layer, masks and all, and edit that art as a new pose, and move it the end of the list so it doesn't affect any existing animations. Most of the time, I prefer to control this with an SBD set to Step, and Interpolation set to Copy Previous Key...this way, nearly all my character animation keyframes appear in a single bone layer, including the Switch Layer animations. I find this easier than drilling down into the layers hierarchy for Switch Layer keyframes. It's a little more work to update the Smart Bone Actions but creating the artwork itself can be pretty quick and easy. And once it's set up, it's very fast for lipsync animation.
For 'specials', I may just edit an existing pose on the timeline and save that pose as a Regular or Morph Action to reuse later. I usually won't bother adding this edited pose as a new Switch Layer drawing if it's not a pose that will be frequently re-used.
--
I don't know if any of these approaches helps you but maybe this will help you consider other, possibly more efficient options. There are countless ways to set up and animate mouths in Moho, and some methods can work much better than others depending on the production's designs and animation style.
In my experience, when I find something I'm doing is getting hard to do, then I'm probably doing it the hard way.

NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
- hayasidist
- Posts: 3831
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: ...save bone deformations in a switch layer
I don't think Vern ever did that one-button script, but this "bake" script might work for you...I never developed it further than I needed it. ** Note the limitations!!! ** -- but yours to try to see if it helps....Drewmass wrote: ... if you have layers with masking you have to drag each layer out of its masking group to freeze the points and then reassemble and re-mask each group. It will do the trick, but feels like it's still more labor intensive than it should be.
Although...did heyvern post the script he made that condenses the process to one button?
Thanks again,
-Drewmass
links via http://lostmarble.com/forum/viewtopic.p ... 5&p=164416
Originally dev'd for AS11, but v5.411 does work in Moho12 (I do still use it as I'd intended it to be used - as a bridge between "bones" to FBF)