selecting sharp edge regions

checking if there is a built in function that i’m missing that will select regions marked by sharp edges…similar to using bpy.ops.mesh.select_linked(limit=True) except for sharp edges instead of seams. For those of you who are unfamiliar with select_linked(limit=True), if i select a face, this code will select all other faces within this uv island.

thanks.

don’t think so, but maybe you could make all sharp into seams…


import bpy
bpy.ops.object.mode_set()
for e in bpy.context.object.data.edges: 
    if e.use_edge_sharp: e.use_seam = True

yeah i was trying to avoid that…thanks though.

alternatively, be in object mode to run this script on an object that has creased edges


import bpy

obj = bpy.context.active_object
for i in obj.data.edges: 
    if i.crease > 0.0:
        i.select = True    

you can add an initial call to bpy.ops.object.mode_set(mode=‘OBJECT’) and finally at the end bpy.ops.object.mode_set(mode=‘EDIT’) , that way it wouldn’t matter what mode you are in when running the script. it will enter objectmode, select edges with crease over 0.0 and once done go back into edit mode. But -ofcourse- you may not want that… this is the way i use it


import bpy

obj = bpy.context.active_object
bpy.ops.object.mode_set(mode='OBJECT')

for i in obj.data.edges: 
    if i.crease > 0.0:
        i.select = True    

bpy.ops.object.mode_set(mode='EDIT')

not sure if that helps you, because it doesn’t select regions only edges… show some screenshots about what type of regions you might encounter, i can imagine boatloads of reasons why selection regions might be too ambiguous for a script to deal with without additional input.

for the screenshot it doesn’t have to be a model, infact a moderately subdivided cube with creases would help a lot.