From 07a564f23b74cf1fc4babc6cb94c42b68dde3ca5 Mon Sep 17 00:00:00 2001 From: Billy Huddleston Date: Wed, 3 Dec 2025 00:15:44 -0500 Subject: [PATCH] CAM: Fix job assignment and model/stock initialization in ObjectOp This PR fixes a bug introduced with PR #25800 It updates the ObjectOp class to correctly assign the job, model, and stock properties from the parentJob object. Previously, only PathUtils.addToJob was called, which did not set these attributes directly. This change ensures that when creating a new operation, the job, model, and stock fields are properly initialized from the parent job. This fixes issues where operations did not inherit the correct job context, leading to missing or incorrect references to the model and stock, and potential errors in downstream processing. --- src/Mod/CAM/Path/Op/Base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Op/Base.py b/src/Mod/CAM/Path/Op/Base.py index 1a9cea247b..742dd6553b 100644 --- a/src/Mod/CAM/Path/Op/Base.py +++ b/src/Mod/CAM/Path/Op/Base.py @@ -336,7 +336,10 @@ class ObjectOp(object): if not hasattr(obj, "DoNotSetDefaultValues") or not obj.DoNotSetDefaultValues: if parentJob: - self.job = PathUtils.addToJob(obj, jobname=parentJob.Name) + self.job = parentJob + self.model = parentJob.Model.Group if parentJob.Model else [] + self.stock = parentJob.Stock if hasattr(parentJob, "Stock") else None + PathUtils.addToJob(obj, jobname=parentJob.Name) job = self.setDefaultValues(obj) if job: job.SetupSheet.Proxy.setOperationProperties(obj, name)