diff --git a/UM/Controller.py b/UM/Controller.py index 77291966a7..8a493fe3a0 100644 --- a/UM/Controller.py +++ b/UM/Controller.py @@ -428,17 +428,17 @@ def getScene(self) -> Scene: def event(self, event: Event): """Process an event - The event is first passed to the selection tool, then the active tool and finally the camera tool. + The event is first passed to the active tool, then the selection tool and finally the camera tool. If none of these events handle it (when they return something that does not evaluate to true) a context menu signal is emitted. :param event: event to be handle. """ - if self._selection_tool and self._selection_tool.event(event): + if self._active_tool and self._active_tool.event(event): return - if self._active_tool and self._active_tool.event(event): + if self._selection_tool and self._selection_tool.event(event): return if self._camera_tool and self._camera_tool.event(event): diff --git a/plugins/Tools/MirrorTool/MirrorTool.py b/plugins/Tools/MirrorTool/MirrorTool.py index 975d79430f..481f08dcc8 100644 --- a/plugins/Tools/MirrorTool/MirrorTool.py +++ b/plugins/Tools/MirrorTool/MirrorTool.py @@ -41,6 +41,10 @@ def event(self, event): if not id: return False + node = self.getController().getScene().findObject(id) + if node and not Selection.isSelected(node): + return False + if self._handle.isAxis(id): self.setLockedAxis(id) self._operation_started = True diff --git a/plugins/Tools/RotateTool/RotateTool.py b/plugins/Tools/RotateTool/RotateTool.py index 2b3f391566..d52ad70a5b 100644 --- a/plugins/Tools/RotateTool/RotateTool.py +++ b/plugins/Tools/RotateTool/RotateTool.py @@ -102,6 +102,10 @@ def event(self, event): if not id: return False + node = self.getController().getScene().findObject(id) + if node and not Selection.isSelected(node): + return False + if id in self._handle.getExtraWidgetsColorMap(): self._active_widget = self._handle.ExtraWidgets(id) self._widget_click_start = time.monotonic() diff --git a/plugins/Tools/ScaleTool/ScaleTool.py b/plugins/Tools/ScaleTool/ScaleTool.py index af8786c7d4..61e96352aa 100644 --- a/plugins/Tools/ScaleTool/ScaleTool.py +++ b/plugins/Tools/ScaleTool/ScaleTool.py @@ -104,6 +104,10 @@ def event(self, event): if not id: return False + node = self.getController().getScene().findObject(id) + if node and not Selection.isSelected(node): + return False + if self._handle.isAxis(id): self.setLockedAxis(id) self._saved_handle_position = self._handle.getWorldPosition() diff --git a/plugins/Tools/TranslateTool/TranslateTool.py b/plugins/Tools/TranslateTool/TranslateTool.py index ba0a9c400f..9f6b356845 100644 --- a/plugins/Tools/TranslateTool/TranslateTool.py +++ b/plugins/Tools/TranslateTool/TranslateTool.py @@ -261,6 +261,10 @@ def event(self, event: Event) -> bool: if not id: return False + node = self.getController().getScene().findObject(id) + if node and not Selection.isSelected(node): + return False + if id in self._enabled_axis: self.setLockedAxis(id) elif self._handle.isAxis(id):