diff --git a/meshroom/core/graph.py b/meshroom/core/graph.py index fda468c2..e98d44d2 100644 --- a/meshroom/core/graph.py +++ b/meshroom/core/graph.py @@ -623,7 +623,12 @@ class Graph(BaseObject): self.addEdge(*edge) def getDepth(self, node): - return len(self.dfsNodesOnFinish([node])) + # TODO: would be better to use bfs instead of recursive function + inputEdges = self.getInputEdges(node) + if not inputEdges: + return 0 + inputDepths = [e.src.node.depth for e in inputEdges] + return min(inputDepths) + 1 def _getNodeEdges(self): nodeEdges = defaultdict(set)