Get old diameter from old material instead of new candidate.

part of CURA-6821
This commit is contained in:
Remco Burema 2019-10-02 15:46:01 +02:00
parent 649ca99fe0
commit 784396424c

View file

@ -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