View Full Version : move obj from one point to another
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-13-2007, 05: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.
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...
06-23-2007, 01: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`; //move to
float $posB = `xform -q -ws -piv $curSel`; //this one
spaceLocator -n XYZ -p 0 0 0;
xform -t $posA $posA $posA -ws XYZ;
parent $curSel XYZ;
xform -t $posB $posB $posB -ws XYZ;
07-05-2007, 11:34 AM
Hi, i am creating a foot Rig and i wanna know how to hold guides into it before beulding the rig...
07-05-2007, 11: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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.