View Full Version : vertex positions ws on objects

04 April 2006, 09:04 PM
I know how to list vertices world position on an object when the vertices are selected in component mode, but how do you query them based on an objects name only?

So i have pCube1 selected in object mode, now list me all the vertices world space cords..

Any help appreicated.

04 April 2006, 10:24 PM
Lists vtx positions for all selected objects. Hope thats what you've been looking for.
Keep in mind tho that these values are NOT including tweaks. So if you have tweaks and want the correct position you need to query the pnts too and add it to the vrts value.

string $objs[];
int $vtxCount[];
$objs = `selectedNodes -do`;
for( $obj in $objs )
$vtxCount = `polyEvaluate -v $obj`;
print( eval( "getAttr " + $obj + ".vrts[0:" + ($vtxCount[0]-1) + "];" ) );

04 April 2006, 06:02 AM
this is simple question :)

select the polygon object and run the script

$obj = `ls -sl`;
$vtxCount = `polyEvaluate -v $obj[0]`;
for ($i = 0; $i <= $vtxCount[0]; $i++) {
print ("-----"+$i+"-------\n");
print `xform -q -t -ws ($obj[0]+".vtx["+$i+"]")`;

CGTalk Moderation
04 April 2006, 06:02 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.