From d585b053a562a34ebf108dac67107ba12b84e331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Tue, 18 Jun 2024 18:21:07 +0200 Subject: [PATCH 1/2] [core] Graph: Add a `selectedViewpoint` property The `selectedViewpoint` property will store the attribute corresponding to the actively selected viewpoint, if it exists. Otherwise, it will be set to None. --- meshroom/core/graph.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meshroom/core/graph.py b/meshroom/core/graph.py index e1f05787..23df54f2 100644 --- a/meshroom/core/graph.py +++ b/meshroom/core/graph.py @@ -226,6 +226,8 @@ class Graph(BaseObject): self._fileDateVersion = 0 self.header = {} + self._selectedViewpoint = None + def clear(self): self.header.clear() self._compatibilityNodes.clear() @@ -1564,6 +1566,12 @@ class Graph(BaseObject): self.updateStatusFromCache(force=True) self.cacheDirChanged.emit() + @property + def selectedViewpoint(self): + """ Return the attribute describing the viewpoint that is + currently set as the 'selected viewpoint'. """ + return self._selectedViewpoint + @property def fileDateVersion(self): return self._fileDateVersion From 2973672b20fb0f5597e711bab4a993c23c4241c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 19 Jun 2024 18:27:45 +0200 Subject: [PATCH 2/2] [ui] Update the graph's viewpoint whenever the selected viewpoint changes --- meshroom/ui/reconstruction.py | 1 + 1 file changed, 1 insertion(+) diff --git a/meshroom/ui/reconstruction.py b/meshroom/ui/reconstruction.py index 2e3f70c5..c331a97f 100755 --- a/meshroom/ui/reconstruction.py +++ b/meshroom/ui/reconstruction.py @@ -1158,6 +1158,7 @@ class Reconstruction(UIGraph): # Reconstruction has ownership of Viewpoint object - destroy it when not needed anymore self._selectedViewpoint.deleteLater() self._selectedViewpoint = ViewpointWrapper(viewpointAttribute, self) if viewpointAttribute else None + self._graph._selectedViewpoint = self._selectedViewpoint.attribute if viewpointAttribute else None self.selectedViewpointChanged.emit() def setPickedViewId(self, viewId):