mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Handle rounding errors in stack_nr
Wouldn't want it to index extruder '1.0'. Contributes to issue CURA-2067.
This commit is contained in:
parent
92b154f5fe
commit
51d972941e
1 changed files with 1 additions and 1 deletions
|
@ -61,7 +61,7 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
|
||||||
new_instance = SettingInstance(definition, settings)
|
new_instance = SettingInstance(definition, settings)
|
||||||
if definition.global_inherits_stack and self._stack.getProperty("machine_extruder_count", "value") > 1:
|
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.
|
#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.
|
stack_nr = str(int(round(float(self._stack.getProperty(item, "global_inherits_stack"))))) #Stack to get the setting from. Round it and remove the fractional part.
|
||||||
if stack_nr in ExtruderManager.getInstance().extruderIds: #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]
|
extruder_stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
|
||||||
new_instance.setProperty("value", extruder_stack.getProperty(item, "value"))
|
new_instance.setProperty("value", extruder_stack.getProperty(item, "value"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue