mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-23 22:16:30 +02:00
[ui] GraphEditor: add "Delete From Here" in node contextual menu
* ease the deletion of a branch from a given starting point * accessible with alt+del on a node * re-order menu to put the most destructive operation (Clear Data) at the very end
This commit is contained in:
parent
b50f9fb44d
commit
d10c779914
2 changed files with 32 additions and 7 deletions
|
@ -390,6 +390,18 @@ class UIGraph(QObject):
|
|||
def removeNode(self, node):
|
||||
self.push(commands.RemoveNodeCommand(self._graph, node))
|
||||
|
||||
@Slot(Node)
|
||||
def removeNodesFrom(self, startNode):
|
||||
"""
|
||||
Remove all nodes starting from 'startNode' to graph leaves.
|
||||
Args:
|
||||
startNode (Node): the node to start from.
|
||||
"""
|
||||
with self.groupedGraphModification("Remove Nodes from {}".format(startNode.name)):
|
||||
# Perform nodes removal from leaves to start node so that edges
|
||||
# can be re-created in correct order on redo.
|
||||
[self.removeNode(node) for node in reversed(self._graph.nodesFromNode(startNode)[0])]
|
||||
|
||||
@Slot(Attribute, Attribute)
|
||||
def addEdge(self, src, dst):
|
||||
if isinstance(dst, ListAttribute) and not isinstance(src, ListAttribute):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue