mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-04 12:46:44 +02:00
[core] Graph: avoid double update while adding/removing an edge
Graph.markNodesDirty() is called in three different places: - Attribute.requestGraphUpdate() - Graph.addEdge() - Graph.removeEdge() However, addEdge() and removeEdge() are especially decorated to request a graph update so, with the old markNodesDirty() implementation, the update was done twice in a row.
This commit is contained in:
parent
06b821349f
commit
74fa3022fe
2 changed files with 2 additions and 2 deletions
|
@ -142,6 +142,7 @@ class Attribute(BaseObject):
|
||||||
def requestGraphUpdate(self):
|
def requestGraphUpdate(self):
|
||||||
if self.node.graph:
|
if self.node.graph:
|
||||||
self.node.graph.markNodesDirty(self.node)
|
self.node.graph.markNodesDirty(self.node)
|
||||||
|
self.node.graph.update()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def isOutput(self):
|
def isOutput(self):
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ class Graph(BaseObject):
|
||||||
|
|
||||||
def markNodesDirty(self, fromNode):
|
def markNodesDirty(self, fromNode):
|
||||||
"""
|
"""
|
||||||
Mark all nodes following 'fromNode' as dirty, and request a graph update.
|
Mark all nodes following 'fromNode' as dirty.
|
||||||
All nodes marked as dirty will get their outputs to be re-evaluated
|
All nodes marked as dirty will get their outputs to be re-evaluated
|
||||||
during the next graph update.
|
during the next graph update.
|
||||||
|
|
||||||
|
@ -1072,7 +1072,6 @@ class Graph(BaseObject):
|
||||||
nodes, edges = self.nodesFromNode(fromNode)
|
nodes, edges = self.nodesFromNode(fromNode)
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
node.dirty = True
|
node.dirty = True
|
||||||
self.update()
|
|
||||||
|
|
||||||
def stopExecution(self):
|
def stopExecution(self):
|
||||||
""" Request graph execution to be stopped by terminating running chunks"""
|
""" Request graph execution to be stopped by terminating running chunks"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue