mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
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.
This commit is contained in:
parent
414901ae84
commit
a320784a6d
1 changed files with 8 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue