Sorry, I reactivated an old post.
My team recently encountered an issue where the legs didn’t deform correctly when the IKFKBlend value for the legs wasn’t 0 or 1, but rather an intermediate floating point value (0.3, 0.5, etc.). Our solution was to fix it by following the arm connection method, and we got the correct result.
I tried @pascalf 's method, which fixed the issue described in the title of this post, but the feet didn’t deform correctly when scaling the IK controller alone (the heels didn’t scale with the controller).
I’ve included my solution below for those who encounter the same issue in the future.
The image below shows the node connections:
Here’s the Python code for a quick fix:
import maya.cmds as cmds
sides = ["L","R"]
side_index = 0
for side in sides:
leg_L0_ik_ref = f"leg_{side}{side_index}_ik_ref"
leg_L0_fk2_ctl = f"leg_{side}{side_index}_fk2_ctl"
eff_loc = f"leg_{side}{side_index}_eff_loc"
mgear_intMatrix = cmds.createNode("mgear_intMatrix")
mgear_mulMatrix = cmds.createNode("mgear_mulMatrix")
decomposeMatrix = cmds.createNode("decomposeMatrix")
if cmds.objExists(eff_loc):
con_info_attr = cmds.listConnections(f"{eff_loc}.scale",plugs=True,destination=False)
con_info = cmds.listConnections(f"{eff_loc}.scale",plugs=False,destination=False)
if con_info_attr:
cmds.disconnectAttr(con_info_attr[0],f"{eff_loc}.scale")
if con_info:
mgear_ikfk2Bone = cmds.listConnections(f"{con_info[0]}.inputMatrix",plugs=False,destination=False)
cmds.connectAttr(f"{mgear_ikfk2Bone[0]}.blend",f"{mgear_intMatrix}.blend")
cmds.connectAttr(f"{leg_L0_fk2_ctl}.worldMatrix[0]",f"{mgear_intMatrix}.matrixA")
cmds.connectAttr(f"{leg_L0_ik_ref}.worldMatrix[0]",f"{mgear_intMatrix}.matrixB")
cmds.connectAttr(f"{mgear_intMatrix}.output",f"{mgear_mulMatrix}.matrixA")
cmds.connectAttr(f"{eff_loc}.parentInverseMatrix[0]",f"{mgear_mulMatrix}.matrixB")
cmds.connectAttr(f"{mgear_mulMatrix}.output",f"{decomposeMatrix}.inputMatrix")
cmds.connectAttr(f"{decomposeMatrix}.outputScale",f"{eff_loc}.scale")