View Full Version : how to find exact same model ni the scene?

09-19-2006, 09:29 PM
different location, different name, just purely based on geometry it self.

compare vert to vert may crash maya... since its a big scene... any ideas?

09-19-2006, 09:41 PM
what about instead of comparing vert to vert, comparing vert/face/edge counts first, and if all three match, then comparing some random verts on both models, random faces, and random edges...comparing vert positions, the verts that make up the faces and edges.

here is a quick script, input is the shape node for the object you want to find ones that match it.

global proc tw_findMatchingGeo(string $matchToThis)
int $vertsC[] = `polyEvaluate -v $matchToThis`;
int $facesC[] = `polyEvaluate -f $matchToThis`;
int $edgesC[] = `polyEvaluate -e $matchToThis`;

string $others[] = `ls -g`;
string $buf[];
$buf[0] = $matchToThis;
$others = `stringArrayRemove $buf $others`;
string $matching[];
int $m = 0;

for($cur in $others)
int $vM[] = `polyEvaluate -v $cur`;
if($vM[0] == $vertsC[0])
int $fM[] = `polyEvaluate -f $cur`;
if($fM[0] == $facesC[0])
int $eM[] = `polyEvaluate -e $cur`;
if($eM[0] == $edgesC[0])
$matching[$m] = $cur;




select -r $matchToThis;
select -add $matching;

09-24-2006, 03:19 AM
i just found the polyCompare command, you might try it.

CGTalk Moderation
09-24-2006, 03:19 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.