PDA

View Full Version : Aligning pivots - how?


KlooM
09-29-2004, 08:34 AM
I'd like to align one object's pivot to another object's pivot both rotation and position
so far I got the $onepoint.pivot = $otherpoint.pivot but that's only for the position and the rotationpart seemed to be missing or I was just too confused about it to see it.

Basically I'm making a rig script and I need a few lines of scripting that does the same thing as selecting an object "affect pivot only" and aligning position/rotation pivot-to-pivot to a different object.

Wahooney
09-30-2004, 07:12 AM
Doing this type of thing in maxScript ain't easy but it is possible...

The way I understand it nodes have two transform matrices, pivot and object. The pivot transform is what is modified when you move the object around, the object transform is what is modified when you move the object around with Affect Pivot Only.

You will need <node>.objectOffsetPos, <node>.objectOffsetRot, <node>.objectOffsetScale, read up on it in the SDK.

If you're still having troubles I'll submit some script code for you.

KlooM
10-02-2004, 01:17 AM
So does this mean I basically have to move rotate the pivot to match the new rotation, and then offsetrotate the mesh back to its original position?

Wahooney
10-04-2004, 06:17 AM
Pretty much, yes... Then I would suggest that you reset your xform, it'll make any future modifications more predictable.

KlooM
10-05-2004, 02:29 PM
I'm now completing the script, but the objectoffset.hell is still missing and I don't see how I should do it. Could you send me an example where for instance $box01 aligns its pivot to $box02? I would be forever grateful!


This will be a one time transformation since it will reset the pivots in my rig to the angles best suited for animation, so I'd like to keep the xform the way it is so boundingboxes see the actual.. "bounding" ? Will this cause any problems if I'm not doing any further pivot offsetting?

KlooM
10-06-2004, 02:13 PM
I avoided the problem by generating a dummy sphere with the right pivot and then just attaching the object to it through mesh commands, it works perfectly and the rig has great knobby joints. Happyness!

Thanks for the help, I can take it from here (hopefully).

CGTalk Moderation
01-19-2006, 10:00 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.