Skip to content

Commit

Permalink
Select Zero: clarify some concepts
Browse files Browse the repository at this point in the history
Clarify some concepts in description and reports and simplify code (slightly). Even when the UV face is entirely selected, the degeneration always refers to triangles inside it, so a non-zero area UV face will be detected as degenerate if it contains 3 aligned loops, which is commonly useful.
franMarz committed Mar 13, 2024
1 parent 80d7408 commit c09bd2f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions op_select_zero.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
class op(bpy.types.Operator):
bl_idname = "uv.textools_select_zero"
bl_label = "Select Degenerate"
bl_description = "Select Degenerate UVs (zero area UV faces)"
bl_description = "Select degenerate UVs (zero area UV triangles)"
bl_options = {'REGISTER', 'UNDO'}

precision: bpy.props.FloatProperty(name='Precision', default=0.0001, min=0, step=0.00001, precision=8)
@@ -54,7 +54,7 @@ def select_zero(self):
counter += 1

if not counter:
self.report({'INFO'}, f'Zero faces not found')
self.report({'INFO'}, f'Degenerate triangles not found')
return {'CANCELLED'}

# Workaround to flush the selected UVs from loops to faces
@@ -66,8 +66,7 @@ def select_zero(self):
premode = 'FACE'
bpy.ops.uv.select_mode(type=premode)

tris_or_faces = 'faces' if sync else 'tris'
self.report({'WARNING'}, f'Detected {counter} zero {tris_or_faces}')
self.report({'WARNING'}, f'Detected {counter} degenerate triangles')
return {'FINISHED'}


0 comments on commit c09bd2f

Please sign in to comment.