From 4b25801f640ee49f49c63d4de6871504236ce6b7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Aug 2022 15:07:16 +1000 Subject: Fix T99496: Magic UV error in menu search --- magic_uv/op/copy_paste_uv_object.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'magic_uv/op/copy_paste_uv_object.py') diff --git a/magic_uv/op/copy_paste_uv_object.py b/magic_uv/op/copy_paste_uv_object.py index 39795b52..897891e4 100644 --- a/magic_uv/op/copy_paste_uv_object.py +++ b/magic_uv/op/copy_paste_uv_object.py @@ -30,15 +30,16 @@ def _is_valid_context(context): if not common.is_valid_space(context, ['VIEW_3D']): return False + # Only object mode is allowed to execute. + ob = context.object + if ob is not None and ob.mode != 'OBJECT': + return False + # Multiple objects editing mode is not supported in this feature. objs = common.get_uv_editable_objects(context) if len(objs) != 1: return False - # only object mode is allowed to execute - if context.object.mode != 'OBJECT': - return False - return True -- cgit v1.2.3