Previous topic

declarations.box.macrotool

Next topic

declarations.node.base

This Page

declarations.box.macro

Defines classes for box declarations that represent macros (i.e., other relation constraints used as boxes).

class MacroBoxDeclaration(name, relationDeclaration)[source]

Bases: fbrelation.declarations.box.base.BoxDeclaration

Defines the declaration of a macro box, which contains a reference to the relation declaration to be used.

__init__(name, relationDeclaration)[source]

Initializes a new macro box which will create an instance of the specified relation constraint as a macro.

execute(constraint, relationComponents)[source]

Executes the declaration, finding the associated relation constraint and adding it to the provided constraint as a macro.

Parameters:relationComponents – Used to look up the exact name of the FBConstraintRelation that was created from the relation declaration, as the name may have been changed on creation.
createNodeDeclaration(nodeName, isSrc)[source]

Overridden to create instances of MacroNodeDeclaration for nodes that reference macro boxes.

Note :When a macro box’s node is referenced in a connection, the node name given corresponds to the name of input or output box in the original relation constraint. At runtime, these nodes are located by index rather than by the name of the FBAnimationNode.
supportsNode(nodeName)[source]

Overridden to require that the name given is a valid input or output box name in the associated relation constraint.