From 3ab283bfed657280f954d46393ed785ecfc34d75 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Nov 2016 11:29:47 +0100 Subject: [PATCH] Saving workspace now works when there are no meshes to save CURA-1263 --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index 1b00451e92..437b9188ae 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -20,7 +20,10 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): # Indicate that the 3mf mesh writer should not close the archive just yet (we still need to add stuff to it). mesh_writer.setStoreArchive(True) mesh_writer.write(stream, nodes, mode) + archive = mesh_writer.getArchive() + if archive is None: # This happens if there was no mesh data to write. + archive = zipfile.ZipFile(stream, "w", compression = zipfile.ZIP_DEFLATED) global_container_stack = Application.getInstance().getGlobalContainerStack()