mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 17:27:51 -06:00
Saving an empty buildplate as a workspace is now possible
CURA-1263
This commit is contained in:
parent
1db2d06e06
commit
8640b2b787
1 changed files with 1 additions and 5 deletions
|
@ -57,10 +57,6 @@ class ThreeMFWriter(MeshWriter):
|
||||||
return self._archive
|
return self._archive
|
||||||
|
|
||||||
def write(self, stream, nodes, mode = MeshWriter.OutputMode.BinaryMode):
|
def write(self, stream, nodes, mode = MeshWriter.OutputMode.BinaryMode):
|
||||||
try:
|
|
||||||
MeshWriter._meshNodes(nodes).__next__()
|
|
||||||
except StopIteration:
|
|
||||||
return False #Don't write anything if there is no mesh data.
|
|
||||||
self._archive = None # Reset archive
|
self._archive = None # Reset archive
|
||||||
archive = zipfile.ZipFile(stream, "w", compression = zipfile.ZIP_DEFLATED)
|
archive = zipfile.ZipFile(stream, "w", compression = zipfile.ZIP_DEFLATED)
|
||||||
try:
|
try:
|
||||||
|
@ -86,7 +82,7 @@ class ThreeMFWriter(MeshWriter):
|
||||||
build = ET.SubElement(model, "build")
|
build = ET.SubElement(model, "build")
|
||||||
|
|
||||||
added_nodes = []
|
added_nodes = []
|
||||||
|
index = 0 # Ensure index always exists (even if there are no nodes to write)
|
||||||
# Write all nodes with meshData to the file as objects inside the resource tag
|
# Write all nodes with meshData to the file as objects inside the resource tag
|
||||||
for index, n in enumerate(MeshWriter._meshNodes(nodes)):
|
for index, n in enumerate(MeshWriter._meshNodes(nodes)):
|
||||||
added_nodes.append(n) # Save the nodes that have mesh data
|
added_nodes.append(n) # Save the nodes that have mesh data
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue