From a320784a6d96d8526e40890c019d3b39fea13cc1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 25 Aug 2017 12:19:05 +0200 Subject: [PATCH] For a per-object setting, use the user-defined value first CURA-4186 In a per-object setting, if there is user defined value, use that first. If the value is default, then evaluate it with the normal routine. --- cura/Settings/PerObjectContainerStack.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cura/Settings/PerObjectContainerStack.py b/cura/Settings/PerObjectContainerStack.py index 654e18c33e..fdb314f695 100644 --- a/cura/Settings/PerObjectContainerStack.py +++ b/cura/Settings/PerObjectContainerStack.py @@ -3,6 +3,7 @@ from typing import Any, Optional from UM.Decorators import override from UM.Settings.Interfaces import PropertyEvaluationContext from UM.Settings.ContainerStack import ContainerStack +from UM.Settings.SettingInstance import InstanceState class PerObjectContainerStack(ContainerStack): @@ -17,6 +18,13 @@ class PerObjectContainerStack(ContainerStack): from cura.CuraApplication import CuraApplication global_stack = CuraApplication.getInstance().getGlobalContainerStack() + # Return the user defined value if present, otherwise, evaluate the value according to the default routine. + if self.getContainer(0).hasProperty(key, property_name): + if self.getContainer(0)._instances[key].state == InstanceState.User: + result = super().getProperty(key, property_name, context) + context.popContainer() + return result + # Handle the "limit_to_extruder" property. limit_to_extruder = super().getProperty(key, "limit_to_extruder", context) if limit_to_extruder is not None: