hey Folks,
Im working on a bigger Script right now and need to check for vertices if they are selected. I would love to stay in the Editable_Poly Environment. To be concrete, I try to iterate through this :
for refVIndex=1 to refObj.GetNumVertices() by 1 do(
)--but my mesh is big so this is way to time consuming. So i try to find a way to iterate through all my selected Vertices. But i also use my refVIndex to create vertices in order at some part in the script so simply using a function which differs in structure will create bad results.
Any help would be appreciated
Greeting EliDerDeli
Comments (10)
Comment policy
.
there's no difference in performance when we need to do a couple of these checks
here's a little test
-----------
checks: 4
--------
Time: 0.002sec. Mem: 320L
Time: 0.002sec. Mem: 320L
Time: 0.001sec. Mem: 576L
-----------
checks: 16
--------
Time: 0.005sec. Mem: 1088L
Time: 0.003sec. Mem: 1088L
Time: 0.004sec. Mem: 2112L
-----------
checks: 64
--------
Time: 0.016sec. Mem: 4160L
Time: 0.007sec. Mem: 4160L
Time: 0.01sec. Mem: 8256L
-----------
checks: 256
--------
Time: 0.06sec. Mem: 16448L
Time: 0.026sec. Mem: 16448L
Time: 0.037sec. Mem: 32832L
-----------
checks: 1024
--------
Time: 0.254sec. Mem: 65600L
Time: 0.14sec. Mem: 65600L
Time: 0.188sec. Mem: 131136L
-----------
checks: 4096
--------
Time: 1.068sec. Mem: 272816L
Time: 0.597sec. Mem: 272816L
Time: 0.806sec. Mem: 542136L
.
So, in this case everything is personal coding style. :)
.
If I understand you correctly you want to know if a vertex with certain index is among selected vertices. Instead of using a loop use bitarray operations:
Let say that you want to know if vertex 15 is selected.
.
there's no need to find intersection
.
Is this work for two or more verts that have to be checked if they are selected?
.
for multiple indexes I'd check it like this
.
Is there any benefits to use "-" instead of "*"?
.numberset is slower in general
.
I know, but sometimes, by habit, I use .numberset. :)
Perfect thank you very much, that will help a lot :)