PDA

View Full Version : mel expression for pivot control


MegaManZZ
06-07-2009, 05:17 PM
what i'm trying to accomplish is a way to make a objects pivot point attach to another object. I'm assuming the best way is an expression.

an example of this would be:
create a sphere
create a cube

attach the cubes pivot to the sphere so that whenever the sphere moves to a new location it becomes the cubes new rotation point.

hope this all makes sense

cbamber85
06-08-2009, 08:32 AM
You can just connect the translate plug from one transform node to the rotatePivot plug of another object's transform node.

MegaManZZ
06-09-2009, 04:51 PM
thanks i thought it was an easy answer but i guess i just had some dumb typo's in my code. thanks for the response!

theflash
06-09-2009, 06:16 PM
Directly connecting to rotatePivot won't work. It causes sliding of the object if object has some rotation already when you change the pivot like that. The rotatePivotTranslate should also be manipulated accordingly to stop this sliding effect. But the actual math might be complicated for what you want to do.

Instead, I would recommend using a parent transform node which acts as a pivot point. This is the cleanest and easiest solution. But if that doesn't work for you then you have to use expression and xform command to manipulate pivot point.

CGTalk Moderation
06-09-2009, 06:16 PM
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.