Create extruder stack for single extrusion machines when adding new machine - CURA-4482

This commit is contained in:
ChrisTerBeke 2017-10-31 09:49:24 +01:00
parent 9806ec7374
commit f36c9ffbc0
4 changed files with 37 additions and 21 deletions

View file

@ -193,6 +193,7 @@ class ExtruderManager(QObject):
if global_container_stack.getId() in self._extruder_trains:
if str(self._active_extruder_index) in self._extruder_trains[global_container_stack.getId()]:
return self._extruder_trains[global_container_stack.getId()][str(self._active_extruder_index)]
return None
## Get an extruder stack by index
@ -435,6 +436,10 @@ class ExtruderManager(QObject):
scene_root = Application.getInstance().getController().getScene().getRoot()
# If no extruders are registered in the extruder manager yet, return an empty array
if len(self.extruderIds) == 0:
return []
# Get the extruders of all printable meshes in the scene
meshes = [node for node in DepthFirstIterator(scene_root) if type(node) is SceneNode and node.isSelectable()]
for mesh in meshes: