From 4aa495f9efa8dba6120c129f193186502c6d802b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 8 Jun 2016 10:56:51 +0200 Subject: [PATCH] Fix getting name and colour from extruder There used to be an extruder object from which we could ask these properties. But now we have a container stack in its place, so we need to get the properties in a slightly different way. Contributes to issues CURA-1278 and CURA-340. --- cura/ExtrudersModel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/ExtrudersModel.py b/cura/ExtrudersModel.py index 691a5c7690..cd85181787 100644 --- a/cura/ExtrudersModel.py +++ b/cura/ExtrudersModel.py @@ -53,8 +53,8 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): return #There is no machine to get the extruders of. for index, extruder in manager.getMachineExtruders(global_container_stack.getBottom()): item = { #Construct an item with only the relevant information. - "name": extruder.name, - "colour": extruder.material.getMetaDataEntry("color_code", default = "#FFFF00"), + "name": extruder.getName(), + "colour": extruder.findContainer(type = "material").getMetaDataEntry("color_code", default = "#FFFF00"), "index": index } self.appendItem(item)