|
CURVE GIZMO http://www.borafx.com
In this tutorial, I will try to explain what I called a curveGizmo and its practical uses in character rigging. CurveGizmo is basically a paramatrical third degree nurbs curve, with custom magnitude and speed channels, and it outputs nurbs curve`s position as a floating point value at any sampled time. You can use it on many rigs, some of which might be a wing flapping creature or a breathing human character. Before we start lets go ahead and adjust some grid settings ( display > grid □ ). This will be handy while drawing our curves. Set grid lines every 2 units and grid subdivisions to 1. Open the ep curve tool settings ( create > ep curve tool □ ) and set curve degree to 1. Draw a box shaped curve in the front view, 2 units tall and 4 units wide, as in the figure below;
Draw a second horizantal curve starting from the origin and to the box`s end.
Now for each curve open the attribute editor, under its shape tab scroll down to drawing overrides section, enable the overrides and set display type to `reference`. So they won`t be selectable. Draw a third degree curve with cv curve tool ( create > cv curve tool ) something similiar to image below. Just make sure curve doesn`t overflow our box shape and starts at X = 0.0 and ends at X = 4.0. Rename it to motionCurve.
We need to rebuild the motionCurve so its paramater range is 0 to 1. So select the curve and go to curves > rebuild curve options, set paramater range to 0 to 1, select keep CVs and apply the rebuild. Select the motionCurve, and add two floating point attributes named magnitude with default value of 10.0 and speed with default value of 1.0 and output with default value. Open the hypershade window and display only bottom tabs. Select and add both motoinCurve`s shape and transform nodes to the hypershade graph ( graph > add selected to graph ). In the command line execute; createNode pointOnCurveInfo and add that node to the hypershade grap as well ( graph > add selected to graph ). Than connect motionCurveShape.local to pointOnCurveInfo1.inputCurve so pointOnCurveInfo samples the motionCurve. Now open the expresssion editor ( window > animation editors > expression editor ) and create the following expression; pointOnCurveInfo1.parameter = (time*motionCurve.speed)%1.0; Create a multiplyDivide on in hypershade. Connect pointOnCurveInfo`s Y position result to the input1X and motionCurve.magnitude to the input2X of the multiplyDivide node. Connect multiplyDivide node`s outputX to motionCurve.output. You should have a hypershade network like this;
Our curveGizmo is ready now. Group all 3 nurbs curves in the outliner so you can move them around in the scene. Now you can connect anything to motionCurve.output channel and animate it. You can also animate the curve`s CVs to change its motion over the time.
To demonstrate, I will just draw a 5 joint skeleton and connect motionCurve.output to their Z rotation. [ download scene file: curveGizmo.ma ] If you having troubles, please feel free to drop me a line. Stay tuned for more tutorials/tricks. Bora Dayioglu
|