Saturday, 6 June 2009

multiply/divide node


Right gonna try and decipher what i've just done..

The idea is to get the spine to stretch with the curve. So 1st job is to re-name the Curve, the effector and the IK Handle to BindSpineSIKCurve, BindSpineSIKEf and BindSpineSIKHandle respectively.
Then open the Hypershade window.
Type the following Mel script on the command line: arclen -ch on BindSpineSIKCurve; (hit enter)
This creates a new node in the attributes that tells us the length of the curve (in this case its 9.147).

Now, select the BindSpineSIKCurve and click Graph - Add selected to Graph. A little curve node icon will appear. Whilst its still selected go back to graph and click Inpu and Output selections. They should be joined by 3 other nodes - one of which being the ArcLen node we've just created; rename this "BindSpineCurveInfo"

So up to here we have our curve shape node, which is attached to an IK handle and a curve info node. Dead easy! Next step is to create a multiply/divide node (see top illustration) and plug in the arclength output into input1, input1x on the multiply/divide node.

I think this means the value of the arclength is sent to the multiply/divide node to calculate the what the length of the spine should be. The second image is the attribute for the multiply/divide node. Input 1 is the current curve length and input 2 is the original curve length. You have to tell Maye what to do with both numbers, at the moment the default is set to multiply, change it to divide.

So when the arclength increases for instance to lets say 15units, Maya will do the sum 15 divided by 9.147=1.639(approx). The length of the joints needs to increase by 1.639 in order to stay in proportion with the curve. (This is providing you add all the joints to the hypershade by selecting them and going Graph - Add selected).

Still not 100% happy about the ins and outs of the hypershade and what all the connections mean, so could do with a bit of background knowledge in this area.

No comments: