View Full Version : Mirror vertices from one side to the other

02 February 2005, 09:31 AM
Hi I want to mirror my vertices from +X to -X.

I only want to model one side of the face and then copy that information over to the other side. I have tried to negativley duplicate it and all that but it doesent work well with blendshapes, I guess the vertexID gets messed up?

I can get the world posistion using : pointPosition

But I cant figure out(have no brain) how to get that information over to the negative side to the correct vertex....

Is there away or is there perhaps a smarter solution out there??


02 February 2005, 10:56 AM
I've been meaning to get around to working this out myself too.

Here's a bit of code I clipped from one of my old commands that I thought might be related...
// Procedure flipVert is designed to change the value of one vertex location in X, Y, or Z space
// from positive to negative, or from negative to positive. This will later be used to compare
// with other vertex locations on the target side of the object, to determine which corresponding
// vertex has the closest location.
proc float[] flipVert(float $targetVertName[], string $axis)
float $flippedVert[3] = $targetVertName;
case "YZ":
$flippedVert[0] = $flippedVert[0] * -1;
case "XZ":
$flippedVert[1] = $flippedVert[0] * -1;
case "XY":
$flippedVert[2] = $flippedVert[0] * -1;

But basically, you'd have to break each vert in the geometry into either a positive or negative group, based upon it's X, Y, or Z position (using whichever axis you wish to mirror over,) and use this to query and store the position of each vert in both positive and negative groups... then switch these values across the axis to be flipped.

...This is just what I've been thinking in my head. I have another script for splitting the verts into pos and neg groups as well, I do believe...

02 February 2005, 11:18 AM

but how dose maya know which vertex to move?

and how do i assign
loat $targetVertName[], string $axis

I'm really a beginner in dont be suprised by the stupid Q's



CGTalk Moderation
02 February 2006, 12:00 PM
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.