Fix selecting settings for Per Model Settings with single extrusion printers

This commit is contained in:
fieldOfView 2017-05-10 17:37:35 +02:00
parent e187b96455
commit 93c5b382ba

View file

@ -63,7 +63,8 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
stack_nr = -1 stack_nr = -1
stack = None stack = None
# Check from what stack we should copy the raw property of the setting from. # Check from what stack we should copy the raw property of the setting from.
if definition.limit_to_extruder != "-1" and self._stack.getProperty("machine_extruder_count", "value") > 1: if self._stack.getProperty("machine_extruder_count", "value") > 1:
if definition.limit_to_extruder != "-1":
# A limit to extruder function was set and it's a multi extrusion machine. Check what stack we do need to use. # A limit to extruder function was set and it's a multi extrusion machine. Check what stack we do need to use.
stack_nr = str(int(round(float(self._stack.getProperty(item, "limit_to_extruder"))))) stack_nr = str(int(round(float(self._stack.getProperty(item, "limit_to_extruder")))))
@ -74,6 +75,8 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
# Use the found stack number to get the right stack to copy the value from. # Use the found stack number to get the right stack to copy the value from.
if stack_nr in ExtruderManager.getInstance().extruderIds: if stack_nr in ExtruderManager.getInstance().extruderIds:
stack = ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0] stack = ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
else:
stack = self._stack
# Use the raw property to set the value (so the inheritance doesn't break) # Use the raw property to set the value (so the inheritance doesn't break)
if stack is not None: if stack is not None: