PDA

View Full Version : Pivots


C Lara
01-02-2007, 05:02 PM
Hi,

I was looking for a way to move pivost with mel, searching the forum I found this thread:

http://forums.cgsociety.org/showthread.php?t=154447&highlight=pivot

Based on this I ended up with this:

float $posn[3];

$posn = `pointPosition -w pPlane1.vtx[2]`;

move -a $posn[0] $posn[1] $posn[2] pPlane1.scalePivot pPlane1.rotatePivot ;

If applied to a plane with 1 subdivision on each way the pivot is moved to the upper left corner (from a top view)

This is ok, but what I need to know is why this doesnt have any effect on the actual position of the object, moving the object to 0 0 0 centers the object at the origin and what I need is that after moving the pivot and moving the object to 0 0 0 the pivot of the object moves to the origin.

Also it has no effect on the position of the children objects of this plane, the center of the plane is still 0 0 0 and again I need the pivot to be 0 0 0

Is there a way to fix this? What Im trying to do is getting rid of the negative positions of the children objects by moving the pivot to the mentioned vertex...

Thanks for your help

C Lara
01-03-2007, 06:56 PM
So, really nobody here knows nothing about this topic? Or nobody really cares to answer such a question?

Please let me know...

Sick Spider
01-03-2007, 08:29 PM
Edit-
Yup, both my old answers were wrong...:blush:

kojala
01-04-2007, 08:52 AM
do freeze transformations.

Robert Bateman
01-04-2007, 02:00 PM
This is ok, but what I need to know is why this doesnt have any effect on the actual position of the object, moving the object to 0 0 0 centers the object at the origin and what I need is that after moving the pivot and moving the object to 0 0 0 the pivot of the object moves to the origin.

Because there is no such thing as a translation pivot! To move an object somewhere else, you can only changes it's translation values.

Also it has no effect on the position of the children objects of this plane, the center of the plane is still 0 0 0 and again I need the pivot to be 0 0 0

yup.

Is there a way to fix this? What Im trying to do is getting rid of the negative positions of the children objects by moving the pivot to the mentioned vertex...

as kojala said. Feeze Transforms, which will change all of the vertex positions of the mesh so that the translation handle will get centered back to the origin.

C Lara
01-05-2007, 10:10 AM
Hi,

Thanks for your replays, and sorry if I was a liitle upset before, but looking a this thing slipping down in the list and seeming like something not so dificult to do... well.

Thanks again for your help
Carlos

Adam
01-08-2007, 04:01 AM
I think I may have a helpful script for you but Im not sure if it is what you need. I wrote a script that does the opposite of freeze transformation. If I understand correctly you need to move the pivot point but also have the real world cordinates of the pivot and therefore the object intacted after moving the pivot. My suggestion is to move the pivot point and then run my proc to get the actuall position of the object based on its moved pivot point. Finally move the object to a value of 0 0 0. This will casue the object to move to origin based on pivot point not where the pivot originally was or where it was frozen. Hope this makes sense. The script I wrote should also work on children relationships.

Tell me if this works or if Im completely missing the point or if you just need more info.

C Lara
01-08-2007, 07:56 AM
Hi Adam,

Well I got the problem fixed by now, this is what I did:

Create a bunch of planes
Move each plane to X=width/2 and Z=height/2 This locates the uper left corner of the plane at the origin
Move the pivot with xform to the upper left corner
freeze transformations
Create a collection of objecst for every plane and parent them
Move the planes

The result is that every child of each plane is located in the local space of the plane and since 0 0 0 is the upper left corner moving the object inside its parent plane returns only positive locations.

That was it, in the end it was simple, but my problem is that I have picked up maya not by the interface, but by coding, so I'm missing some info about its commands. At least thats what I think.

Thaks for your help,
Carlos

CGTalk Moderation
01-08-2007, 07:56 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.