Mirror portion of a rig

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Mirror portion of a rig

Post by swingsoneto »

Hi all! I'm a little stumped on this. I'm looking for a way to mirror a portion of a rig, eg. an arm, preferably something native (if it's not possible without a script, that's cool, but I'm the kind of dude that likes to learn to do things the hard way first so that I really understand what can and can't be done without extra tools).

I've found some workflows for mirroring shapes, points, and layers, but those don't seem to translate to groups of bones. How is this typically accomplished?
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Mirror portion of a rig

Post by Greenlaw »

Not sure what your setup is, but one way is to...

1. make a duplicate of your scene
2. flip the root bone for the limb
3. use Copy Layer and Paste Layer to move the artwork
4. use regular Copy/Paste to move the bones.

You may want to include part of the upper hierarchy so you don't break any actions that depend on preserving the rotations. After reparenting, you can delete the unneeded extra bones.

If you want to use a script designed for this sort of thing, check out Kuz Kuz's MR Transform Rig tool. This is an advanced tool, but after you understand how it works, it can do the job more easily.
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Mirror portion of a rig

Post by Greenlaw »

But if you're in the early stages or rigging and haven't set up any Actions yet, just duplicate the limb's group and flip the group (the flip layer buttons are at the top when you choose the Transform Layer tool.) Then you can copy/paste the limb, flip at the root, and bind the layers to these bones. Should only take a couple of minutes at most.

Ideally, this sort of thing is done in the early stage, so you won't have to deal with potential Smart Bone Action issues.
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Re: Mirror portion of a rig

Post by swingsoneto »

Greenlaw wrote: Wed Aug 16, 2023 4:35 pm But if you're in the early stages or rigging and haven't set up any Actions yet, just duplicate the limb's group and flip the group (the flip layer buttons are at the top when you choose the Transform Layer tool.) Then you can copy/paste the limb, flip at the root, and bind the layers to these bones. Should only take a couple of minutes at most.

Ideally, this sort of thing is done in the early stage, so you won't have to deal with potential Smart Bone Action issues.
Thank you for the response! I was having some trouble understanding how to make this happen; I wasn't sure what you meant by 'flip at the root'. Could you elaborate on how to do that? I'd like to understand it better.

I did a little trial and error and figured out that the math for mirroring a chain of bones is actually fairly simple. I went ahead and wrote a primitive lua script for flipping selected bones across the layer's axis and it seems to work pretty well.
Image
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Mirror portion of a rig

Post by Greenlaw »

swingsoneto wrote: Thu Aug 17, 2023 5:31 am I did a little trial and error and figured out that the math for mirroring a chain of bones is actually fairly simple. I went ahead and wrote a primitive lua script for flipping selected bones across the layer's axis and it seems to work pretty well.
Oh, that's very cool! Curious to see the script if you don't mind sharing it.

Anyway, all I meant was this...

Image

If you have a root bone aligned to the axis you wish to mirror across, you can copy and paste the child bones and flip the root. Then just delete the root.

If the root bone doesn't already exist, create one and parent the base of the child bones to it. Then select, copy/paste, flip, and delete.
Last edited by Greenlaw on Fri Aug 18, 2023 11:31 pm, edited 2 times in total.
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Mirror portion of a rig

Post by Greenlaw »

Bonus tip: I like to name my bones as I create them and give them an R or L designation at the end of the name. After I copy and flip the bones, I only need to change the final letter in the copy.

If you want to try a great third-party script, Eugene's Transform Rig Tool automates much of this, as demonstrated here...

https://www.youtube.com/watch?v=U8OVuOKyLrs&t=124s

Scrub to the 2:04 mark. This script can do much more than flipping bones, and it might be overkill for this situation. But it's definitely worth installing if you don't mind the learning curve.
Last edited by Greenlaw on Fri Aug 18, 2023 11:17 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Mirror portion of a rig

Post by Greenlaw »

I think many new Moho users might see the Flip Bones buttons only as an animation feature, but it works as a rigging tool too.

This is true about many Moho tools; they can work for rigging and animation. Another good example is Sketch Bones. For rigging, this tool lets you draw a chain of bones for your rig; and as an animation tool, it lets you animate that chain by drawing new shapes through it.
swingsoneto
Posts: 26
Joined: Mon Feb 20, 2017 9:23 pm
Contact:

Re: Mirror portion of a rig

Post by swingsoneto »

Greenlaw wrote: Fri Aug 18, 2023 6:40 pm
swingsoneto wrote: Thu Aug 17, 2023 5:31 am I did a little trial and error and figured out that the math for mirroring a chain of bones is actually fairly simple. I went ahead and wrote a primitive lua script for flipping selected bones across the layer's axis and it seems to work pretty well.
Oh, that's very cool! Curious to see the script if you don't mind sharing it.

Anyway, all I meant was this...

Image

If you have a root bone aligned to the axis you wish to mirror across, you can copy and paste the child bones and flip the root. Then just delete the root.

If the root bone doesn't already exist, create one and parent the base of the child bones to it. Then select, copy/paste, flip, and delete.
Ahhhh, I see, thank you for sharing a gif. That was very explanatory. I'm coming from Blender / AE, etc., so that's a pretty familiar workflow; but I hadn't considered using a bone like that. It's like a parent null in AE or the 3D cursor in Blender - a useful locator for mirroring that can be discarded after you're done with it. I love these Moho-specific tidbits, thank you; please keep 'em coming! :D
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Mirror portion of a rig

Post by Greenlaw »

Sure! Glad that helped.

Yeah, Moho doesn't have an equivalent of a Null (or Empty or Locater) object, but using a bone as a Null usually works within the Bones layer. Just set its strength to zero. Outside of the bones layer, you can use a Group layer like a null object.

There are times when I wish I could build a camera rig in Moho using nulls the way I would in a 3D program, but I usually find a workaround solution in Moho, or I just export layer passes (using Layer Comps and Moho Exporter), and import them as image planes in a 3D animation program or using a 3D compositing program like Ae, Fusion or Nuke, and do my final camera animation there.
Post Reply