def nodeInputComesFromNode(self, dagNode, input): """ Given a node and one of its inputs, return a tuple containing which dagNode and which of its outputs is connected to the input. """ inputString = dagNode.inputValue(input.name) (connectedNode, connectedNodeOutput) = depends_data_packet.nodeAndOutputFromScenegraphLocationString(inputString, self) return (connectedNode, connectedNodeOutput)
def dragEnterEvent(self, event): """ If the user is dragging a valid text object (correct DAG path format), let QT know it is okay to drop it (also, show a cute icon stating as much) """ if event.mimeData().hasFormat("text/plain"): outputType = self.dag.nodeOutputType(*depends_data_packet.nodeAndOutputFromScenegraphLocationString(event.mimeData().text(), self.dag)) if outputType not in self.dagNode.dataPacketTypesAccepted(): QtGui.QWidget.dragEnterEvent(self, event) return event.acceptProposedAction() QtGui.QWidget.dragEnterEvent(self, event)
def dragEnterEvent(self, event): """ If the user is dragging a valid text object (correct DAG path format), let QT know it is okay to drop it (also, show a cute icon stating as much) """ if event.mimeData().hasFormat("text/plain"): outputType = self.dag.nodeOutputType( *depends_data_packet.nodeAndOutputFromScenegraphLocationString( event.mimeData().text(), self.dag)) if outputType not in self.dagNode.dataPacketTypesAccepted(): QtGui.QWidget.dragEnterEvent(self, event) return event.acceptProposedAction() QtGui.QWidget.dragEnterEvent(self, event)