Export and Import Actions

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Export and Import Actions

Post by Hoptoad »

Image

I have a few questions. See those pin bones on the bottom of the shirt? I used point binding to bind a point to each pin bone, so I could move the corners of the shirt during animation, but the pin bones won't move. What am I doing wrong?

Here is the Moho file: https://www.dropbox.com/s/58tbc3004guvf ... .moho?dl=0

Note that the arm in the above picture is in a Bone Group layer by itself; it is not affiliated with the Bone Group layer containing the torso and neck. They are two different puppets for a reason.

I made these puppets as a learning exercise involving exporting actions and importing actions. This is my objective: I want to create a library of arms where each arm is a micro-puppet that has been constructed with a Smart Bone Action to bend at the elbow. Then I will create armless puppets and import whichever arm I choose from the library for each armless puppet (skinny arm, muscular arm, long sleeve arm, armored arm, etc.). I hope that all I would have to do at that point is use the Translate Layer tool to position the arm, then re-parent the upper arm bone to the puppet's torso bone, and then the armless puppet will have an arm with a pre-configured SBA. Is this possible? I haven't been able to get it to work.

If so, this will be a huge time-saver. Each SBA takes me an hour, because my puppets have so many points (the puppet in my example above is much simpler than my usual puppets), and my project requires a lot of puppets. If I can create a library of arms, legs and so forth, with functional Smart Bone Actions, that would be awesome. I expect that I could cobble together a good puppet in minutes, once the library had been well-stocked.

One more question. Is there a way to copy and flip a left arm with a SBA, so that it can be used as a puppet's right arm with a pre-configured SBA? That would cut my SBA-time in half.

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

Re: Export and Import Actions

Post by Greenlaw »

It's working here...

Image

Try saving the file, closing Moho and re-launching.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export and Import Actions

Post by Greenlaw »

A few comments about the rest...
Hoptoad wrote: Sun Jun 20, 2021 4:48 am Note that the arm in the above picture is in a Bone Group layer by itself; it is not affiliated with the Bone Group layer containing the torso and neck. They are two different puppets for a reason.

I made these puppets as a learning exercise involving exporting actions and importing actions. This is my objective: I want to create a library of arms where each arm is a micro-puppet that has been constructed with a Smart Bone Action to bend at the elbow...
To me, this sounds like a complicated animation workflow because the bones animation will have to be done in multiple layers. Trust me, it's easier to animate a character when all of its bones are in a single Bones layer.

IMO, the way you can do this is to copy and paste the arm bones into the Person Bones layer. Then you can use Copy Layer/Paste Layer to move the arm artwork into the Person group. (If you're arm has multiple layers, you should have it inside an arm group. This way, you only need to select and CL/PL the group, not every layer inside the group.) When you do this, the Smart Bone Actions will also copy into the Person group.

I looked at what's going on inside your arm setup, and here are some tips:

1. Use Linear keys inside a Smart Bone Action. If you use Smooth keys inside an SBA, that might not animate smoothly on the Mainline. Also, if you have multiple animations occurring in the SBA, using Linear keys will keep them in sync more easily and predictably. Keys inside an Action don't have to be set to Linear, but it's usually a good idea. (FWIW, it's what I use inside an SBA 99.9% of the time.)

2. Making a key at frame 1 inside the SBA is a good idea. Set this key as Linear but set the key at frame 0 to Smooth (or whichever mode you wish to be the default mode for the Mainline.)

3. If you haven't already done so, set the default Interpolation mode to Copy Previous Key.

4. I wouldn't bother setting angle constraint on limbs because you're restricting the posing possibilities of the character this way. FWIW, I almost never use angle constraints on a character's skeleton--I think these limits will make it it difficult hit strong key poses for the character.

5. If you rig the limbs properly, you shouldn't have to animate very many points inside an SBA to correct deformation. Normally, I'm only correcting two points inside the elbow. To see an example, look at the arm joint example I posted here: Elbow Joint Example. This setup only takes only a few minutes to do with minimal editing.
One more question. Is there a way to copy and flip a left arm with a SBA, so that it can be used as a puppet's right arm with a pre-configured SBA? That would cut my SBA-time in half.
What I usually do is I save a copy of the character, then strip out everything but the limb and the bone it's parented to. Then I change the names of the bones and the relevant Actions. finally, I flip the root bone. Now we have the mirrored version of the arm with unique bones and action names, which can be inserted in the character without conflicts.

BTW, the reason you want to keep the root bone...without it, it's possible to break the Smart Bone Action. (I'd have to intentionally break one to remember and explain what I mean. Maybe if I have time later.)

Regarding the modular approach, I've created some modular setups at work for complex 'sub-rigs' like my hands setups that have a lot of SB controls, but it can be tricky. Sometimes I'll 'Frankenstein' characters from the parts of other characters but most of the time the characters I'm asked to build are so uniquely designed (meaning, very different from each other,) that I find it easier to just build them from scratch.

I'm hoping that some day we'll get a native system for designing and building modular rig parts but that doesn't really exist at this time.

All that said, please don't let anything I've written above discourage you from trying. I know what I've described is not as easy as what you're looking for, but don't give up trying to find an easier way to make a modular character setup. My comments are based on my experience but there are endless ways to work with Moho, and I'm always open to hearing about new/better ways to do something in the program.

Hope this helps.
Last edited by Greenlaw on Sun Jun 20, 2021 3:27 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export and Import Actions

Post by Greenlaw »

Greenlaw wrote: Sun Jun 20, 2021 5:48 am BTW, the reason you want to keep the root bone...without it, it's possible to break the Smart Bone Action. (I'd have to intentionally break one to remember and explain what I mean. Maybe if I have time later.)
Oh, wait...I think I remember what the deal is: It's probably ok for the modular body parts, because the issue I'm thinking about has to do with Smart Bone Dials. If you break the parenting or parent the bone to another bone that has a different 'rest' rotation from the original parent bone, that can mess up the main control keyframes for the SBD. It's not a super critical problem because it doesn't/shouldn't affect the SBD's animation keyframes, but it does mean you'll need to redo the SBA's dial keyframes.

Of course if the body parts first bone (the part that attaches to the body) is a Smart Bone Dial bone, it will have the same issue. This is when you need the additional root bone, and that bone needs to have the same rotation value as the parent you're switching to. Again, not super critical if you know how to fix this.

That's probably not very clear right now, but maybe this warning will help out when you run into this problem later. :)
Last edited by Greenlaw on Sun Jun 20, 2021 3:32 pm, edited 3 times in total.
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Export and Import Actions

Post by Hoptoad »

Greenlaw wrote: Sun Jun 20, 2021 4:54 am It's working here...
Try saving the file, closing Moho and re-launching.
Hey, it's working now. Thank you.
Greenlaw wrote: Sun Jun 20, 2021 5:48 am A few comments about the rest...

To me, this sounds like a complicated animation workflow because the bones animation will have to be done in multiple layers. Trust me, it's easier to animate a character when all of its bones are in a single Bones layer.

IMO, the way you can do this is to copy and paste the arm bones into the Person Bones layer. Then you can use Copy Layer/Paste Layer to move the arm artwork into the Person group. (If you're arm has multiple layers, you should have it inside an arm group. This way, you only need to select and CL/PL the group, not every layer inside the group.) When you do this, the Smart Bone Actions will also copy into the Person group.
Oh my goodness, it worked! I did what you said: I copy/pasted the arm bones into the Person group, and I used Copy Layer/Paste Layer to duplicate the arm artwork. I re-parented the upper arm bone to the torso bone. I checked the Actions list and saw that the arm actions had copied. So I tried moving the arm, and it didn't work...at first. After experimenting, I realized that the point binding from the copied arm had been lost or malfunctioned or something. So I used the Bind Points tool and re-did the point binding and it works! The transplanted arm with SBA works!

Is there a way to keep the point binding of the copied arm, or will the breaking of point binding always happen? It's not a big deal, but if there's a way to keep the point binding, I may as well do it.
Greenlaw wrote: Sun Jun 20, 2021 4:54 am I looked at what's going on inside your arm setup, and here are some tips:

1. Use Linear keys inside a Smart Bone Action. If you use Smooth keys inside an SBA, that might not animate smoothly on the Mainline. Also, if you have multiple animations occurring in the SBA, using Linear keys will keep them in sync more easily and predictably. Keys inside an Action don't have to be set to Linear, but it's usually a good idea. (FWIW, it's what I use inside an SBA 99.9% of the time.)
Thanks for the tip, I will start doing that. I had a feeling that smooth interpolation was not ideal for SBAs.
Greenlaw wrote: Sun Jun 20, 2021 4:54 am 2. Making a key at frame 1 inside the SBA is a good idea. Set this key as Linear but set the key at frame 0 to Smooth (or whichever mode you wish to be the default mode for the Mainline.)

3. If you haven't already done so, set the default Interpolation mode to Copy Previous Key.
Ah. Done and done.
Greenlaw wrote: Sun Jun 20, 2021 4:54 am 4. I wouldn't bother setting angle constraint on limbs because you're restricting the posing possibilities of the character this way. FWIW, I almost never use angle constraints on a character's skeleton--I think these limits will make it it difficult hit strong key poses for the character.
Makes sense. I suspected that angle constraints might "constrain" my creativity when animating, as they discourage unusual poses. I'll use them sparingly. Thanks for the tip.
Greenlaw wrote: Sun Jun 20, 2021 4:54 am 5. If you rig the limbs properly, you shouldn't have to animate very many points inside an SBA to correct deformation. Normally, I'm only correcting two points inside the elbow. To see an example, look at the arm joint example I posted here: Elbow Joint Example. This setup only takes only a few minutes to do with minimal editing.
Image

Here is a depiction of a typical elbow joint from one of my puppets. As the arm bends the elbow becomes more prominent and a wrinkle in the skin appears. Making an SBA like this takes me around 55 minutes to do, if I work quickly (I timed myself). With a knee, the patella appears as the lower leg bends, and rounds as the leg straightens. Fabric introduces similar complications.
Greenlaw wrote: Sun Jun 20, 2021 4:54 am
One more question. Is there a way to copy and flip a left arm with a SBA, so that it can be used as a puppet's right arm with a pre-configured SBA? That would cut my SBA-time in half.

What I usually do is I save a copy of the character, then strip out everything but the limb and the bone it's parented to. Then I change the names of the bones and the relevant Actions. finally, I flip the root bone. Now we have the mirrored version of the arm with unique bones and action names, which can be inserted in the character without conflicts.

BTW, the reason you want to keep the root bone...without it, it's possible to break the Smart Bone Action. (I'd have to intentionally break one to remember and explain what I mean. Maybe if I have time later.)

Regarding the modular approach, I've created some modular setups at work for complex 'sub-rigs' like my hands setups that have a lot of SB controls, but it can be tricky. Sometimes I'll 'Frankenstein' characters from the parts of other characters but most of the time the characters I'm asked to build are so uniquely designed, I find it easier to just build them from scratch.
I'm having trouble with this step. Everything "looked right," but the SBA didn't bend correctly. I renamed the bones and actions, so it's (probably) not that. I really want to figure out how to copy the left arm to make a right arm, but I don't know what I'm doing wrong. I tried re-binding the points and that didn't help. I tried three times so far, but I must be making the same mistake over and over. Oh well; I'm happy to know that copying an arm with an SBA from one side of the body to the other is possible, though.

Thanks for your help!
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Export and Import Actions

Post by synthsin75 »

Hoptoad wrote: Sun Jun 20, 2021 1:44 pm Is there a way to keep the point binding of the copied arm, or will the breaking of point binding always happen? It's not a big deal, but if there's a way to keep the point binding, I may as well do it.
I'm afraid those are lost by having to paste the bones and the layers separately.
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Export and Import Actions

Post by Hoptoad »

I expected that was the reason. Thanks for confirming.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export and Import Actions

Post by Greenlaw »

Glad that info helps. (FYI, I edited some of the above for clarity,..and because I'm a bad writer.) :)

Yeah, IMO, Moho's rigging system isn't really designed for the modular 'construction kit' approach, but it can definitely be done. You just need to be aware of everything that can break or go wrong, and avoid or at least anticipate certain issues so you can be ready deal with them.

Hopefully, a future generation of Moho will focus on making this kind of workflow easier.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export and Import Actions

Post by Greenlaw »

Hoptoad wrote: Sun Jun 20, 2021 2:55 pmI'm having trouble with this step...I really want to figure out how to copy the left arm to make a right arm, but I don't know what I'm doing wrong...Oh well; I'm happy to know that copying an arm with an SBA from one side of the body to the other is possible, though.
Re: creating mirrored limbs, I should walk through the steps to make sure I'm not missing some important detail. FWIW, it hasn't been that difficult for me unless there are many SBA actions involved in the part. (It hasn't been uncommon for my 'all-purpose' character rigs to have a hundred or more Smart Bone Actions.) The main thing is to work on the 'mirror' limb in a separate project as described above, so I can avoid potential conflicts with the 'original' limb.

I'll make a video demo for this workflow but it might be a while before I can get to that. (I have a backlog of other videos to finish first.) :P
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Export and Import Actions

Post by Hoptoad »

I tried a couple more times. No luck.
Greenlaw wrote: Sun Jun 20, 2021 4:19 pm Re: creating mirrored limbs, I should walk through the steps to make sure I'm not missing some important detail. FWIW, it hasn't been that difficult for me unless there are many SBA actions involved in the part. (It hasn't been uncommon for my 'all-purpose' character rigs to have a hundred or more Smart Bone Actions.)
That's good news. The most SBAs I've made in a bone rigged character is 12, at most. Aside from an abundance of points, my rigs are fairly simple.
Greenlaw wrote: Sun Jun 20, 2021 4:19 pm The main thing is to work on the 'mirror' limb in a separate project as described above, so I can avoid potential conflicts with the 'original' limb.
I wonder if you used a script I don't have, possibly to flip the bones? The "end flip" and "side flip" buttons aren't good for mirroring arms and legs, I noticed. I suspect the problem lies somewhere in the flipping. The SBA doesn't seem to like the flipping.
Greenlaw wrote: Sun Jun 20, 2021 4:19 pm I'll make a video demo for this workflow but it might be a while before I can get to that. (I have a backlog of other videos to finish first.) :P
Cool, and thanks, but that sounds like it would take a lot of effort to make. I have a feeling that there is only one teeny-tiny thing that I'm doing wrong. If you don't mind, would you make a step-by-step which includes tool names?
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Export and Import Actions

Post by Hoptoad »

Greenlaw wrote: Sun Jun 20, 2021 4:19 pm I'll make a video demo for this workflow but it might be a while before I can get to that. (I have a backlog of other videos to finish first.) :P
I found a workaround. Whew. No need for any more help with this issue. Thanks for all the help and information you generously provided in this thread; I learned a lot.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export and Import Actions

Post by Greenlaw »

Glad you got that solved!

I’m going to do a walk through and document this anyway. I have a feeling some of what I wrote above is inaccurate but I need to be sitting in front of Moho to be sure.
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Export and Import Actions

Post by Hoptoad »

I'm still very much interested in how you did it, and curious about where I went wrong. I probably made a mistake when doing something that can be done through multiple means; for example, I might select points, copy/paste, and flip the points and you might duplicate the layer, delete the unnecessary points and flip the layer. And the difference between the way we did things is important for some reason.

Thanks again for all your help! My work-around, by the way, is nothing sophisticated. I simply re-worked the design to reduce the number of points, so making a SBA isn't so time-consuming.
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Export and Import Actions

Post by synthsin75 »

Hoptoad wrote: Wed Jun 23, 2021 11:36 am ...for example, I might select points, copy/paste, and flip the points and you might duplicate the layer, delete the unnecessary points and flip the layer. And the difference between the way we did things is important for some reason.
Editing the points (flipping, deleting, adding, etc.) will mess up any existing smart bone actions. So if you're duplicating limbs to flip for the other side, layer operations are all you want to do.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export and Import Actions

Post by Greenlaw »

You may already be doing this, but I like use the Magnet tool to reshape vectors. It's much easier and faster to animate a bunch of points with the Magnet tool than using the Transform Points tool. Before using it, hold down Alt and drag the Magnet tool to adjust its radius size. Tip: the Magnet tool has an option for working on only selected points. Ctrl can be used for selecting points. This is useful for editing very complex shapes with many points that you don't wish to edit.

The Magnet tool is fantastic for editing shapes during animation too. For example, I use it in a situation where I need to tweak facial features to get just the right expression, or maybe when a hand isn't quite convincingly gripping something. Just make sure to keyframe the 'neutral' point positions ahead of the edit so you can easily revert back to that shape when you need to. (Clicking Reset for points also does this--it reverts to the shape at frame 0.)
Post Reply