set pivot on lowest vertex
Hi I wanna set pivot on the lowest vertex of an object.So what I wanna do is not that confusing but cause I'm not a programmer I shall ask this so I know that I have to use min command so first how to get all vertex transformation of the object?I mean for getting the transformation of 1 vertex for example vertex 1 I can use this:
string $obj = "myObject";
float $pos[] = `xform -q -ws -t ($obj + ".vtx[1]")`;
So here I wanna get All of vertexes and if I write ($obj + ".vtx") It won't work and errors so I have to first get All of transformations as I think then I use min command like:
min $pos
But again doesn't work cause $pos is all X Y Z but I only want min command for Xs to find the minimum so it won't work another problem is min command works like this:
min -4 -6
/result:-6/
But when I print
print $pos;
I get:
-6.96213
13.486041
-65.218454
On three separate lines which won't work again plz help me.