I'm driving an ik spline twist with a ramp, which usually works fine (..ish). But recently, I've been trying to drive my twist with 2 ramps, merged into a layeredTexture. And for some odd reasons, it seems that maya doesn't understand it (no error, the layeredTexture simply doesn't affect the ik spline twist at all). Did anyone try this before ? Any reason why it doesn't work ? looks like the datas are of the same type (rgb color), so I'm wondering why it is not working. I suspect some weird override from autodesk for this mechanism... also, I'm not sure how maya "maps" the u and v informations on the curve, since it's not necessarily normalized.
# scene setup
parent = None
jts = []
for i in range(10):
jt = cmds.createNode('joint', ss=1, p=parent)
cmds.setAttr(jt + '.tx', 1)
cmds.setAttr(jt + '.displayLocalAxis', 1)
parent = jt
jts.append(jt)
ikh, _, _ = cmds.ikHandle(sj=jts[0], ee=jts[-1], solver='ikSplineSolver')
cmds.setAttr(ikh + '.dTwistControlEnable', 1)
cmds.setAttr(ikh + '.dTwistValueType', 2) # ramp
rmp = cmds.createNode('ramp', ss=1)
cmds.connectAttr(rmp + '.outColor', ikh + '.dTwistRamp')
cmds.select(rmp, r=1)
# ------ so far, it's working : moving the ramp attribute will affect the twist
layers = cmds.createNode('layeredTexture', ss=1)
cmds.connectAttr(rmp + '.outColor', layers + '.inputs[0].color')
cmds.connectAttr(layers + '.outColor', ikh + '.dTwistRamp', f=True)
# ------ this no longer works