PDA

View Full Version : Pivot Align For Objects


neverman
03-30-2006, 08:42 PM
My goal is to align one objects to another object with both rotation and position.
I basicaly want them to snap both orientation and translation using the pivot.
If possible i would like to avoid using constraints to accomplish this.

I saw some posts about this mentioning Pivot Toolbox but they were all from '01 and the most current version i can find is '02.

Is there a way to do this within Maya or a different tool i should use?

thanks - i havent been back in maya for 4 years and im feeling a little crippled :\

Emil3d
03-31-2006, 02:20 AM
Select first the shape node then the transform node and in the command line type:
parent -r -s;
and press Enter.


You can make this command a shelf button

neverman
04-03-2006, 01:24 PM
Well that helped me parent the objects ... not sure how that will help but thanks for the reply.

We ended up having a scripter just write a mel script for it - in the end it was a bit of a complex bit of code :\

there is also a mel script floating around called ali.mel that seems to do the trick though with about 6 button pushes.

Emil3d
04-03-2006, 05:53 PM
I guess I only gave you a hint for starting point:). Here’s a step by step way to make this work

Open the Outliner and from its Display menu check Shapes. Click the plus signs in front of the names of your objects to reveal their Shape nodes under the Transform nodes.

First select the Shape node of the object that you want to align, then hold Ctrl and click to add to the selection the Transform node of the target object.

In the command line type: parent -r -s; and press Enter. This will delete the Transform node of the aligned object and its Shape will assume and get parented under the Transform node of the destination object.

Duplicate the object (the Transform node containing the 2 Shape nodes). If you want to keep the history, choose with the input graph in the duplicate options.

Delete the redundant Shape node from each object and you will end up with the 2 objects with the identical transfom nodes.


This may sound complicated if you are not familiar with all these actions, but it in fact takes several seconds if you have hotkeys for them .

neverman
04-03-2006, 07:36 PM
wow - very interesting way to go about it.
this method definatly works.

it is complicated though and mixes up the hierarchy rather violently.
i like how it works though and aplaud the creativity behind this method.
good stuff - thanks Emil

Emil3d
04-03-2006, 10:03 PM
Well the idea behind this approach is to make a copy of the transform node of the target object and replace with it the transform node of the object that needs the same transformation. If the aligned object is part of a complex hierarchy, then first duplicate the target, drop it in the same hierarchy level, and then replace the transform nodes there. You can delete the shape node of the target at any time after it has been duplicated. This will in effect be equivalent of creating an empty group with the needed transformations (position, orientation, and scale).
A empty group in Maya is simply a trasfrom node without a shape node.

CGTalk Moderation
04-03-2006, 10:03 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.