From d9b428e6c8cd849cff5824b30b999daf1da6b4a3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 12 Oct 2016 11:42:07 +0200 Subject: [PATCH] Get material IDs from correct definition id if quality_definition For printers with a quality_definition, such as UM2E+, the material ID needs to be taken for the definition ID specified in the quality_definition metadata field. The self.activeQualityDefinitionId takes care of that, even though it is named wrong (as it applies to materials as well as quality profiles). Contributes to issue CURA-2600. --- cura/Settings/MachineManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 46c1ec09b7..33d7119378 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -134,7 +134,7 @@ class MachineManager(QObject): definition_id = "fdmprinter" if self._global_container_stack.getMetaDataEntry("has_machine_materials", False): - definition_id = self._global_container_stack.getBottom().getId() + definition_id = self.activeQualityDefinitionId extruder_manager = ExtruderManager.getInstance() containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "material", definition = definition_id, GUID = material_id) if containers: # New material ID is known @@ -145,7 +145,7 @@ class MachineManager(QObject): matching_extruder = extruder break - if matching_extruder and matching_extruder.findContainer({"type":"material"}).getMetaDataEntry("GUID") != material_id: + if matching_extruder and matching_extruder.findContainer({"type": "material"}).getMetaDataEntry("GUID") != material_id: # Save the material that needs to be changed. Multiple changes will be handled by the callback. self._auto_materials_changed[str(index)] = containers[0].getId() self._printer_output_devices[0].materialHotendChangedMessage(self._materialHotendChangedCallback)