mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-30 06:48:47 +02:00
[core] Discard attribute callbacks during graph loading
This commit is contained in:
parent
98f1a9d516
commit
61d35904ba
2 changed files with 17 additions and 0 deletions
|
@ -214,6 +214,7 @@ class Graph(BaseObject):
|
|||
def __init__(self, name, parent=None):
|
||||
super(Graph, self).__init__(parent)
|
||||
self.name = name
|
||||
self._loading = False
|
||||
self._updateEnabled = True
|
||||
self._updateRequested = False
|
||||
self.dirtyTopology = False
|
||||
|
@ -246,6 +247,11 @@ class Graph(BaseObject):
|
|||
""" Get loaded file supported features based on its version. """
|
||||
return Graph.IO.getFeaturesForVersion(self.header.get(Graph.IO.Keys.FileVersion, "0.0"))
|
||||
|
||||
@property
|
||||
def isLoading(self):
|
||||
""" Return True if the graph is currently being loaded. """
|
||||
return self._loading
|
||||
|
||||
@Slot(str)
|
||||
def load(self, filepath, setupProjectFile=True, importProject=False, publishOutputs=False):
|
||||
"""
|
||||
|
@ -259,6 +265,13 @@ class Graph(BaseObject):
|
|||
of opened.
|
||||
publishOutputs: True if "Publish" nodes from templates should not be ignored.
|
||||
"""
|
||||
self._loading = True
|
||||
try:
|
||||
self._load(filepath, setupProjectFile, importProject, publishOutputs)
|
||||
finally:
|
||||
self._loading = False
|
||||
|
||||
def _load(self, filepath, setupProjectFile, importProject, publishOutputs):
|
||||
if not importProject:
|
||||
self.clear()
|
||||
with open(filepath) as jsonFile:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue