So I’m trying to go through an array of selected edges, on an Edit_Poly modifier, and find the ones which are attached to only 0-1 other selected edges. Unfortunately I’ve found doing this is extremely slow using the method posted below (processing just 3000 edges takes 4-5 seconds on my PC), and was wondering if there was a better method anyone could suggest?
objMod = modpanel.getCurrentObject()
allSelEdgesBIT = objMod.getSelection #Edge
allSelEdges = allSelEdgesBIT as array
gc()
t1 = timeStamp()
endEdges = #()
endVerts = #()
for edj in allSelEdges do (
edjVrts = #((objMod.GetEdgeVertex edj 1), (objMod.GetEdgeVertex edj 2))
endVrts = #()
for vrt in edjVrts do (
vrtEdjs = for i=1 to (objMod.GetVertexEdgeCount vrt) collect (objMod.GetVertexEdge vrt i)
selVrtEdjs = ((vrtEdjs as bitarray) * allSelEdgesBIT)
if selVrtEdjs.numberset == 1 do append endVrts vrt
)
if endVrts.count != 0 do ( append endEdges edj ; append endVerts endVrts )
)
format "maxscript\nresult:%\ntime:% ms\n" test (timeStamp() - t1)
--4608 ms for 3000 edges on Edit_Poly




