I wrote a little mel script that is supposed to set the X Translation value of a selection of polyVertices to zero. I use this before I copy/mirror/combine/mergeVertices my symmetrical Poly Objects, the script works ok but as soon as I have more than a couple of vertices selected (maybe a dozen or so) it puts vertices on the same point which is not what it is supposed to do. It should simply get the Position of a given Vertex in an array and and set the x translation to 0. the other values(Y and Z ) should not be changed.
Has Somebody a clue what I do wrong ?
- create/use a poly-object
- select vertices
- run the script
//Beginning of script
//loop over the selected vertices
for ($vertex in $vertices)
//Get the translation values of the current vertex
xform -q -t -ws $vertex;
//Set X to 0 , keep the other values
xform -t 0 $translates $translates -ws $vertex;
//end of script