Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion meshroom/core/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ def _deserialize(self, graphData: dict):

# Create graph edges by resolving attributes expressions
self._applyExpr()


self._resolveAllDynamicValues()

# Templates are specific: they contain only the minimal amount of
# serialized data to describe the graph structure.
# They are not meant to be computed: therefore, we can early return here,
Expand All @@ -335,6 +337,17 @@ def _deserialize(self, graphData: dict):
# that were computed.
self._evaluateUidConflicts(graphContent)

def _resolveAllDynamicValues(self):
"""
After the full graph is loaded and all edges are wired, walk nodes
in topological order and resolve dynamic output attribute values.
"""
nodes, _ = self.dfsOnFinish()
# dfsOnFinish returns leaf-to-root order; reverse for root-to-leaf
for node in reversed(nodes):
node.updateInternals()
node.updateOutputAttr()

def _normalizeGraphContent(self, graphData: dict, fileVersion: Version) -> dict:
graphContent = graphData.get(GraphIO.Keys.Graph, graphData)

Expand Down
Loading