Home Website Youtube GitHub

IK Controller rotation offset to Guide - only right side

Hello Guys :slight_smile:
I’m back with a weird issue that i can’t fix.

the issue I have is related to the IK controller of my right Hand.
I mirrored it but on the left side, everything is working as it should. The IK controller axes are aligned to the Guide and the NURBS curve is also aligned with the axe.

But on the right side, there is an offset of the axes and the NURBS Curve. And even the NURBS curve is offset to the axes.

Removing the option IK separated Translation and Rotation isn’t helping either.

If anybody has an idea plz feel free to drop it. I’m in a bit of a rush because the animator is waiting ;D
I linked the .sgt file perhaps somebody could have a look.
https://drive.google.com/file/d/1b2VvXbFX1bsPFSknuZa2y4elebHwsXnO/view?usp=drive_link



Thanks a lot for your time and effort!
Cheers

I don’t know if I can help or not. But if you are supplying an .sgt file it will be important to mention which version of mGear, which version of Maya?

It might be easier for someone to download a scene file that already contains your guide and rig.

Hi Chris
Im using version: 4.0.19
thought sharing the sgt would be the easiest to find out if the guide is broken or maya/my installation
Since the guide seem to be ok but building it causes the issue.
if i duplicate left to right or right to left it doesn’t make a difference right side is always messed up.

If you supply the .sgt, someone needs to know how to recreate what you did. So you need to include your Maya version too. If someone builds in a different version of Maya and can’t recreate it, then we’ve just wasted effort.

But if you want help fast (and 2 weeks have already passed), then I recommend you make it easy for people and give a file that they can just open and look. Just supply the guide and built rig.

Also the file you uploaded isn’t accessible without requesting access.

I think that must be a typo? I’m not aware of any such version.

image
thats what i get when clicking “about”

ok here is one of the rigs that has the same issue

hmm weird. That version isn’t listed on the releases page (as far as I can tell.) Do you remember where you downloaded it from?

Anyway, this isn’t about the version of mGear. It’s some combination of the angle of your limbs, and the fact that the IK controls are oriented to world by default.

There are “ikCtl_ref” and “fk_ref” nodes that are used to match the position when doing IK/FK switching. You can use that to grab the correct orientation and fix it in a script.


Here is a Python script I adapted for your rig. It basically just rotates the IK control to match that ref node. And unparents things or stores the orientation so it can set everything else back, so the hand doesn’t rotate when you fix the IK control.

This script is not 100% what you need. It breaks the FK hand orientation. So it needs a way to offset that back into place, by rotating “arm_R0_fk_ref”.

That’s the best I can offer for the moment. My rigs are different because I have an additional hand control that makes it much easier to offset once the IK controls are adjusted. Since you don’t have a single hand control, there are multiple elements that are directly connected to the arm that need to be juggled.

import pymel.core as pm
from mgear.core import attribute, transform
from mgear import rigbits

def fix_ik_hand_orientation(side):
    ### Orient the IK hands properly

    handRef = pm.PyNode('arm_{}0_ikCtl_ref'.format(side))
    ikCns = pm.PyNode('arm_{}0_ikcns_ctl'.format(side))
    ikCtrl = pm.PyNode('arm_{}0_ik_ctl'.format(side))
    armEff = pm.PyNode('arm_{}0_eff_loc'.format(side))
    
    # Store any old values, or unparent things so they don't rotate with the fix.
    metaRoot = pm.PyNode('meta_{}0_0_lvl'.format(side)).getParent()
    metaRootOri = metaRoot.getRotation(space='world')
    handChildren = ikCtrl.getChildren(type='transform')
    effChildren = armEff.getChildren(type='transform')
    pm.parent(handChildren, None)
    pm.parent(effChildren, None)
    
    transform.matchWorldTransform(handRef, ikCns)
    transform.matchWorldTransform(handRef, ikCtrl)
    metaRoot.setRotation(metaRootOri, space='world')
    # Zero out the ikcns_ctl
    rigbits.addNPO(ikCns)
    # reparent everything
    pm.parent(handChildren, ikCns)
    pm.parent(effChildren, armEff)

for side in 'LR':
    fix_ik_hand_orientation(side)
pm.select(None)

Chris, you are the best!
Thx, a lot for taking the time and looking into the issue.
atm I do not have much time atm (one-man animation/rigging armee :smiley: ) but as soon I get back to rigging I will have a closer look and hopefully find a lasting solution

Cheers
Marko