But how would the logic know what shell “I’m” interested in? I would have to run that algorithm for all shells.
Also how would 4. work considering a vertex can belong to any number of UV’s (and therefore, UVId’s).
Anyway, I thought some more about this. What I really want to do is check how many UV’s a particular edge is connected to (either it’s connected to 2 or 4 - it can’t be connected to any other number) but my thoughts got back to the super slow “select-and-convert” method until I realized that there is actually a component conversion functions that doesn’t involve pm.select()
Example:
import pymel.core as pm
import time
orgSel = pm.ls(selection=True, flatten=True)[0] # Just checking one edge for demonstration
boolVar = False
start = time.time()
for edge in orgSel:
edgeUVs = pm.ls( pm.polyListComponentConversion(edge, fromEdge=True, toUV=True), flatten=True )
if len(edgeUVs) == 2:
boolVar = False
else: boolVar = True
print "func took %.8f seconds" % (time.time() - start) # Takes, AT MOST 2 ms on my PC - most of the time we are talking nanoseconds
if boolVar == False:
print("selected edge was closed")
else:
print("selected edge was open")
# On the edges at the center of a shell, this will say that the edge was closed - and for edges that are belonging to two different shells it will say that the edge is open.
So yea, the only thing I’m really interested in here is to see how many UV’s a particular edge is selected to. It is what is gonna take time for the particular thing I’m interested in. I did a sloppy measurement on this and it turns out that doing this conversion with polyListComponentConversion is actually rather fast. Not super-fast ofc - above check takes at most 2 milliseconds on my computer (so for it to feel slow you would basically need a selection of 100+ edges - give or take). I realized that this is probably acceptable in my case, as I’m really not chasing nanoseconds.
I think I’ll go with this unless ofc there is some genious approach out there
Thanks for your input anyways - it lead me into this thinking, and ultimately: this solution.