Can't set edge.use_seam unless.. what, exactly?

I’m writing an addon that helps marking/clearing the seams on multiple objects at a time. The strange thing is that the code below works if I manually set some seams on the object(s) first, but not if the object has never had any seam on it. You can easily verify this by running it on on a newly created cube (won’t work) versus a cube where you already markes/cleared some seams on (will work).

def getAllEdges(meshObject):
    edgeList =[]
    
    for edge in meshObject.data.edges: 
        edgeList.append(edge)
    
    return edgeList

# ?? only works after manually setting a/some seam(s) first ??
def setSeams(edgeList, val):
    for edge in edgeList:
        edge.use_seam = val    

Am I missing something?

Well what the heck, here’s the addon – as it is ATM: yauva-beta-20160619.zip (15.7 KB)

I’m not quite ready to release this yet, but since the above problem is hopefully the last thing standing in my way of doing so, you all can have a little sneak preview – so lucky you! :slight_smile: The code above can be found in Edge.py, and it’s called from OperatorSeams.py.

This addon is about texturing multiple selected (usually generated and/or similar) objects. So we’ll be marking/clearing seams, unwrapping, and manipulating (normalizing, randomizing) their UV coordinates/maps. But let’s focus on setting the seams for now, though.

Please note that he addon will only appear (Misc tab on the tool shelf) if you have 1 or more meshes selected in your scene. I suggest you start with an empty scene, add a cube to it, and set the addon properties as follows:

/uploads/default/original/4X/7/b/8/7b8285231a5465ed535e9975b327cf9a0f4c556d.pngstc=1

Pressing the Action! button should mark all edges as seams, but when you go into edit mode, you’ll see no seams. If you select 1 edge and manually mark it as a seam, you’ll observe that all edges have now been marked as seams. You wouldn’t have observed that when you did not press the Action! button before. So… ?

Also, from now on (having manually marked a seam), the addon should work as expected. You can try marking/clearing, or even be a bit more precise about what edges you want to be affected.

So what gives? It seems like something is not being updated properly. Maybe this update could be requested/forced somehow?

TIA for any tips!

Attachments