Merge pull request #2443 from alicevision/dev/accessCurrentFrame

Provide access to the current frame from the graph
This commit is contained in:
Fabien Castan 2024-06-20 17:01:06 +02:00 committed by GitHub
commit 6b10c24f32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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):