View Full Version : Changing pivotpoint with mel

12 December 2010, 08:14 PM
Hi all.

I have a little problem since my skills in mel is very limitied.

What i want to do is to have a ctrl object, for example a nurbs circle controling another objects pivot point.

is this possible with mel? and if so, can anyone point me in the right direction?


12 December 2010, 11:57 PM
You could connect the translate of the pivot-controller to the rotatePivot and scalePivot of the controller, like this:
//Define the names of the objects
string $pivotCtrl = "locator1";
string $obj = "pCube1";
//Connect the translate of $pivotCtrl to rotatePivot and scalePivot of $obj
connectAttr -f ($pivotCtrl + ".t") ($obj + ".rotatePivot");
connectAttr -f ($pivotCtrl + ".t") ($obj + ".scalePivot");

However, if you're going to animate the pivot, you should check out Jason Schleifer's "Animation Friendly Rigging", it's awsome (if you're interested in rigging) :) Anyway, one of the things he goes through is how to set up an animatable pivot point.

12 December 2010, 12:20 AM
Thank you! ill have a look at the code right away!


12 December 2010, 12:29 AM
Thanks! that worked just as i wanted! :)

CGTalk Moderation
12 December 2010, 12:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.