mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Don't add to variant-specific mapping if it's not variant-specific
Otherwise we'll encounter that the variant name is None when serialising that subprofile. Contributes to issue CURA-6600.
This commit is contained in:
parent
c333e980dc
commit
20be7fd8a1
1 changed files with 2 additions and 1 deletions
|
@ -245,6 +245,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
variant_name = container.getMetaDataEntry("variant_name")
|
variant_name = container.getMetaDataEntry("variant_name")
|
||||||
if not variant_name:
|
if not variant_name:
|
||||||
machine_container_map[definition_id] = container
|
machine_container_map[definition_id] = container
|
||||||
|
continue
|
||||||
|
|
||||||
variant_dict = {"variant_type": container.getMetaDataEntry("hardware_type", str(VariantType.NOZZLE)),
|
variant_dict = {"variant_type": container.getMetaDataEntry("hardware_type", str(VariantType.NOZZLE)),
|
||||||
"material_container": container}
|
"material_container": container}
|
||||||
|
@ -344,7 +345,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
stream = io.BytesIO()
|
stream = io.BytesIO()
|
||||||
tree = ET.ElementTree(root)
|
tree = ET.ElementTree(root)
|
||||||
# this makes sure that the XML header states encoding="utf-8"
|
# this makes sure that the XML header states encoding="utf-8"
|
||||||
tree.write(stream, encoding = "utf-8", xml_declaration=True)
|
tree.write(stream, encoding = "utf-8", xml_declaration = True)
|
||||||
|
|
||||||
return stream.getvalue().decode("utf-8")
|
return stream.getvalue().decode("utf-8")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue