diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-02-08 19:37:38 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-02-08 19:37:38 +0300 |
commit | b815d63096b5c10740a3d79b63df14dd89ec1111 (patch) | |
tree | 8658fe7fa70277c2ea48568fd2c83dc844072b68 /plugins | |
parent | c89a397e596f4550e78a83a700c6667a0ea6a275 (diff) |
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.
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/3MFReader/ThreeMFReader.py | 4 | ||||
-rw-r--r-- | plugins/3MFWriter/ThreeMFWriter.py | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 669bee8f40..37ca1e98aa 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -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. import os.path @@ -178,7 +178,7 @@ class ThreeMFReader(MeshReader): if key in known_setting_keys: setting_container.setProperty(key, "value", setting_value) 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.getAllChildren()) == 1: diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index 99659817a5..c85eca88bf 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -109,7 +109,11 @@ class ThreeMFWriter(MeshWriter): # Get values for all changed settings & save them. 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(): # only save the nodes on the active build plate |