mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 21:27:50 -06:00
Initialise variant, material and quality to empty containers of the respective type
Before it would be impossible to switch to a valid option once a variant/material/quality had gone to an "empty" state. Now at least it is recoverable.
This commit is contained in:
parent
779f66967e
commit
b622c7ecc8
1 changed files with 3 additions and 3 deletions
|
@ -145,7 +145,7 @@ class ExtruderManager(QObject):
|
|||
container_stack.addContainer(extruder_definition)
|
||||
|
||||
#Find the variant to use for this extruder.
|
||||
variant = container_registry.getEmptyInstanceContainer()
|
||||
variant = container_registry.findInstanceContainers(id = "empty_variant")[0]
|
||||
if machine_definition.getMetaDataEntry("has_variants"):
|
||||
#First add any variant. Later, overwrite with preference if the preference is valid.
|
||||
variants = container_registry.findInstanceContainers(definition = machine_id, type = "variant")
|
||||
|
@ -162,7 +162,7 @@ class ExtruderManager(QObject):
|
|||
container_stack.addContainer(variant)
|
||||
|
||||
#Find a material to use for this variant.
|
||||
material = container_registry.getEmptyInstanceContainer()
|
||||
material = container_registry.findInstanceContainers(id = "empty_material")[0]
|
||||
if machine_definition.getMetaDataEntry("has_materials"):
|
||||
#First add any material. Later, overwrite with preference if the preference is valid.
|
||||
if machine_definition.getMetaDataEntry("has_variant_materials", default = "False") == "True":
|
||||
|
@ -191,7 +191,7 @@ class ExtruderManager(QObject):
|
|||
container_stack.addContainer(material)
|
||||
|
||||
#Find a quality to use for this extruder.
|
||||
quality = container_registry.getEmptyInstanceContainer()
|
||||
quality = container_registry.findInstanceContainers(id = "empty_quality")[0]
|
||||
|
||||
#First add any quality. Later, overwrite with preference if the preference is valid.
|
||||
qualities = container_registry.findInstanceContainers(type = "quality")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue