Fix switching to printers without variant

Since the 'empty_variant' nozzle is now just in the tree, this check is no longer even necessary.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-23 15:38:58 +02:00
parent 4fb656ea7b
commit 1febfde3cc
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -117,9 +117,7 @@ class BaseMaterialsModel(ListModel):
# Update the available materials (ContainerNode) for the current active machine and extruder setup.
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
extruder_stack = global_stack.extruders[str(self._extruder_position)]
nozzle_name = None
if extruder_stack.variant.getId() != "empty_variant":
nozzle_name = extruder_stack.variant.getName()
nozzle_name = extruder_stack.variant.getName()
materials = ContainerTree.getInstance().machines[global_stack.definition.getId()].variants[nozzle_name].materials
compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter()))
self._available_materials = {key: material for key, material in materials.items() if material.container.getMetaDataEntry("approximate_diameter") == compatible_material_diameter}