mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-05 14:54:33 +08:00
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.
This commit is contained in:
parent
af484b03d8
commit
4aa495f9ef
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user