nodedge.edge_validators¶
Edge validators module containing the Edge Validator functions which can be
registered as callbacks to Edge
class.
Example of registering Edge Validator callbacks:¶
You can register validation callbacks once for example on the bottom of node_edge.py file or on the application start with calling this:
from nodedge.edge_validators import *
Edge.registerEdgeValidator(edgeValidatorDebug)
Edge.registerEdgeValidator(edgeCannotConnectTwoOutputsOrTwoInputs)
Edge.registerEdgeValidator(edgeCannotConnectInputAndOutputOfSameNode)
-
nodedge.edge_validators.
printError
(*args)¶ Helper method which prints to console if DEBUG is set to True
-
nodedge.edge_validators.
edgeValidatorDebug
(inputSocket: nodedge.connector.Socket, outputSocket: nodedge.connector.Socket) → bool¶ This will consider edge always valid, however writes bunch of debug stuff into console
-
nodedge.edge_validators.
edgeCannotConnectTwoOutputsOrTwoInputs
(inputSocket: nodedge.connector.Socket, outputSocket: nodedge.connector.Socket) → bool¶ Edge is invalid if it connects 2 output sockets or 2 input sockets
-
nodedge.edge_validators.
edgeCannotConnectInputAndOutputOfSameNode
(inputSocket: nodedge.connector.Socket, outputSocket: nodedge.connector.Socket) → bool¶ Edge is invalid if it connects the same node