is BMLoopUV.select_edge actually supposed to do anything? Because currently it does not. I was working on a script where I needed to know which edge the user had selected while in UV edit mode, and the docs for BMLoopUV.select_edge looked to be exactly what I needed, however it always returns false- whether there’s a selection or not. You can manually set it to true, and it gets stored propertly but the actual UVs never get selected… it’s bizarre and feels like a bug to me, but since I’ve never used it before I wanted to post it here to get confirmation that I’m either A) an idiot (please educate me!), or B) this is a bug and needs to be fixed.
Attaching an example scene with bare minimum repro conditions- just select a UV edge and run the “UVLoop Select Edge Bug?” operator that comes as an embedded script in the scene. It goes through every face’s uvloops and reports the value of select_edge- it is always false! nevermind… devtalk won’t let me upload a .blend file so I guess that’s not going to happen. Here’s the script anyway:
import bpy
import bmesh
def main(context):
bm = bmesh.from_edit_mesh(bpy.context.edit_object.data)
uv_layer = bm.loops.layers.uv.verify()
for face in bm.faces:
for loop in face.loops:
uvloop = loop[uv_layer]
# BUG(?): -------------------------------------------
# select_edge is always false, even if there is an edge selected!!
if uvloop.select_edge:
print("THIS WILL NEVER HAPPEN")
print(f"e{loop.edge.index}:\t{uvloop.select_edge}")
# ---------------------------------------------------
class SimpleOperator(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.simple_operator_bug_test"
bl_label = "UVLoop Select Edge Bug?"
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
main(context)
return {'FINISHED'}
def register():
bpy.utils.register_class(SimpleOperator)
def unregister():
bpy.utils.unregister_class(SimpleOperator)
if __name__ == "__main__":
register()