From 3d0731e66ccdb5555459b7a8a028e78a05fadbfa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Dec 2023 20:12:25 +1100 Subject: [PATCH] Fix #115827: Follow active quad fails with an assertion Replace check for Mesh.uv_layers with BMesh layer check and report other failures which weren't accounted for. --- scripts/startup/bl_operators/uvcalc_follow_active.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/startup/bl_operators/uvcalc_follow_active.py b/scripts/startup/bl_operators/uvcalc_follow_active.py index 6522ebe54d4..8c096b7712a 100644 --- a/scripts/startup/bl_operators/uvcalc_follow_active.py +++ b/scripts/startup/bl_operators/uvcalc_follow_active.py @@ -32,7 +32,7 @@ def extend(obj, EXTEND_MODE, use_uv_selection): return STATUS_ERR_NOT_SELECTED # Active face is not selected. if len(f_act.verts) != 4: return STATUS_ERR_NOT_QUAD # Active face is not a quad - if not me.uv_layers: + if not bm.loops.layers.uv: return STATUS_ERR_MISSING_UV_LAYER # Object's mesh doesn't have any UV layers. uv_act = bm.loops.layers.uv.active # Always use the active UV layer. @@ -240,6 +240,10 @@ def main(context, operator): operator.report({'ERROR'}, "Active face must be a quad") elif status & STATUS_ERR_NOT_SELECTED: operator.report({'ERROR'}, "Active face not selected") + elif status & STATUS_ERR_NO_FACES_SELECTED: + operator.report({'ERROR'}, "No selected faces") + elif status & STATUS_ERR_MISSING_UV_LAYER: + operator.report({'ERROR'}, "No UV layers") else: assert status & STATUS_ERR_ACTIVE_FACE != 0 operator.report({'ERROR'}, "No active face")