mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-20 04:26:28 +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.QtWidgets import QUndoCommand, QUndoStack
|
||||||
from PySide2.QtCore import Property, Signal
|
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):
|
class UndoCommand(QUndoCommand):
|
||||||
|
@ -112,6 +112,7 @@ class RemoveNodeCommand(GraphCommand):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def undoImpl(self):
|
def undoImpl(self):
|
||||||
|
with GraphModification(self.graph):
|
||||||
node = self.graph.addNode(Node(nodeDesc=self.nodeDict["nodeType"],
|
node = self.graph.addNode(Node(nodeDesc=self.nodeDict["nodeType"],
|
||||||
**self.nodeDict["attributes"]
|
**self.nodeDict["attributes"]
|
||||||
), self.nodeName)
|
), self.nodeName)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue