[Closed] Aligning pivots – how?
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.
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.
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?
Pretty much, yes… Then I would suggest that you reset your xform, it’ll make any future modifications more predictable.
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?
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).