Exemplo n.º 1
0
    def __onNodeRemoved(self, node):
        node.getComponent().detach()

        if not UndoRedoManager.getInstance().isUndoingOrRedoing():
            command = graph_commands.RemoveNodeCommand(self.graphView,
                                                       self.guideRig, node)
            UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 2
0
    def __onSelectionMoved(self, nodes, delta):
        for node in nodes:
            node.pushGraphPosToComponent()

        if not UndoRedoManager.getInstance().isUndoingOrRedoing():
            command = graph_commands.NodesMoveCommand(self.graphView, nodes, delta)
            UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 3
0
    def __onNodeRemoved(self, node):

        if type(node).__name__ != 'KBackdrop':
            node.getComponent().detach()

        if not UndoRedoManager.getInstance().isUndoingOrRedoing():
            command = graph_commands.RemoveNodeCommand(self.graphView, self.guideRig, node)
            UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 4
0
    def __onSelectionMoved(self, nodes, delta):
        for node in nodes:
            node.pushGraphPosToComponent()

        if not UndoRedoManager.getInstance().isUndoingOrRedoing():
            command = graph_commands.NodesMoveCommand(self.graphView, nodes,
                                                      delta)
            UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 5
0
    def _invokeSetter(self, value = None):
        if self._updatingWidget:
            return
        interactionInProgress = self.__interactionInProgress
        if not interactionInProgress:
            self.beginInteraction()

        self._firingSetter  = True
        # some value changes, such as resizing arrays, requires that the widget be re-built.
        # in those cases, we should provide the value to the setter.
        # if value is None:
        # For now this is disabled, because we always want to set an RTVal on the attribute.
        # (getWidgetValue should now always return an RTVal)
        value = self.getWidgetValue()

        command = ValueChangeCommand(self._attribute, self, value)
        UndoRedoManager.getInstance().addCommand(command, invokeRedoOnAdd=True)

        self._firingSetter  = False

        if not interactionInProgress:
            self.endInteraction()
Exemplo n.º 6
0
    def _invokeSetter(self, value=None):
        if self._updatingWidget:
            return
        interactionInProgress = self.__interactionInProgress
        if not interactionInProgress:
            self.beginInteraction()

        self._firingSetter = True
        # some value changes, such as resizing arrays, requires that the widget be re-built.
        # in those cases, we should provide the value to the setter.
        # if value is None:
        # For now this is disabled, because we always want to set an RTVal on the attribute.
        # (getWidgetValue should now always return an RTVal)
        value = self.getWidgetValue()

        command = ValueChangeCommand(self._attribute, self, value)
        UndoRedoManager.getInstance().addCommand(command, invokeRedoOnAdd=True)

        self._firingSetter = False

        if not interactionInProgress:
            self.endInteraction()
Exemplo n.º 7
0
 def __onBeginConnectionManipulation(self):
     UndoRedoManager.getInstance().openBracket('Connect Ports')
Exemplo n.º 8
0
 def beginInteraction(self):
     UndoRedoManager.getInstance().openBracket(self._attribute.getName() +
                                               " changed")
     self.__interactionInProgress = True
Exemplo n.º 9
0
 def endInteraction(self):
     self.__interactionInProgress = False
     UndoRedoManager.getInstance().closeBracket()
Exemplo n.º 10
0
 def __onBeginDeleteSelection(self):
     UndoRedoManager.getInstance().openBracket('Delete Nodes')
Exemplo n.º 11
0
 def __onEndDeleteSelection(self):
     UndoRedoManager.getInstance().closeBracket()
Exemplo n.º 12
0
 def __onSelectionChanged(self, deselectedNodes, selectedNodes):
     if not UndoRedoManager.getInstance().isUndoingOrRedoing():
         command = graph_commands.SelectionChangeCommand(self.graphView, deselectedNodes, selectedNodes)
         UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 13
0
 def __onSelectionMoved(self, nodes, delta):
     if not UndoRedoManager.getInstance().isUndoingOrRedoing():
         command = graph_commands.NodesMoveCommand(self.graphView, nodes, delta)
         UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 14
0
 def __onEndConnectionManipulationSignal(self):
     UndoRedoManager.getInstance().closeBracket()
Exemplo n.º 15
0
 def __onConnectionRemoved(self, connection):
     if not UndoRedoManager.getInstance().isUndoingOrRedoing():
         command = graph_commands.ConnectionRemovedCommand(self.graphView, self.guideRig, connection)
         UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 16
0
 def beginInteraction(self):
     UndoRedoManager.getInstance().openBracket(self._attribute.getName() + " changed")
     self.__interactionInProgress = True
Exemplo n.º 17
0
 def endInteraction(self):
     self.__interactionInProgress = False
     UndoRedoManager.getInstance().closeBracket()
Exemplo n.º 18
0
 def __onNodeAdded(self, node):
     if not UndoRedoManager.getInstance().isUndoingOrRedoing():
         command = graph_commands.AddNodeCommand(self.graphView, self.guideRig, node)
         UndoRedoManager.getInstance().addCommand(command)
Exemplo n.º 19
0
 def redo(self):
     UndoRedoManager.getInstance().redo()
Exemplo n.º 20
0
 def undo(self):
     UndoRedoManager.getInstance().undo()