for i=1 to Faces.count where mod i 2!=0 do
(
polyop.setFaceSelection myObject Faces[i]
)
Why i cant select all the face list i chose at the same time?
i used update $ , but no good resault…thanx.
for i=1 to Faces.count where mod i 2!=0 do
(
polyop.setFaceSelection myObject Faces[i]
)
Why i cant select all the face list i chose at the same time?
i used update $ , but no good resault…thanx.
I guess that the problem is that you are changing the whole face selection in each step of the for loop. You could first build a list of all the faces you want to select and then pass it to the “setFaceSelection” function, something like this:
oddFaces = (for i = 1 to Faces.count where mod i 2 != 0 collect i)
polyop.setFaceSelection myObject oddFaces
I tried but setfaceselection can not select a list of lists… : /
faces is a list of lists
i wonder how a for loop does not rewrite each time the previous selection…and
keep them all together…
I created this face list:
sel=#(#(1, 11, 21, 31, 41), #(3, 13, 23, 33, 43), #(5, 15, 25, 35, 45), #(7, 17, 27, 37, 47), #(9, 19, 29, 39, 49))
but there is no way to select them all at the same time…
thanx
You can get the current face selection and add each list to it, something like:
sel=#(#(1, 11, 21, 31, 41), #(3, 13, 23, 33, 43), #(5, 15, 25, 35, 45), #(7, 17, 27, 37, 47), #(9, 19, 29, 39, 49))
for i=1 to sel.count do (
currentSelection = polyop.getFaceSelection myObject
newSelection = (join currentSelection (sel[i] as bitarray))
polyop.setFaceSelection myObject newSelection
)
Or you can join the lists is a single one and pass it to setFaceSelection:
list = #()
for l in sel do join list l
polyop.setFaceSelection myObject list
This way the operation should be faster.