Only create new extruder stack for single extrusion machine if it does not exist yet - CURA-4482

This commit is contained in:
ChrisTerBeke 2017-10-31 14:37:58 +01:00
parent e7f1900f71
commit f20ba4a118

View File

@ -406,13 +406,16 @@ class CuraContainerRegistry(ContainerRegistry):
def _addExtruderStackForSingleExtrusionMachine(self, machine, extruder_id):
new_extruder_id = extruder_id
extruder_stack = None
# if extruders are defined in the machine definition use those instead
if machine.extruders and len(machine.extruders) > 0:
new_extruder_id = machine.extruders["0"].getId()
extruder_stack = machine.extruders["0"]
# if the extruder stack doesn't exist yet we create and add it
if not extruder_stack:
extruder_definitions = self.findDefinitionContainers(id = new_extruder_id)
if not extruder_definitions:
Logger.log("w", "Could not find definition containers for extruder %s", new_extruder_id)
return