View Full Version : move obj from one point to another

06 June 2007, 10:30 PM

I am trying so hard to do this, I know that it is simple but I simply can't find a way:

- I know the x,y,z coordinates from both start and end points
- I have an object which has to go from start to end, in a slow movement (visible, smooth)
- I am writing a script in Python, and I am trying to figure out an expression to do it, but everytime I run it, the obj goes another direction....

Any help would be immensely appreciated... I trying to find on the web but I couldn't...

Thank you a lot in advance

06 June 2007, 04:54 PM
Ok this is easy to do with mel, I haven't touched python yet, not sure the major differences I know the syntax is really different though, but the set up of the code is different so I don't think I'd be able to just look at some other script to figure out how to write this up for you.

Can expressions even use python code?

If you post the movement section of your script, debugging is easier then learning a new language.

06 June 2007, 04:24 PM
hey, I gave up on that since I saw it wasn't really necessary for my project :P

Python is not so different in syntax, it is more simple actually... And it is much more powerful than maya, while it can also use all maya commands within it... (even expressions!)

I definitely recommend everybody to try it out...

thanks anyway!

06 June 2007, 12:28 AM
This works by querying the pivot point - even if its in a group and the translates/transformations are messed up. ObjectA is parented to the locater. You can then ungroup. Can you just key the start/end positions?

string $curSel[] = `ls -sl`;
float $posA[] = `xform -q -ws -piv $curSel[0]`; //move to
float $posB[] = `xform -q -ws -piv $curSel[1]`; //this one

spaceLocator -n XYZ -p 0 0 0;
xform -t $posA[0] $posA[1] $posA[2] -ws XYZ;
parent $curSel[0] XYZ;

xform -t $posB[0] $posB[1] $posB[2] -ws XYZ;

07 July 2007, 10:34 AM
Hi, i am creating a foot Rig and i wanna know how to hold guides into it before beulding the rig...

CGTalk Moderation
07 July 2007, 10:34 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.