mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-19 03:56:26 +02:00
[commands] add GraphModification on RemoveNode.undo
Avoid multiple graph updates on node/edges creation
This commit is contained in:
parent
1a6febb02e
commit
06303c5773
1 changed files with 10 additions and 9 deletions
|
@ -4,7 +4,7 @@ from contextlib import contextmanager
|
|||
|
||||
from PySide2.QtWidgets import QUndoCommand, QUndoStack
|
||||
from PySide2.QtCore import Property, Signal
|
||||
from meshroom.core.graph import Node, ListAttribute, Graph
|
||||
from meshroom.core.graph import Node, ListAttribute, Graph, GraphModification
|
||||
|
||||
|
||||
class UndoCommand(QUndoCommand):
|
||||
|
@ -112,6 +112,7 @@ class RemoveNodeCommand(GraphCommand):
|
|||
return True
|
||||
|
||||
def undoImpl(self):
|
||||
with GraphModification(self.graph):
|
||||
node = self.graph.addNode(Node(nodeDesc=self.nodeDict["nodeType"],
|
||||
**self.nodeDict["attributes"]
|
||||
), self.nodeName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue