PDA

View Full Version : Merge Vertices script


bry
05-24-2003, 06:17 PM
Hi,

I'm having problems creating a script that executes a "Merge Vertices" command with polyMergeVertex, because of the selection modes and vertex IDs.

Could anyone help me on how i could make a script like this that would work with a fixed distance setting but on any object?


Thanks,
bry

LordGolem
05-26-2003, 03:29 PM
If I understand you need something like this:

global proc dpMergeVertex(float $dist)
{
string $selection[] = `ls -sl`;
string $sel;

for($sel in $selection)
{
select -r $sel;
string $shape[] = `listRelatives -shapes $sel`;
if(`objectType $shape[0]` == "mesh")
polyMergeVertex -d $dist -ch 1 ($sel+".vtx[:]");
else
warning ($sel + " isn't a poly mesh.");
}
}

An alternative whould be to select all the poly objects in the sene and perform the "polyMmergeVertex".
I hope is this what you're searching for! ;)

bry
05-28-2003, 12:09 PM
Hi,

that was exactly what I needed.

Thanks a lot!

bry

CGTalk Moderation
01-15-2006, 05:00 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.