mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 08:47:50 -06:00
CURA-4606 CURA-5003 fix saving material metadata when switching material; fix crashing on fallback material on materials without fallback
This commit is contained in:
parent
b29d091b1d
commit
c7499d6e17
2 changed files with 3 additions and 1 deletions
|
@ -314,7 +314,8 @@ class MaterialManager(QObject):
|
|||
def getFallbackMaterialId(self, material_type: str) -> str:
|
||||
# For safety
|
||||
if material_type not in self._fallback_materials_map:
|
||||
raise RuntimeError("Material type [%s] is not in the fallback materials table." % material_type)
|
||||
Logger.log("w", "The material type [%s] does not have a fallback material" % material_type)
|
||||
return None
|
||||
fallback_material = self._fallback_materials_map[material_type]
|
||||
if fallback_material:
|
||||
return self.getRootMaterialIDWithoutDiameter(fallback_material["id"])
|
||||
|
|
|
@ -350,6 +350,7 @@ Item
|
|||
|
||||
onCurrentIndexChanged:
|
||||
{
|
||||
forceActiveFocus(); // causes the changed fields to be saved
|
||||
var model = materialsModel.getItem(currentIndex);
|
||||
materialDetailsView.containerId = model.container_id;
|
||||
materialDetailsView.currentMaterialNode = model.container_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue