mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 11:59:02 +08:00
Defensive programming for isometric snapshot.
This commit is contained in:
parent
692b27ce3c
commit
d2db9a2555
@ -113,9 +113,6 @@ class MakerbotWriter(MeshWriter):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
snapshot = Snapshot.isometricSnapshot(width, height)
|
snapshot = Snapshot.isometricSnapshot(width, height)
|
||||||
except:
|
|
||||||
Logger.logException("w", "Failed to create snapshot image")
|
|
||||||
return
|
|
||||||
|
|
||||||
thumbnail_buffer = QBuffer()
|
thumbnail_buffer = QBuffer()
|
||||||
thumbnail_buffer.open(QBuffer.OpenModeFlag.WriteOnly)
|
thumbnail_buffer.open(QBuffer.OpenModeFlag.WriteOnly)
|
||||||
@ -124,6 +121,11 @@ class MakerbotWriter(MeshWriter):
|
|||||||
|
|
||||||
return thumbnail_buffer
|
return thumbnail_buffer
|
||||||
|
|
||||||
|
except:
|
||||||
|
Logger.logException("w", "Failed to create snapshot image")
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode=MeshWriter.OutputMode.BinaryMode) -> bool:
|
def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode=MeshWriter.OutputMode.BinaryMode) -> bool:
|
||||||
if mode != MeshWriter.OutputMode.BinaryMode:
|
if mode != MeshWriter.OutputMode.BinaryMode:
|
||||||
Logger.log("e", "MakerbotWriter does not support text mode.")
|
Logger.log("e", "MakerbotWriter does not support text mode.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user