mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-10-10 15:27:53 -06:00
Make profiles only load if the extruder says it has them
For instance, only load materials if has_materials is True. Contributes to issues CURA-351 and CURA-1278.
This commit is contained in:
parent
72bc68f38a
commit
7993775feb
1 changed files with 33 additions and 27 deletions
|
@ -29,6 +29,7 @@ class Extruder:
|
|||
|
||||
#Find the nozzle to use for this extruder.
|
||||
self._nozzle = container_registry.getEmptyInstanceContainer()
|
||||
if self._definition.getMetaDataEntry("has_nozzles", default = "False") == "True":
|
||||
if len(self._nozzles) >= 1: #First add any extruder. Later, overwrite with preference if the preference is valid.
|
||||
self._nozzle = self._nozzles[0]
|
||||
preferred_nozzle_id = self._definition.getMetaDataEntry("preferred_nozzle")
|
||||
|
@ -41,6 +42,10 @@ class Extruder:
|
|||
|
||||
#Find a material to use for this nozzle.
|
||||
self._material = container_registry.getEmptyInstanceContainer()
|
||||
if self._definition.getMetaDataEntry("has_materials", default = "False") == "True":
|
||||
if self._definition.getMetaDataEntry("has_nozzle_materials", default = "False") == "True":
|
||||
all_materials = container_registry.findInstanceContainers(type = "material", nozzle = self._nozzle.getId())
|
||||
else:
|
||||
all_materials = container_registry.findInstanceContainers(type = "material")
|
||||
if len(all_materials) >= 1:
|
||||
self._material = all_materials[0]
|
||||
|
@ -53,6 +58,7 @@ class Extruder:
|
|||
|
||||
#Find a quality to use for this extruder.
|
||||
self._quality = container_registry.getEmptyInstanceContainer()
|
||||
if self._definition.getMetaDataEntry("has_machine_quality"):
|
||||
all_qualities = container_registry.findInstanceContainers(type = "quality")
|
||||
if len(all_qualities) >= 1:
|
||||
self._quality = all_qualities[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue