mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 04:15:12 +08:00
Merge branch '4.2' of github.com:Ultimaker/Cura
This commit is contained in:
commit
203ea2a83f
@ -190,13 +190,16 @@ class XmlMaterialProfile(InstanceContainer):
|
|||||||
## End Name Block
|
## End Name Block
|
||||||
|
|
||||||
for key, value in metadata.items():
|
for key, value in metadata.items():
|
||||||
builder.start(key) # type: ignore
|
key_to_use = key
|
||||||
|
if key in self._metadata_tags_that_have_cura_namespace:
|
||||||
|
key_to_use = "cura:" + key_to_use
|
||||||
|
builder.start(key_to_use) # type: ignore
|
||||||
if value is not None: #Nones get handled well by the builder.
|
if value is not None: #Nones get handled well by the builder.
|
||||||
#Otherwise the builder always expects a string.
|
#Otherwise the builder always expects a string.
|
||||||
#Deserialize expects the stringified version.
|
#Deserialize expects the stringified version.
|
||||||
value = str(value)
|
value = str(value)
|
||||||
builder.data(value)
|
builder.data(value)
|
||||||
builder.end(key)
|
builder.end(key_to_use)
|
||||||
|
|
||||||
builder.end("metadata")
|
builder.end("metadata")
|
||||||
## End Metadata Block
|
## End Metadata Block
|
||||||
@ -1183,6 +1186,8 @@ class XmlMaterialProfile(InstanceContainer):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "<XmlMaterialProfile '{my_id}' ('{name}') from base file '{base_file}'>".format(my_id = self.getId(), name = self.getName(), base_file = self.getMetaDataEntry("base_file"))
|
return "<XmlMaterialProfile '{my_id}' ('{name}') from base file '{base_file}'>".format(my_id = self.getId(), name = self.getName(), base_file = self.getMetaDataEntry("base_file"))
|
||||||
|
|
||||||
|
_metadata_tags_that_have_cura_namespace = ["pva_compatible", "breakaway_compatible"]
|
||||||
|
|
||||||
# Map XML file setting names to internal names
|
# Map XML file setting names to internal names
|
||||||
__material_settings_setting_map = {
|
__material_settings_setting_map = {
|
||||||
"print temperature": "default_material_print_temperature",
|
"print temperature": "default_material_print_temperature",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user