From 54e19659986842afdfcb9ecf79f2c7cf8670cb5f Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 28 Feb 2026 10:10:57 -0500 Subject: [PATCH] change edit context appropriately --- __init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/__init__.py b/__init__.py index ea24b53..629d95d 100644 --- a/__init__.py +++ b/__init__.py @@ -214,6 +214,18 @@ class ARMATURE_OT_build_envelope_mesh(bpy.types.Operator): result_obj = bpy.data.objects.new(arm_obj.name + "_envelope", mesh) context.collection.objects.link(result_obj) + # Make the new mesh active/selected while we are in OBJECT mode. + bpy.ops.object.select_all(action='DESELECT') + result_obj.select_set(True) + context.view_layer.objects.active = result_obj + + # If we started in EDIT mode, restore it on the armature now. + if original_mode == 'EDIT': + result_obj.select_set(False) + arm_obj.select_set(True) + context.view_layer.objects.active = arm_obj + bpy.ops.object.mode_set(mode='EDIT') + source_label = { 'OBJECT': "rest pose", 'POSE': "current pose",