weld vertex just in elements - not elements together

Hi
Are there any script for velding vertex just in elements? For example... I modeled a big plant, but I have made a leaves with small gape (my mistake) And now, i would like just weld vertex in many elements, because leaves are editable poly elements, but i don't want to weld leaves with trunk together or leaves together. Leaves are very close together :(
I have tried ZORB script, but welding seems like doesn't work...welder modifier as well...:(
Are there any ideas ? Thx buddies.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Graph's picture

if you use the listener

if you use the listener select the whole script and hit shift+enter

Raphael 'Insanto' Steves
http://Graph.Net84.Net

tomastnt's picture

owesome :) works! THX

owesome :) works! THX

Anubis's picture

detaching elements will help

Hi Tomas,
as you say the leaves are very close together, I think detaching elements will help. You can detach quickly all elements using my Detach Elements script. You can process all leaves of the entire forest with it assistance. (btw I have a good reports by Xfrog about this script)

The next step would be to weld detached objects by loop through them. Here is a weld code snippets for poly and mesh objects:

-- for editable poly
for obj in selection do ( -- loop through selected objects
	obj.weldThreshold = 8.0 -- set weld threshold value
	allVerts = #{1..(polyop.getNumVerts obj)} -- get all verts list
	polyop.weldVertsByThreshold obj allVerts -- Weld
)
 
-- for editable mesh
for obj in selection do ( -- loop through selected objects
	thresh = 4.5 -- weld threshold
	allVerts = #{1..(obj.numVerts)} -- get all verts list
	meshop.weldVertsByThreshold obj allVerts thresh -- Weld
)

my recent MAXScripts RSS (archive here)

tomastnt's picture

Maybe call me a stupid, but

Maybe call me a stupid, but script witch you sent doesn't work. I have just puted the part of script for editable poly to the max listener,then selected 5 object in editable poly format and then ENTER in max script listener. Script writed this:

-- Syntax error: at ), expected
-- In line: )

so...I am sure, I am doing something wrong. But what?
THX Tomas

Graph's picture

not afaik

but doing it by hand for 1 plant wont be a problem

-go into element subObjectLevel
-select an element
-hold ctrl
-go into vertex subObjectLevel (not per keyboard, use the mouse & keep holding ctrl)
-now weld the verts by threshold
-next element

Raphael 'Insanto' Steves
http://Graph.Net84.Net

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.