nodedge.blocks.block¶
Block module containing Block
class.
-
class
nodedge.blocks.block.
Block
(scene, inputSocketTypes=(2, 2), outputSocketTypes=(1, ))¶ Bases:
nodedge.node.Node
Block
classA block is node which can be evaluated to produce an output.
- Parameters
-
iconPath
= ''¶
-
operationTitle
= 'Undefined'¶
-
operationCode
= 0¶
-
contentLabel
= ''¶
-
contentLabelObjectName
= 'blockBackground'¶
-
GraphicsNodeClass
¶
-
GraphicsNodeContentClass
¶ alias of
nodedge.blocks.graphics_block_content.GraphicsBlockContent
-
initSettings
()¶ Initialize the location of the input and output sockets.
-
onInputChanged
(socket: Optional[nodedge.connector.Socket] = None) → None¶ Called when the value of an input has changed.
- Parameters
socket – the socket on which the input has changed
- Returns
None
-
checkInputsValidity
()¶
-
evalImplementation
()¶
-
eval
(index=0)¶ Evaluate this node. This must be overridden. See Evaluation for more details.
-
serialize
() → collections.OrderedDict¶ Serialization method to serialize this class data into
OrderedDict
which can be stored in memory or file easily.- Returns
data serialized in
OrderedDict
- Return type
OrderedDict
-
deserialize
(data: dict, hashmap: Optional[dict] = None, restoreId: bool = True, *args, **kwargs)¶ Deserialization method which take data in python
dict
format with helping hashmap containing references to existing entities.- Parameters
data (
dict
) – dictionary containing serialized datahashmap (
dict
) – helper dictionary containing references (by id == key) to existing objectsrestoreId (
bool
) –True
if we are creating new sockets.False
is useful when loading existing sockets which we want to keep the existing object’s id
- Returns
True
if deserialization was successful,False
otherwise- Return type
bool
-
exception
nodedge.blocks.block.
EvaluationError
¶ Bases:
Exception
EvaluationError
classIf a block cannot be evaluated, raise this error.
-
exception
nodedge.blocks.block.
MissInputError
¶ Bases:
nodedge.blocks.block.EvaluationError
MissInputError
classIf an input is missing to a block, preventing it to be evaluated, raise this error.
-
exception
nodedge.blocks.block.
RedundantInputError
¶ Bases:
nodedge.blocks.block.EvaluationError
RedundantInputError
classIf two different inputs are connected to a single input socket of a block, raise this error.