mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Only set material for imported quality profile if there is an active material
CURA-3881 CuraContainerRegistry._activeMaterialId() can return an empty string if there is no active material, and in this case, importing a custom quality file will fail.
This commit is contained in:
parent
8ede981a2c
commit
585bc78892
1 changed files with 4 additions and 2 deletions
|
|
@ -281,8 +281,10 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||
if self._machineHasOwnQualities():
|
||||
profile.setDefinition(self._activeQualityDefinition())
|
||||
if self._machineHasOwnMaterials():
|
||||
profile.addMetaDataEntry("material", self._activeMaterialId())
|
||||
quality_type_criteria["material"] = self._activeMaterialId()
|
||||
active_material_id = self._activeMaterialId()
|
||||
if active_material_id: # only update if there is an active material
|
||||
profile.addMetaDataEntry("material", active_material_id)
|
||||
quality_type_criteria["material"] = active_material_id
|
||||
|
||||
quality_type_criteria["definition"] = profile.getDefinition().getId()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue