This Page

declarations.box.placeholder

Defines classes for placeholder boxes, which serve as proxies for scene objects in order to send data to or receive data from the relation constraint in which they’re included.

class PlaceholderBoxDeclaration(name, componentName)[source]

Bases: fbrelation.declarations.box.base.BoxDeclaration

Defines the base class for placeholder box declarations, which include the name of a scene object that the declaration will attempt to locate at runtime.

class TransformationType[source]

Bases: object

Defines the space in which the placeholder box’s transformations are expressed, if any.

Note :If transformation nodes (either global or local translation, rotation, and scaling) are used in node declarations for a box, all such nodes must be in the same space (global vs. local) for the box to compile.
kNone = 0

Indicates that no transformation nodes are referenced.

kGlobal = 1

Indicates that global transformations are to be used.

kLocal = 2

Indicates that local transformations are to be used.

PlaceholderBoxDeclaration.__init__(name, componentName)[source]

Initializes a new placeholder box declaration with the given component name.

Parameters:componentName – The full name of a scene object, in the form group::namespace:name. If no group name is specified, the name is assumed to refer to a model.
PlaceholderBoxDeclaration.supportsNode(nodeName)[source]

Overridden to ensure that transformation nodes are either all global or all local, for cases in which the box is a placeholder for a model.

PlaceholderBoxDeclaration.prepareNode(nodeName)[source]

Overridden to ensure that the node with the given name exists if it corresponds to an animatable property.

PlaceholderBoxDeclaration._findComponent()[source]

Attempts to find the associated scene component based on the name given in the box declaration. The name is assumed to be a full name (group::namespace:name) if a group name is specified. Otherwise, it’s taken as the long name of a model.

Returns:the requested scene component.
Raises :an ExecutionError if the component could not be found.
PlaceholderBoxDeclaration._setTransformation(boxComponent)[source]

Helper function used by subclasses to set the FBBox to the appropriate transformation mode once it’s been created, provided it’s an instance of FBModelPlaceHolder and transformation nodes are to be connected.

class SenderBoxDeclaration(name, componentName)[source]

Bases: fbrelation.declarations.box.placeholder.PlaceholderBoxDeclaration

Defines a type of placeholder box which stands in for a scene object as a sender, with its output nodes piping data into the relation constraint.

execute(constraint, relationComponents)[source]

Executes the declaration by finding the associated component in the scene and adding it to the provided constraint as a sender.

Returns:the newly created sender box.
Raises :an ExecutionError if the named component does not exist or could not be added to the constraint.
class ReceiverBoxDeclaration(name, componentName)[source]

Bases: fbrelation.declarations.box.placeholder.PlaceholderBoxDeclaration

Defines a type of placeholder box which constrains a scene object as a receiver, with its input nodes receiving data from the relation constraint.

execute(constraint, relationComponents)[source]

Executes the declaration by finding the associated component in the scene and constraining it in the provided constraint as a receiver.

Returns:the newly created receiver box.
Raises :an ExecutionError if the named component does not exist or could not be added to the constraint.