mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 09:17:50 -06:00
Add cura: namespace before setting keys, and store the rest in um_node.metadata
This retains per-node metadata entries. Contributes to issue CURA-7615.
This commit is contained in:
parent
c89a397e59
commit
b815d63096
2 changed files with 7 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2021 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -178,7 +178,7 @@ class ThreeMFReader(MeshReader):
|
||||||
if key in known_setting_keys:
|
if key in known_setting_keys:
|
||||||
setting_container.setProperty(key, "value", setting_value)
|
setting_container.setProperty(key, "value", setting_value)
|
||||||
else:
|
else:
|
||||||
Logger.log("w", "Unable to set setting %s", key)
|
um_node.metadata[key] = settings[key]
|
||||||
|
|
||||||
if len(um_node.getChildren()) > 0 and um_node.getMeshData() is None:
|
if len(um_node.getChildren()) > 0 and um_node.getMeshData() is None:
|
||||||
if len(um_node.getAllChildren()) == 1:
|
if len(um_node.getAllChildren()) == 1:
|
||||||
|
|
|
@ -109,7 +109,11 @@ class ThreeMFWriter(MeshWriter):
|
||||||
|
|
||||||
# Get values for all changed settings & save them.
|
# Get values for all changed settings & save them.
|
||||||
for key in changed_setting_keys:
|
for key in changed_setting_keys:
|
||||||
savitar_node.setSetting(key, str(stack.getProperty(key, "value")))
|
savitar_node.setSetting("cura:" + key, str(stack.getProperty(key, "value")))
|
||||||
|
|
||||||
|
# Store the metadata.
|
||||||
|
for key, value in um_node.metadata.items():
|
||||||
|
savitar_node.setSetting(key, value)
|
||||||
|
|
||||||
for child_node in um_node.getChildren():
|
for child_node in um_node.getChildren():
|
||||||
# only save the nodes on the active build plate
|
# only save the nodes on the active build plate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue