Previous topic


Next topic

This Page

Defines base classes for box declarations.

class BoxDeclaration(name)[source]

An abstract base class that defines the declaration of a box within a relation constraint. All types of boxes can have nodes which are referenced by connections.


Initializes a new box declaration with the given name.

execute(constraint, relationComponents)[source]

Overridden by subclasses in order to create and configure a new box of the appropriate type within the given FBConstraintRelation.

Parameters:relationComponents – Maps the names of the relation declarations executed so far to the corresponding FBConstraintRelation objects. Used to resolve macro references.
Returns:The newly created FBBox object.
Raises :an ExecutionError if the box can not be created.
createNodeDeclaration(nodeName, isSrc)[source]

Creates and returns a new NodeDeclaration object for a node of the given name within this box.

Parameters:isSrc – Represents whether the connection uses this box as a source (with an output node) or a destination (with an input node).
Note :The default implementation uses the base BoxNodeDeclaration class, but subclasses may override this method to create more specialized node declarations.

Returns whether this box could possibly support a connection to a node of the given name.

Note :A return value of True is not confirmation that the box absolutely will have a node of the given name in MotionBuilder, but it allows us to perform some rudimentary static checking at compile-time.
Note :The default implementation simply requires that a non-blank node name be given in the node declaration.

Signals to the box declaration that a connection is about to be made using one of the box’s nodes. Gives the box an opportunity to ensure that the node exists.

Note :The default implementation does nothing, but subclasses can override this method as necessary.

Returns whether this box represents either an input or an output macro tool, depending on the value of isInput.

Note :The default implementation simply returns False to indicate that the box is not a macro tool at all.