mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Only get from extruder if global_inherits_stack is valid
Sometimes it is set to give -1 for some settings. Contributes to issue CURA-2040.
This commit is contained in:
parent
78aaf4caf0
commit
df1b6b8e88
@ -62,8 +62,9 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
|
||||
if definition.global_inherits_stack:
|
||||
#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.
|
||||
extruder_stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
|
||||
new_instance.value = extruder_stack.getProperty(item, "value")
|
||||
if int(stack_nr) >= 0: #Only if it defines an extruder stack.
|
||||
extruder_stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
|
||||
new_instance.value = extruder_stack.getProperty(item, "value")
|
||||
settings.addInstance(new_instance)
|
||||
visibility_changed = True
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user