diff --git a/cura/PickingPass.py b/cura/PickingPass.py index bfe465ff39..75ee21ef41 100644 --- a/cura/PickingPass.py +++ b/cura/PickingPass.py @@ -69,6 +69,7 @@ class PickingPass(RenderPass): ## Get the world coordinates of a picked point def getPickedPosition(self, x: int, y: int) -> Vector: distance = self.getPickedDepth(x, y) - ray = self._scene.getActiveCamera().getRay(x, y) - - return ray.getPointAlongRay(distance) + camera = self._scene.getActiveCamera() + if camera: + return camera.getRay(x, y).getPointAlongRay(distance) + return Vector() diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index 676157181b..b7862251c9 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -191,6 +191,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): def put(self, target: str, data: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None: if self._manager is None: self._createNetworkManager() + assert (self._manager is not None) request = self._createEmptyRequest(target) self._last_request_time = time() reply = self._manager.put(request, data.encode()) @@ -199,6 +200,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): def get(self, target: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None: if self._manager is None: self._createNetworkManager() + assert (self._manager is not None) request = self._createEmptyRequest(target) self._last_request_time = time() reply = self._manager.get(request) @@ -207,6 +209,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): def post(self, target: str, data: str, on_finished: Optional[Callable[[QNetworkReply], None]], on_progress: Callable = None) -> None: if self._manager is None: self._createNetworkManager() + assert (self._manager is not None) request = self._createEmptyRequest(target) self._last_request_time = time() reply = self._manager.post(request, data) @@ -218,6 +221,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): if self._manager is None: self._createNetworkManager() + assert (self._manager is not None) request = self._createEmptyRequest(target, content_type=None) multi_post_part = QHttpMultiPart(QHttpMultiPart.FormDataType) for part in parts: diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index 12f5b6b0a3..657329aad4 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -208,7 +208,6 @@ class ContainerManager(QObject): if not file_url: return {"status": "error", "message": "Invalid path"} - mime_type = None if file_type not in self._container_name_filters: try: mime_type = MimeTypeDatabase.getMimeTypeForFile(file_url) diff --git a/plugins/SupportEraser/SupportEraser.py b/plugins/SupportEraser/SupportEraser.py index 92b42f9abc..44d4831c04 100644 --- a/plugins/SupportEraser/SupportEraser.py +++ b/plugins/SupportEraser/SupportEraser.py @@ -4,6 +4,7 @@ from PyQt5.QtCore import Qt, QTimer from PyQt5.QtWidgets import QApplication +from UM.Application import Application from UM.Math.Vector import Vector from UM.Tool import Tool from UM.Event import Event, MouseEvent