Home Website Youtube GitHub

Leg_3jnt_01 Not Building in Right Place

Hello. I’m pretty new to mGear, so hopefully this is a rookie mistake. I’m using Leg_3jnt to create the legs on a stylized insect, and they aren’t all facing forwards. The front legs (which are facing forwards) work perfectly. However, the middle and back pairs of legs (facing 45-degrees and 90-degrees away from the front) are building with the knees and ankles in the wrong position.

I’m experimenting with using a post script to manually move them to the right spot, but this feels hacky.
Any suggestions?

I’m on mGear 3.79, and unfortunately can’t upgrade due to my client’s pipeline.

Hi @mrVal I’ve just upgraded your user level, so now you should be able to post screenshots. That might help figure things out.

Or can you share a guide file to look at?

If you just moved the knee sideways to “rotate” the leg, it might not work as expected. You might have to only bend the knee in a forward angle, and then rotate the entire root of the guide. Or maybe there is a bug.

1 Like

Hi Chris, thanks for the quick response! I’m attaching here a screenshot of the guides and resulting legs, as well as a Maya file with just the offending guides included.

Maya file.

I was careful to keep everything planar when positioning the guides, so I don’t think that’s the issue.

Interesting update: Sometimes the legs work properly if I only build the leg… but if I build the entire rig they always build out of place.

I’ll try to take a look this weekend.

But if you change some of the space switches, does it pop? Or pop back into correct position? I wonder if any of the space switch constraints are flipping or something. That could possibly explain why it works when only the leg is built.

I would appreciate that very much.

I went back in and tried the following:

  • Removed the space switch references
  • Changed from spring solver to RP solver
  • Tried different space switches
  • Tried adding a joint to the master control

Nothing helped, unfortunately. I’m interested to see if you’re able to find anything.

The ikSpringSolver (this is a Maya solver, not an mGear issue) is pretty temperamental. It’s hard to use, and it often flips.

You can solve the direction problem by changing the solver to rotation plane. (Like you already tried and mentioned.)

image

But that might not behave 100% the same. So you’ll have to test.

Even though the direction is fixed, the limb still does a weird bend.

And that is basically because the solver (or the component?) expects a leg-like bend, with the knee more forward than the ankle. If it doesn’t have that bend, I guess it just has trouble solving the angles properly.

If I put the knee more forward, and still using “rotation plane”:

This might mean you’ll have to either adjust the angles of your neutral model (if possible), or consider rigging this in a different method.

Chris, thanks again for having a look at this. I understand that I’m asking the solver to do something it wasn’t intended to do (with both the knee and ankle bending in the same direction). The odd thing is that it works perfectly on the front leg.

Being so new to mGear, I’m hoping you can help me decide how to proceed. My first thought is to generate all of the legs facing forwards on Z, then rotating them and reparenting them to the main rig afterwards. How complex are the hierarchies and connections in an mGear rig? Is that going to be a huge pain in the butt?

Oh right, I kind of forgot the main aspect of your question; they work until you include them with the full rig. I’ll try to dig a little bit more and see if I can spot why that happens.

The hierarchies and connections can be a bit tricky sometimes. But building them straight and moving them into place might be a decent strategy. If you have space switches, you may have to update the constraints so it stays in place.

This is the PyMEL equivalent of hitting “Update” on a parentConstraint on a node that has been moved:

import pymel.core as pm
oCons = pm.PyNode('Your_Space_Switch_Parent_Constraint_Here')
oTargets = oCons.getTargetList()
pm.parentConstraint(oTargets, oCons, edit=True, maintainOffset=True)

1 Like

Ok, so I’m not super sure what happened here, but for the sake of anybody else running into this issue… I ended up setting up my scripts to import everything into the scene while building the rig (so the scene contained no geometry, just the rigging guide). For whatever reason, it always places the joints in the correct place when run this way.

Chris, thanks again for having a look at the file and helping me to troubleshoot.

3 Likes

Strange! But glad it worked out!