Browse Source

Fix camera not found on pre-slice snapshot/thumbnail.

Remco Burema 4 years ago
parent
commit
e681a6d32d
2 changed files with 5 additions and 2 deletions
  1. 2 2
      cura/Snapshot.py
  2. 3 0
      plugins/UM3NetworkPrinting/src/ExportFileJob.py

+ 2 - 2
cura/Snapshot.py

@@ -42,8 +42,8 @@ class Snapshot:
         """
 
         scene = Application.getInstance().getController().getScene()
-        active_camera = scene.getActiveCamera()
-        render_width, render_height = active_camera.getWindowSize()
+        active_camera = scene.getActiveCamera() or scene.findCamera("3d")
+        render_width, render_height = (width, height) if active_camera is None else active_camera.getWindowSize()
         render_width = int(render_width)
         render_height = int(render_height)
         preview_pass = PreviewPass(render_width, render_height)

+ 3 - 0
plugins/UM3NetworkPrinting/src/ExportFileJob.py

@@ -1,3 +1,6 @@
+# Copyright (c) 2021 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+
 from typing import List, Optional
 
 from UM.FileHandler.FileHandler import FileHandler