Hi frends!
Forexample is not works:
(
for obj in (selection as array) do
(
PolyToolsSelect.NumericEdge false
obj.EditablePoly.ConvertSelection #Border #Vertex
obj.weldThreshold = 0.001
obj.EditablePoly.weldFlaggedVertices ()
subobjectLevel = 3
)
)
This script is works only with single object
Please help.
Thanks.
By
Comments (8)
Comment policy
Thanks guys for answers
here's the solution
Do you know that this is "worst case scenario" solution.
Come on man, you can do this better I'm sure. :)
Anyway ...
fn weldBorderVerts objs thresh:.001 = if objs.count != 0 do
(
local moOpenEdges = meshop.getOpenEdges, poOpenEdges = polyop.getOpenEdges
local moVertByEdge = meshop.getVertsUsingEdge, poVertByEdge = polyop.getVertsUsingEdge
local moWeldVerts = meshop.weldVertsByThreshold, poWeldVerts = polyop.weldVertsByThreshold
max create mode
with redraw off for o in objs do
(
case classof o of
(
(editable_poly):
(
o.weldThreshold = thresh
if not (edgelist = poOpenEdges o).isEmpty do (poWeldVerts o (poVertByEdge o edgelist))
)
(editable_mesh): (if not (edgelist = moOpenEdges o).isEmpty do (moWeldVerts o (moVertByEdge o edgelist) thresh))
)
)
)
weldBorderVerts selection
.
Now add few more lines for Editable Poly objects, so the weld threshold to be restored when te function finish its job. :)
Hey Kostadin, how are you?
Busy. :)
I hope you are well.
fn weldBorderVerts objs thresh:.001 = if objs.count != 0 do
(
local moOpenEdges = meshop.getOpenEdges, poOpenEdges = polyop.getOpenEdges
local moVertByEdge = meshop.getVertsUsingEdge, poVertByEdge = polyop.getVertsUsingEdge
local moWeldVerts = meshop.weldVertsByThreshold, poWeldVerts = polyop.weldVertsByThreshold
max create mode
with redraw off for o in objs do
(
case classof o of
(
(editable_poly):
(
oldthresh = o.weldThreshold
o.weldThreshold = thresh
if not (edgelist = poOpenEdges o).isEmpty do (poWeldVerts o (poVertByEdge o edgelist))
o.weldThreshold = oldthresh
)
(editable_mesh): (if not (edgelist = moOpenEdges o).isEmpty do (moWeldVerts o (moVertByEdge o edgelist) thresh))
)
)
)
weldBorderVerts selection