#include <connectableAPIBehavior.h>
UsdShadeConnectableAPIBehavior defines the compatibilty and behavior UsdShadeConnectableAPIof when applied to a particular prim type.
This enables schema libraries to enable UsdShadeConnectableAPI for their prim types and define its behavior.
Definition at line 48 of file connectableAPIBehavior.h.
An enum describing the types of connectable nodes which will govern what connectibility rule is invoked for these.
Enumerator |
---|
BasicNodes |
|
DerivedContainerNodes |
|
Definition at line 54 of file connectableAPIBehavior.h.
USDSHADE_API UsdShadeConnectableAPIBehavior::UsdShadeConnectableAPIBehavior |
( |
| ) |
|
|
inline |
USDSHADE_API UsdShadeConnectableAPIBehavior::UsdShadeConnectableAPIBehavior |
( |
const bool |
isContainer, |
|
|
const bool |
requiresEncapsulation |
|
) |
| |
|
inline |
virtual USDSHADE_API UsdShadeConnectableAPIBehavior::~UsdShadeConnectableAPIBehavior |
( |
| ) |
|
|
virtual |
Helper function to separate and share special connectivity logic for specialized, NodeGraph-derived nodes, like Material (and other in other domains) that allow their inputs to be connected to an output of a source that they directly contain/encapsulate. The default behavior is for Shader Nodes or NodeGraphs which allow their input connections to output of a sibling source, both encapsulated by the same container node.
The prim owning the input is guaranteed to be of the type this behavior was registered with. The function must be thread-safe.
It should return true if the connection is allowed, false otherwise. If the connection is prohibited and reason
is non-NULL, it should be set to a user-facing description of the reason the connection is prohibited.
The base implementation checks that the input is defined; that the source attribute exists; and that the connectability metadata on the input allows a connection from the attribute – see UsdShadeInput::GetConnectability().
The prim owning the output is guaranteed to be of the type this behavior was registered with. The function must be thread-safe.
It should return true if the connection is allowed, false otherwise. If the connection is prohibited and reason
is non-NULL, it should be set to a user-facing description of the reason the connection is prohibited.
The base implementation returns false. Outputs of most prim types will be defined by the underlying node definition (see UsdShadeNodeDefAPI), not a connection.
virtual USDSHADE_API bool UsdShadeConnectableAPIBehavior::IsContainer |
( |
| ) |
const |
|
finalvirtual |
The function must be thread-safe.
It should return true if the associated prim type is considered a "container" for connected nodes. Returns the value set for _isContainer.
virtual USDSHADE_API bool UsdShadeConnectableAPIBehavior::RequiresEncapsulation |
( |
| ) |
const |
|
finalvirtual |
The function must be thread-safe.
Determines if the behavior should respect container encapsulation rules (UsdShadeConnectability), when evaluating CanConnectInputToSource or CanConnectOutputToSource. This should return true if the container encapsulation rules need to be respected, false otherwise. Returns the value set for _requiresEncapsulation.
- See Also
- IsContainer()
The documentation for this class was generated from the following file: