Home Technical Talk

MEL snap vertices to another vertices

Nightasy
polycounter lvl 2
Offline / Send Message
Nightasy polycounter lvl 2
Greetings all,

I'm trying to figure out a means of which to snap a vertices of an object to a vertices of another object quickly. I made a bunch of morph targets that need certain vertices to be matched up precisely with the base shape. Now of course I could always do it manually but each morph has to have around 40 vertices matched up with the base shape so that could be tedious selecting each one on each morph shape and lining each one up with the base shape. Oye.

Here's what I tried but of course it didn't work and here I am. (I can't do a loop that cycles through all the blend shapes as some of them require special attention.) Just one object at a time lining up the specific vertices to the base shape vertices.

string $sel[] = `ls -sl`;
move ($sel[]+".vtx[457]") to ObjBaseShape.vtx[457];

Thanks for taking a look. I feel like I should know this but I've never had to write anything that does this kind of thing before. (I know the syntax is wrong. I just put that there to show what I was trying to do.) I should also mention that it can't be off by even a fraction of the teeniest tiny bit. They have to match exactly.

I imagine it would be easy enough to get the position of the vertices on the base shape then move the vertices of the morph shape to that location but isn't there a simpler way to do it?

Replies

Sign In or Register to comment.