mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Read & write all generic metadata items from 3mf
CURA-7615
This commit is contained in:
parent
f9d0da7a12
commit
f338acd4f3
2 changed files with 8 additions and 0 deletions
|
@ -201,6 +201,10 @@ class ThreeMFReader(MeshReader):
|
||||||
parser = Savitar.ThreeMFParser()
|
parser = Savitar.ThreeMFParser()
|
||||||
scene_3mf = parser.parse(archive.open("3D/3dmodel.model").read())
|
scene_3mf = parser.parse(archive.open("3D/3dmodel.model").read())
|
||||||
self._unit = scene_3mf.getUnit()
|
self._unit = scene_3mf.getUnit()
|
||||||
|
|
||||||
|
for key, value in scene_3mf.getMetadata().items():
|
||||||
|
CuraApplication.getInstance().getController().getScene().setMetaDataEntry(key, value)
|
||||||
|
|
||||||
for node in scene_3mf.getSceneNodes():
|
for node in scene_3mf.getSceneNodes():
|
||||||
um_node = self._convertSavitarNodeToUMNode(node, file_name)
|
um_node = self._convertSavitarNodeToUMNode(node, file_name)
|
||||||
if um_node is None:
|
if um_node is None:
|
||||||
|
|
|
@ -148,6 +148,10 @@ class ThreeMFWriter(MeshWriter):
|
||||||
savitar_scene = Savitar.Scene()
|
savitar_scene = Savitar.Scene()
|
||||||
|
|
||||||
metadata_to_store = CuraApplication.getInstance().getController().getScene().getMetaData()
|
metadata_to_store = CuraApplication.getInstance().getController().getScene().getMetaData()
|
||||||
|
|
||||||
|
for key, value in metadata_to_store.items():
|
||||||
|
savitar_scene.setMetaDataEntry(key, value)
|
||||||
|
|
||||||
current_time_string = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
current_time_string = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
if "Application" not in metadata_to_store:
|
if "Application" not in metadata_to_store:
|
||||||
# This might sound a bit strange, but this field should store the original application that created
|
# This might sound a bit strange, but this field should store the original application that created
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue