PDA

View Full Version : finding and setting local vertex position


zin64
09-19-2006, 05:16 AM
Hi all,
I am searching for the script to set the local/object space of a vertex. i,e, I have script as below:

vector $aa = `xform -q -os -t pCube1.vtx[3]`;
vector $bb = `xform -q -os -t pCube2.vtx[3]`;
vector $cc = `xform -q -os -t pCube3.vtx[3]`;

I hope to move the pCube3.vtx[3] to the $aa value which will be in object space coordinate. I wonder what would be the right Mel script to use.

Thanks in advance.

SweeKim

bobu
09-19-2006, 07:08 AM
You can query the position in world space with the -ws flag and use those values when you want to move the vertex:

vector $aa = `xform -q -ws -t pCube1.vtx[3]`;

vector $bb = `xform -q -ws -t pCube2.vtx[3]`;

vector $cc = `xform -q -ws -t pCube3.vtx[3]`;

xform -a -ws -t ($aa.x) ($aa.y) ($aa.z) pCube3.vtx[3]

CGTalk Moderation
09-19-2006, 07:08 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.