From 6093e906b54e7cced0a9822a86be77ca7226fff0 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 20 Jan 2025 15:40:59 -0500 Subject: [PATCH] Chain fix --- scripts/addons/cam/operators/path_ops.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/addons/cam/operators/path_ops.py b/scripts/addons/cam/operators/path_ops.py index bbb410e3..a2a4ca21 100644 --- a/scripts/addons/cam/operators/path_ops.py +++ b/scripts/addons/cam/operators/path_ops.py @@ -386,7 +386,15 @@ class PathsChain(Operator, AsyncOperatorMixin): """ s = context.scene - bpy.ops.object.mode_set(mode="OBJECT") # force object mode + + # Ensure there is an active object, and force Object Mode + if not context.mode == "OBJECT": + operations = context.scene.cam_operations + active_operation = operations[context.scene.cam_active_operation] + context_object = context.scene.objects[active_operation.object_name] + context.view_layer.objects.active = context_object + bpy.ops.object.mode_set(mode="OBJECT") + chain = s.cam_chains[s.cam_active_chain] chainops = get_chain_operations(chain) meshes = []