From 614c2970ea6a313ed45949d613d7f49fad1a4cc0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 17 Sep 2019 15:50:38 +0200 Subject: [PATCH] Use getApproximateMaterialDiameter instead of rounded getCompatibleMaterialDiameter So we don't need to round it again. Also convert both to float to be robust against the ambiguous serialisation of floats getting in the way (e.g. '3' vs. '3.0'). Python does that sometimes. Contributes to issue CURA-6600. --- cura/Machines/MaterialManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index 264f7bbd8b..fc04af3cd2 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -131,8 +131,8 @@ class MaterialManager(QObject): # Fetch the available materials (ContainerNode) for the current active machine and extruder setup. materials = self.getAvailableMaterials(machine.definition.getId(), nozzle_name) - compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter())) - result = {key: material for key, material in materials.items() if material.container and material.container.getMetaDataEntry("approximate_diameter") == compatible_material_diameter} + compatible_material_diameter = extruder_stack.getApproximateMaterialDiameter() + result = {key: material for key, material in materials.items() if material.container and float(material.container.getMetaDataEntry("approximate_diameter")) == compatible_material_diameter} return result #