mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
More defensive check for global_inherits_stack extruder
This should never give the keyerror any more and always default back to non-global_inherits_stack mode. Contributes to issue CURA-2067.
This commit is contained in:
parent
a46f6cc14d
commit
92b154f5fe
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
|
|||
if definition.global_inherits_stack and self._stack.getProperty("machine_extruder_count", "value") > 1:
|
||||
#Obtain the value from the correct container stack. Only once, upon adding the setting.
|
||||
stack_nr = self._stack.getProperty(item, "global_inherits_stack") #Stack to get the setting from.
|
||||
if float(stack_nr) >= 0: #Only if it defines an extruder stack.
|
||||
if stack_nr in ExtruderManager.getInstance().extruderIds: #Only if it defines an extruder stack.
|
||||
extruder_stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
|
||||
new_instance.setProperty("value", extruder_stack.getProperty(item, "value"))
|
||||
settings.addInstance(new_instance)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue