mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Do not add and register Extruders if they are already there
CURA-3756
This commit is contained in:
parent
739fd2bbcb
commit
b2f0623ecf
2 changed files with 11 additions and 0 deletions
|
@ -52,12 +52,16 @@ class GlobalStack(CuraContainerStack):
|
|||
extruder_count = self.getProperty("machine_extruder_count", "value")
|
||||
if extruder_count and len(self._extruders) + 1 > extruder_count:
|
||||
Logger.log("w", "Adding extruder {meta} to {id} but its extruder count is {count}".format(id = self.id, count = extruder_count, meta = str(extruder.getMetaData())))
|
||||
return
|
||||
|
||||
position = extruder.getMetaDataEntry("position")
|
||||
if position is None:
|
||||
Logger.log("w", "No position defined for extruder {extruder}, cannot add it to stack {stack}", extruder = extruder.id, stack = self.id)
|
||||
return
|
||||
|
||||
if any(item.getId() == extruder.id for item in self._extruders.values()):
|
||||
Logger.log("w", "Extruder [%s] has already been added to this stack [%s]", extruder.id, self._id)
|
||||
return
|
||||
self._extruders[position] = extruder
|
||||
|
||||
## Overridden from ContainerStack
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue