I was just checking this and wondered if I am doing this correctly and maybe if you can give me some tips how to implement this to mGear as custom step.
This is the code I am using to build. It looks like exploding because joint at the tip has 0 scale by default, tried to invert remap node’s output min and max but I don’t know if thats the right way
import maya.cmds as mc
sphere = mc.polySphere(n = 'test_sphere', ax = (1,0,0))[0]
mc.addAttr(sphere, ln = 'effect', at = 'double', dv = 0, k = 1)
jointsList = []
for i in range(0,11):
# Create joint
mc.select(cl = 1)
joint = mc.joint(n = 'joint_{}'.format(i))
# Create nodes
remap = mc.createNode('remapValue', n = 'remap_{}'.format(i))
mult = mc.createNode('multiplyDivide', n = 'mult_{}'.format(i))
quat = mc.createNode('eulerToQuat', n = 'quat_{}'.format(i))
# Make Connections
mc.connectAttr(sphere + '.effect', remap + '.inputValue')
mc.connectAttr(remap + '.outValue', mult + '.input1X')
mc.connectAttr(mult + '.outputX', quat + '.inputRotateX')
mc.connectAttr(quat + '.outputQuatX', joint + '.translateX')
mc.connectAttr(quat + '.outputQuatW', joint + '.scaleY')
mc.connectAttr(quat + '.outputQuatW', joint + '.scaleZ')
# Set node values
mc.setAttr(remap + '.outputMin', float(i)/10)
mc.setAttr(remap + '.outputMax', 0)
mc.setAttr(mult + '.input2X', 180)
# Append joints to a list, then use for skinning
jointsList.append(joint)
mc.skinCluster(sphere, jointsList)