Skip to content

Commit

Permalink
Now preserves view type (simulation or x-ray) when toggling between p…
Browse files Browse the repository at this point in the history
…repare and preview stages.
  • Loading branch information
burtoogle committed Apr 7, 2024
1 parent e4b8834 commit 2c161f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RawMouse/RawMouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(self, parent = None):
self._main_window = None
self._scene = None
self._camera_tool = None
self._lastPreviewStageView = "SimulationView"

self.setMenuName(catalog.i18nc("@item:inmenu", "RawMouse"))
self.addMenuItem(catalog.i18nc("@item:inmenu", "Stop"), self._stop)
Expand Down Expand Up @@ -323,12 +324,13 @@ def _processButtons(self):
self._roll = 0
self._controller.setCameraRotation(*self._button_work["resetview"])
elif self._button_work["toggleview"]:
if self._controller.getActiveView().getPluginId() == "SimulationView":
if self._controller.getActiveStage().getPluginId() == "PreviewStage":
self._lastPreviewStageView = self._controller.getActiveView().getPluginId()
self._controller.setActiveStage("PrepareStage")
self._controller.setActiveView("SolidView")
else:
self._controller.setActiveStage("PreviewStage")
self._controller.setActiveView("SimulationView")
self._controller.setActiveView(self._lastPreviewStageView)
elif self._button_work["maxlayer"]:
if current_view.getPluginId() == "SimulationView":
layer = self._button_work["maxlayer"]
Expand Down

0 comments on commit 2c161f2

Please sign in to comment.