Home Website Youtube GitHub

IK FK match on already built rig

Hi guys! It is good to be back after more than 4 years away :slight_smile:

So! Things seem to have changed a bit since 2021. My old rigs are still working but I was facing an issue regarding IK FK matching on rigs that didn’t have a host or RMB option and specifically the free Spiderverse rig by @iamwat

http://forum.mgear-framework.com/t/spiderverse-rig-for-free-mgear-rig/807

I searched the forum and couldn’t find the answer so this might help other people.

I can code but sometimes things fly over my head when things become too complex and the pymel change broke my picker.

The IK FK match I was using previously when the mGear viewport menu is not available but Noah on the mGear discord helped me out.

So if like me you like to have your IK FK match on a picker, here is the type of code you could be using, just change the name of the control and the side in the code:

import mgear.pymaya as pm
from mgear.core import anim_utils

pm.select ( "**SpiderVerse_ready07**:legUI_**L**0_ctl" )

# Get the namespace from the thing you have selected.
controlNamespace = pm.selected()[0].namespace()

anim_utils. ikFkMatch_with_namespace(
        controlNamespace,
        "leg_blend",
        "legUI_**L**0_ctl",
        ["leg_**L**0_fk0_ctl", "leg_**L**0_fk1_ctl", "leg_**L**0_fk2_ctl"],
        "leg_**L**0_ik_ctl",
        "leg_**L**0_upv_ctl",
        ik_rot="leg_**L**0_ik_ctl")

And here is a demo

I hope this will help someone else.

3 Likes

Nice!

Also, allow me a bit of self-promotion :sunglasses: but If anyone fancies a bunch of good features to offer to animators, my animpickers are full of them:
Visibility options, toggles for dynamics, space switches, font size, etc…

This is the code I have been using ever since, I guess, from the original animpicker template.

from mgear.core import anim_utils

if not INIT:
anim_utils. ikFkMatch_with_namespace(NAMESPACE,
“arm_blend”,
“armUI_L0_ctl”,
[“arm_L0_fk0_ctl”, “arm_L0_fk1_ctl”, “arm_L0_fk2_ctl”],
“arm_L0_ik_ctl”,
“arm_L0_upv_ctl”,
ik_rot=“arm_L0_ikRot_ctl”)

2 Likes