From 795cf86f94147e3d11ac984984f167fae5d05f35 Mon Sep 17 00:00:00 2001 From: "Morgan 'ARR\\!' Allen" Date: Sun, 2 Apr 2023 13:05:35 -0700 Subject: [PATCH] set enumeration default properties after .initOperation This allows subclasses to override opPropertyEnumerations and have their defaults set by ObjectOp.__init__ --- src/Mod/Path/Path/Op/Base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mod/Path/Path/Op/Base.py b/src/Mod/Path/Path/Op/Base.py index fce232ab41..fb8a3078da 100644 --- a/src/Mod/Path/Path/Op/Base.py +++ b/src/Mod/Path/Path/Op/Base.py @@ -332,12 +332,6 @@ class ObjectOp(object): ), ) - for n in self.opPropertyEnumerations(): - Path.Log.debug("n: {}".format(n)) - Path.Log.debug("n[0]: {} n[1]: {}".format(n[0], n[1])) - if hasattr(obj, n[0]): - setattr(obj, n[0], n[1]) - # members being set later self.commandlist = None self.horizFeed = None @@ -353,6 +347,12 @@ class ObjectOp(object): self.initOperation(obj) + for n in self.opPropertyEnumerations(): + Path.Log.debug("n: {}".format(n)) + Path.Log.debug("n[0]: {} n[1]: {}".format(n[0], n[1])) + if hasattr(obj, n[0]): + setattr(obj, n[0], n[1]) + if not hasattr(obj, "DoNotSetDefaultValues") or not obj.DoNotSetDefaultValues: if parentJob: self.job = PathUtils.addToJob(obj, jobname=parentJob.Name)