Hi I'm trying to use some MEL code to orient a EP curve control to a joint and while it puts the control in the correct orientation it offsets the control away from the joint. Why does this happen? The code is below: ___________________________________________________________________________________________ { string $sel[]…
Thanks for the reply man, but no joy, now I get an error message: Error: line 7: Invalid object or value: 90 It seems to add 90 and -90 to the rotates of the EP curve object.
instead of using this float $translate[3] = `xform -q -ws -t $sel[0]`; you should get the position of one of the pivots like this float $translate[3] = `xform -q -ws -rp $sel[0]`; the -rp bit stands for Rotate Pivot and instead of using the xform command to move the control to the pivot just use $translate[0] $translate[1]…