mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Simplify code
CURA-6817
This commit is contained in:
parent
a1d90c17da
commit
89c35cd03c
1 changed files with 1 additions and 4 deletions
|
@ -1454,10 +1454,7 @@ class MachineManager(QObject):
|
||||||
material_container_node = variant_node.preferredMaterial(approximate_diameter)
|
material_container_node = variant_node.preferredMaterial(approximate_diameter)
|
||||||
if materials_with_guid: # We also have the material profile that the printer wants to share.
|
if materials_with_guid: # We also have the material profile that the printer wants to share.
|
||||||
base_file = materials_with_guid[0]["base_file"]
|
base_file = materials_with_guid[0]["base_file"]
|
||||||
keep_ref = material_container_node # WORKAROUND: Somehow 'default = ...' doesn't work for the following get, so it's now done in this cumbersome way.
|
material_container_node = variant_node.materials.get(base_file, material_container_node)
|
||||||
material_container_node = variant_node.materials.get(base_file)
|
|
||||||
if not material_container_node: # If Cura thinks that the selected material is not available for this printer, revert to the preferred material.
|
|
||||||
material_container_node = keep_ref
|
|
||||||
|
|
||||||
self._setMaterial(position, material_container_node)
|
self._setMaterial(position, material_container_node)
|
||||||
self._global_container_stack.extruders[position].setEnabled(True)
|
self._global_container_stack.extruders[position].setEnabled(True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue