[Closed] Ring skipping with gap of 1
Hi , i need a script that would save me alot of time at work but i couldnt figure out how to solve my problem…
The script is simple…i need it to do a ring but skipping one edge on 2 . I did my little routine myself , this is what i have:
$.EditablePoly.SelectEdgeRing ()
edgeSel = polyOp.getEdgeSelection $
last = true
–Routine Selection 1 sur 2
for total in edgesel do
(
if last == true then
(
last = false
edgesel[total] = false
)
else
(
last = true
edgesel[total] = true
)
)
$.EditablePoly.SetSelection #Edge edgesel
alright , the problem there is that max sort automaticly the edge selection…if you try it at home , you will notice it doesnt work perfectly. I you create a new cylinder and try the script , you will have it almost working except the first 2 edges that are selected next to each other…this is because max sorts the edges in the array by itself…I DONT WANT THAT!
lets say i modelled something from a cube then connected couple of times , if i ring that , it’ll be even worst cause the way max will asign the edges number will be no “incremental” at all…i just need to ring and skip 1 edge on 2… (i mean with gaps of one edge)
HEELLLLPPP!
thanks alot
I’ve been looking to do the same thing. I’ve gotten a little closer, but the script is far from bullet proof. E.g. it doesn’t work well on objects that have non-wrapping edge loops. But I’m sure it wouldn’t take too much tweaking to make it better. Here’s the main function:
fn skipRing sk =
(
newArr = #()
curEdge = #()
curEdge = polyOp.getEdgeSelection $ as Array – find the currently selected edge(s)
$.EditablePoly.SelectEdgeRing()
newArr = polyOp.getEdgeSelection $ as Array – create an array out of the EdgeRing
polyOp.setEdgeSelection $ curEdge
j = newArr.count/sk
for i = 1 to (j) do
(
$.setRingShift sk true false – Ring Shift by ‘sk’
append curEdge (polyOp.getEdgeSelection $ as Array)[1]
)
polyOp.setEdgeSelection $ (curEdge as bitArray)
)
As you can see I’m using the setRingShift function to skip through the rings and then am appending an array with that data. However, since it is only doing the RingShift in one direction, it will only select edges on one side of your initially selected ring. This isn’t a problem for cylindrical objects that have the edges wrap, but is a problem for other editable polys.
I’ll try and tinker with the script to make it more robust when I have more time (whenever that will be).
-Josh