Home Website Youtube GitHub

EPIC_leg_01 twist/flip problem


I’m using the EPIC mannequin template and am running into an issue where the leg is twisting/flipping as illustrated in this gif:

My Maya is set to Z Up and I’m using mGear 3.7.11

I’ve looked at other rigs built with mGear and I have not seen this behavior on the legs. Is there something I might be overlooking?



I tested this in mGear 4 and I am not getting this behavior there. The leg is not twisting as seen above when built in 4.


Thanks for the confirmation @Hector :slight_smile:

Mgear4-3 Currently this is a bug we’re trying to tackle in our production, are there any other suggested fixes for this issue as MGear 4 isn’t fully Production Ready yet, I am currently trying to confirm if this issue is also fixed in our use case in MGear 4, but I would prefer not having to update our pipeline to a Beta Version.

I just installed MGear 4 and unfortunately it did not resolve the issue for our situation. While we’re working with an altered of the Epic_Mannequin I’ve build the rig in the example bellow from the standard template shipped with MGear 4 and replicated some of our poses in which it’s still causing issues.

Hi guys,

I am having the same problem with the rigs I am doing with MGear.

It looks like the issue is caused because of the way the twists joints are made within the MGear rig system.

The main problem is that the thighs joints are following the rotation of the pelvis and they should be still as the knees are, because the pole vector should be the one responsible of the orientation of the legs.

A default 2 joints IK chain with a pointConstraint of the ik thigh joint to a group, aligned to that joint and with a parentConstraint to the pelvis, follows the proper rotation that the legs should do as the pole vector leads the rotation. It would be really nice if the MGear team could implement that behaviour to the legs.

By the way, I have tried it on MGear 4 and the issue is still there.



I’m having the same problem in mGear 4.0 beta, Maya 2020 in a Z-up scene using the Epic components.

The upper legs are rolling when the world control is rotated on the Z-axis.

@Miquel I found that moving the leg rollChain1 node in the Y axis seems to reduce the problem, but doesn’t totally eliminate it. It definitely seems like a bug to have the upper leg’s roll change with the rotation of the world control though.

1 Like

I would like to add that this bug is also appearing in mGear 3.7.11, I’ve tried upgrading to the 4.0 Beta but got the same results.

1 Like

@Miquel I stayed up all night the other night trying to figure out what’s causing this upper leg flipping but wasn’t able to make much progress deciphering how the leg is set up as I’m pretty new to rigging in Maya.

I feel like the problem is coming from somewhere in the above nodes.

I’m reading in the Maya docs about the tendency of joints to flip on spline IK setups but I’m not sure where it derives it’s up or forward vectors from. I tried messing around with the Advanced Twist parameters but couldn’t find any settings that put the upper leg’s roll back in to Body space rather than Scene/World space.

Generally, the entire rig should fall under the umbrella of the World Control. Rotating or translating World should move the entire rig as a package without any impacts on twists or aim constraints. The way it behaves now is like it’s vectors are coming from Scene space instead of Body space.

I know it may be a while before this can get fixed in a release but in the meantime, does anyone know how to manually correct this? Are the nodes parented incorrectly? What is the actual cause?

I’m just giving the thread a bump since it was initially posted about two weeks ago with no insight posted yet as to what the cause of the problem might be and how to correct it.

So I noticed in moving the leg_r_root control around that the flipping was only happening in the skinned joint (thigh_r ), and not any of the rigged joints, at least not that I could see.

thigh_r is mgear matrix constrained to leg_R0_div0_loc_cnx_off

I deleted the mGear matrix constraint from thigh_r and parent constrained it directly to leg_R0_rollChain0 and the flipping no longer occurs. So I feel pretty confident that the flipping is not actually coming from the rollChain after all.

I’m going to study what’s going on with leg_R0_div0_loc_cnx_off to see if I can figure out if this is driving the flip.

1 Like

Hello @Andy

Thanks for the feedback. Sorry to hear this is giving you so many problems. I will check this ASAP.
Just to confirm. Have you tried this with mGear4 beta release or the latest version directly from the repo?

Just asking to be sure that is not fixed here:


Hi @Miquel!
I’m using mGear beta 4 that I got from here: Release mGear 4.0.0 Beta 1 · mgear-dev/mgear4 · GitHub

I downloaded it on Tuesday 8/24 so I think it should be the latest, but I’ll double check and see if there’s any code changes I don’t have.


Ok, I checked EPIC_leg_01>init.py and it looks like I have the old values:

self.tws0_loc.setAttr(“sx”, .0)
self.tws2_loc.setAttr(“sx”, .0)

I’ll try changing them to .001 and see if that fixes the problem.

Yeah, that looks like it fixed it! Sorry for adding unnecessary noise on the forum. For future reference, how do I make sure I’m testing the latest updates?

Also, I’m trying to learn. Why does changing the Scale X value on those two nodes stop the bone from flipping? I would’ve never guessed to try that.


the beta in the link is from june 7th :stuck_out_tongue:

Great to hear that the fix worked :smiley: