Browse Source

Get old diameter from old material instead of new candidate.

part of CURA-6821
Remco Burema 5 years ago
parent
commit
784396424c
1 changed files with 1 additions and 5 deletions
  1. 1 5
      cura/Settings/MachineManager.py

+ 1 - 5
cura/Settings/MachineManager.py

@@ -1357,11 +1357,7 @@ class MachineManager(QObject):
             # If we can keep the current material after the switch, try to do so.
             nozzle_node = ContainerTree.getInstance().machines[self._global_container_stack.definition.getId()].variants[current_nozzle_name]
             candidate_materials = nozzle_node.materials
-            old_approximate_material_diameter = None  # type: Optional[float]
-            if candidate_materials:
-                candidate_material = list(candidate_materials.values())[0]
-                default_material_diameter = "2.85"
-                old_approximate_material_diameter = int(round(float(candidate_material.container.getMetaDataEntry("properties/diameter", default_material_diameter))))
+            old_approximate_material_diameter = int(extruder.material.getMetaDataEntry("approximate_diameter", default = 3))
             new_approximate_material_diameter = int(self._global_container_stack.extruderList[int(position_item)].getApproximateMaterialDiameter())
 
             # Only switch to the old candidate material if the approximate material diameter of the extruder stays the