|
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and making connections between shading parameters and outputs. More...
#include <connectableAPI.h>
Public Member Functions | |
UsdShadeConnectableAPI (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdShadeConnectableAPI on UsdPrim prim . | |
UsdShadeConnectableAPI (const UsdSchemaBase &schemaObj) | |
Construct a UsdShadeConnectableAPI on the prim held by schemaObj . | |
virtual USDSHADE_API | ~UsdShadeConnectableAPI () |
Destructor. | |
USDSHADE_API bool | IsContainer () const |
Returns true if the prim is a container. | |
USDSHADE_API bool | RequiresEncapsulation () const |
Returns true if container encapsulation rules should be respected when evaluating connectibility behavior, false otherwise. | |
Outputs | |
USDSHADE_API UsdShadeOutput | CreateOutput (const TfToken &name, const SdfValueTypeName &typeName) const |
Create an output, which represents and externally computed, typed value. | |
USDSHADE_API UsdShadeOutput | GetOutput (const TfToken &name) const |
Return the requested output if it exists. | |
USDSHADE_API std::vector< UsdShadeOutput > | GetOutputs (bool onlyAuthored=true) const |
Returns all outputs on the connectable prim (i.e. | |
Inputs | |
USDSHADE_API UsdShadeInput | CreateInput (const TfToken &name, const SdfValueTypeName &typeName) const |
Create an input which can both have a value and be connected. | |
USDSHADE_API UsdShadeInput | GetInput (const TfToken &name) const |
Return the requested input if it exists. | |
USDSHADE_API std::vector< UsdShadeInput > | GetInputs (bool onlyAuthored=true) const |
Returns all inputs on the connectable prim (i.e. | |
Public Member Functions inherited from UsdAPISchemaBase | |
UsdAPISchemaBase (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdAPISchemaBase on UsdPrim prim . | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj) | |
Construct a UsdAPISchemaBase on the prim held by schemaObj . | |
virtual USD_API | ~UsdAPISchemaBase ()=0 |
Destructor. | |
Public Member Functions inherited from UsdSchemaBase | |
bool | IsConcrete () const |
Returns whether or not this class corresponds to a concrete instantiable prim type in scene description. | |
bool | IsTyped () const |
Returns whether or not this class inherits from UsdTyped. | |
bool | IsAPISchema () const |
Returns whether this is an API schema or not. | |
bool | IsAppliedAPISchema () const |
Returns whether this is an applied API schema or not. | |
bool | IsMultipleApplyAPISchema () const |
Returns whether this is an applied API schema or not. | |
UsdSchemaKind | GetSchemaKind () const |
Returns the kind of schema this class is. | |
USD_API | UsdSchemaBase (const UsdPrim &prim=UsdPrim()) |
Construct and store prim as the held prim. | |
USD_API | UsdSchemaBase (const UsdSchemaBase &otherSchema) |
Construct and store for the same prim held by otherSchema . | |
virtual USD_API | ~UsdSchemaBase () |
Destructor. | |
UsdPrim | GetPrim () const |
Return this schema object's held prim. | |
SdfPath | GetPath () const |
Shorthand for GetPrim()->GetPath(). | |
USD_API const UsdPrimDefinition * | GetSchemaClassPrimDefinition () const |
Return the prim definition associated with this schema instance if one exists, otherwise return null. | |
USD_API | operator bool () const |
Return true if this schema object is compatible with its held prim, false otherwise. | |
Static Public Member Functions | |
static USDSHADE_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. | |
static USDSHADE_API UsdShadeConnectableAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
Return a UsdShadeConnectableAPI holding the prim adhering to this schema at path on stage . | |
Static Public Member Functions inherited from UsdAPISchemaBase | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. | |
Static Public Member Functions inherited from UsdSchemaBase | |
static const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::NonAppliedAPI |
Compile time constant representing what kind of schema this class is. | |
Static Public Attributes inherited from UsdAPISchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. | |
Static Public Attributes inherited from UsdSchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. | |
Protected Member Functions | |
USDSHADE_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. | |
USDSHADE_API bool | _IsCompatible () const override |
Returns true if the given prim is compatible with this API schema, i.e. | |
Protected Member Functions inherited from UsdAPISchemaBase | |
USD_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. | |
UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName . | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName . | |
const TfToken & | _GetInstanceName () const |
Returns the instance name of the API schema object belonging to a multiple-apply API schema. | |
USD_API bool | _IsCompatible () const override |
Check whether this APISchema object is valid for the currently held prim. | |
Protected Member Functions inherited from UsdSchemaBase | |
virtual UsdSchemaKind | _GetSchemaType () const |
const TfType & | _GetType () const |
USD_API UsdAttribute | _CreateAttr (TfToken const &attrName, SdfValueTypeName const &typeName, bool custom, SdfVariability variability, VtValue const &defaultValue, bool writeSparsely) const |
Friends | |
class | UsdSchemaRegistry |
Connections | |
Inputs and outputs on shaders and node-graphs are connectable. This section provides API for authoring and managing these connections in a shading network. | |
using | ConnectionModification = UsdShadeConnectionModification |
static USDSHADE_API bool | CanConnect (const UsdShadeInput &input, const UsdAttribute &source) |
Determines whether the given input can be connected to the given source attribute, which can be an input or an output. | |
static USDSHADE_API bool | CanConnect (const UsdShadeInput &input, const UsdShadeInput &sourceInput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | CanConnect (const UsdShadeInput &input, const UsdShadeOutput &sourceOutput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | CanConnect (const UsdShadeOutput &output, const UsdAttribute &source=UsdAttribute()) |
Determines whether the given output can be connected to the given source attribute, which can be an input or an output. | |
static USDSHADE_API bool | CanConnect (const UsdShadeOutput &output, const UsdShadeInput &sourceInput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | CanConnect (const UsdShadeOutput &output, const UsdShadeOutput &sourceOutput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdAttribute const &shadingAttr, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace) |
Authors a connection for a given shading attribute shadingAttr . | |
static USDSHADE_API bool | ConnectToSource (UsdShadeInput const &input, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdShadeOutput const &output, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdAttribute const &shadingAttr, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName()) |
static USDSHADE_API bool | ConnectToSource (UsdShadeInput const &input, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName()) |
static USDSHADE_API bool | ConnectToSource (UsdShadeOutput const &output, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName()) |
static USDSHADE_API bool | ConnectToSource (UsdAttribute const &shadingAttr, SdfPath const &sourcePath) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Connect the given shading attribute to the source at path, sourcePath . | |
static USDSHADE_API bool | ConnectToSource (UsdShadeInput const &input, SdfPath const &sourcePath) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdShadeOutput const &output, SdfPath const &sourcePath) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdAttribute const &shadingAttr, UsdShadeInput const &sourceInput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Connect the given shading attribute to the given source input. | |
static USDSHADE_API bool | ConnectToSource (UsdShadeInput const &input, UsdShadeInput const &sourceInput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdShadeOutput const &output, UsdShadeInput const &sourceInput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdAttribute const &shadingAttr, UsdShadeOutput const &sourceOutput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Connect the given shading attribute to the given source output. | |
static USDSHADE_API bool | ConnectToSource (UsdShadeInput const &input, UsdShadeOutput const &sourceOutput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ConnectToSource (UsdShadeOutput const &output, UsdShadeOutput const &sourceOutput) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | SetConnectedSources (UsdAttribute const &shadingAttr, std::vector< UsdShadeConnectionSourceInfo > const &sourceInfos) |
Authors a list of connections for a given shading attribute shadingAttr . | |
static USDSHADE_API bool | GetConnectedSource (UsdAttribute const &shadingAttr, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType) |
static USDSHADE_API bool | GetConnectedSource (UsdShadeInput const &input, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType) |
static USDSHADE_API bool | GetConnectedSource (UsdShadeOutput const &output, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType) |
static USDSHADE_API UsdShadeSourceInfoVector | GetConnectedSources (UsdAttribute const &shadingAttr, SdfPathVector *invalidSourcePaths=nullptr) |
Finds the valid sources of connections for the given shading attribute. | |
static USDSHADE_API UsdShadeSourceInfoVector | GetConnectedSources (UsdShadeInput const &input, SdfPathVector *invalidSourcePaths=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API UsdShadeSourceInfoVector | GetConnectedSources (UsdShadeOutput const &output, SdfPathVector *invalidSourcePaths=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | GetRawConnectedSourcePaths (UsdAttribute const &shadingAttr, SdfPathVector *sourcePaths) |
static USDSHADE_API bool | GetRawConnectedSourcePaths (UsdShadeInput const &input, SdfPathVector *sourcePaths) |
static USDSHADE_API bool | GetRawConnectedSourcePaths (UsdShadeOutput const &output, SdfPathVector *sourcePaths) |
static USDSHADE_API bool | HasConnectedSource (const UsdAttribute &shadingAttr) |
Returns true if and only if the shading attribute is currently connected to at least one valid (defined) source. | |
static USDSHADE_API bool | HasConnectedSource (const UsdShadeInput &input) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | HasConnectedSource (const UsdShadeOutput &output) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | IsSourceConnectionFromBaseMaterial (const UsdAttribute &shadingAttr) |
Returns true if the connection to the given shading attribute's source, as returned by UsdShadeConnectableAPI::GetConnectedSource(), is authored across a specializes arc, which is used to denote a base material. | |
static USDSHADE_API bool | IsSourceConnectionFromBaseMaterial (const UsdShadeInput &input) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | IsSourceConnectionFromBaseMaterial (const UsdShadeOutput &output) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | DisconnectSource (UsdAttribute const &shadingAttr, UsdAttribute const &sourceAttr=UsdAttribute()) |
Disconnect source for this shading attribute. | |
static USDSHADE_API bool | DisconnectSource (UsdShadeInput const &input, UsdAttribute const &sourceAttr=UsdAttribute()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | DisconnectSource (UsdShadeOutput const &output, UsdAttribute const &sourceAttr=UsdAttribute()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ClearSources (UsdAttribute const &shadingAttr) |
Clears sources for this shading attribute in the current UsdEditTarget. | |
static USDSHADE_API bool | ClearSources (UsdShadeInput const &input) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ClearSources (UsdShadeOutput const &output) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static USDSHADE_API bool | ClearSource (UsdAttribute const &shadingAttr) |
static USDSHADE_API bool | ClearSource (UsdShadeInput const &input) |
static USDSHADE_API bool | ClearSource (UsdShadeOutput const &output) |
static USDSHADE_API bool | HasConnectableAPI (const TfType &schemaType) |
Return true if the schemaType has a valid connectableAPIBehavior registered, false otherwise. | |
template<typename T > | |
static bool | HasConnectableAPI () |
Return true if the schema type T has a connectableAPIBehavior registered, false otherwise. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from UsdAPISchemaBase | |
static USD_API TfTokenVector | _GetMultipleApplyInstanceNames (const UsdPrim &prim, const TfType &schemaType) |
Returns a vector of names of API schema objects belonging to a multiple-apply API schema applied to a given prim. | |
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and making connections between shading parameters and outputs.
The interface is common to all UsdShade schemas that support Inputs and Outputs, which currently includes UsdShadeShader, UsdShadeNodeGraph, and UsdShadeMaterial .
One can construct a UsdShadeConnectableAPI directly from a UsdPrim, or from objects of any of the schema classes listed above. If it seems onerous to need to construct a secondary schema object to interact with Inputs and Outputs, keep in mind that any function whose purpose is either to walk material/shader networks via their connections, or to create such networks, can typically be written entirely in terms of UsdShadeConnectableAPI objects, without needing to care what the underlying prim type is.
Additionally, the most common UsdShadeConnectableAPI behaviors (creating Inputs and Outputs, and making connections) are wrapped as convenience methods on the prim schema classes (creation) and UsdShadeInput and UsdShadeOutput.
Definition at line 64 of file connectableAPI.h.
using ConnectionModification = UsdShadeConnectionModification |
Definition at line 232 of file connectableAPI.h.
|
inlineexplicit |
Construct a UsdShadeConnectableAPI on UsdPrim prim
.
Equivalent to UsdShadeConnectableAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim
, but will not immediately throw an error for an invalid prim
Definition at line 76 of file connectableAPI.h.
|
inlineexplicit |
Construct a UsdShadeConnectableAPI on the prim held by schemaObj
.
Should be preferred over UsdShadeConnectableAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.
Definition at line 84 of file connectableAPI.h.
|
virtual |
Destructor.
|
overrideprotectedvirtual |
Returns the kind of schema this class belongs to.
Reimplemented from UsdAPISchemaBase.
|
overrideprotectedvirtual |
Returns true if the given prim is compatible with this API schema, i.e.
if it is a valid shader or a node-graph. A prim has a compatible connectableAPI if a valid behavior is registered for it.
Reimplemented from UsdAPISchemaBase.
|
static |
Determines whether the given input can be connected to the given source attribute, which can be an input or an output.
The result depends on the "connectability" of the input and the source attributes. Depending on the prim type, this may require the plugin that defines connectability behavior for that prim type be loaded.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 192 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 199 of file connectableAPI.h.
|
static |
Determines whether the given output can be connected to the given source attribute, which can be an input or an output.
An output is considered to be connectable only if it belongs to a node-graph. Shader outputs are not connectable.
source
is an optional argument. If a valid UsdAttribute is supplied for it, this method will return true only if the source attribute is owned by a descendant of the node-graph owning the output.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 220 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 227 of file connectableAPI.h.
|
inlinestatic |
Definition at line 635 of file connectableAPI.h.
|
inlinestatic |
Definition at line 642 of file connectableAPI.h.
|
inlinestatic |
Definition at line 649 of file connectableAPI.h.
|
static |
Clears sources for this shading attribute in the current UsdEditTarget.
Most of the time, what you probably want is DisconnectSource() rather than this function.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 622 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 628 of file connectableAPI.h.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Connect the given shading attribute to the source at path, sourcePath
.
sourcePath
should be the fully namespaced property path.
This overload is provided for convenience, for use in contexts where the prim types are unknown or unavailable.
|
static |
|
static |
Authors a connection for a given shading attribute shadingAttr
.
shadingAttr
can represent a parameter, an input or an output. source
is a struct that describes the upstream source attribute with all the information necessary to make a connection. See the documentation for UsdShadeConnectionSourceInfo. mod
describes the operation that should be applied to the list of connections. By default the new connection will replace any existing connections, but it can add to the list of connections to represent multiple input connections.
true
if a connection was created successfully. false
if shadingAttr
or source
is invalid.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Connect the given shading attribute to the given source input.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Connect the given shading attribute to the given source output.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 335 of file connectableAPI.h.
|
inlinestatic |
Definition at line 295 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 263 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 357 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 379 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 342 of file connectableAPI.h.
|
inlinestatic |
Definition at line 309 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 273 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 364 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 386 of file connectableAPI.h.
USDSHADE_API UsdShadeInput CreateInput | ( | const TfToken & | name, |
const SdfValueTypeName & | typeName | ||
) | const |
Create an input which can both have a value and be connected.
The attribute representing the input is created in the "inputs:" namespace.
USDSHADE_API UsdShadeOutput CreateOutput | ( | const TfToken & | name, |
const SdfValueTypeName & | typeName | ||
) | const |
Create an output, which represents and externally computed, typed value.
Outputs on node-graphs can be connected.
The attribute representing an output is created in the "outputs:" namespace.
|
static |
Disconnect source for this shading attribute.
If sourceAttr
is valid it will disconnect the connection to this upstream attribute. Otherwise it will disconnect all connections by authoring an empty list of connections for the attribute shadingAttr
.
This may author more scene description than you might expect - we define the behavior of disconnect to be that, even if a shading attribute becomes connected in a weaker layer than the current UsdEditTarget, the attribute will still be disconnected in the composition, therefore we must "block" it in the current UsdEditTarget.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 597 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 605 of file connectableAPI.h.
|
static |
Return a UsdShadeConnectableAPI holding the prim adhering to this schema at path
on stage
.
If no prim exists at path
on stage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:
|
static |
Finds the source of a connection for the given shading attribute.
shadingAttr
is the shading attribute whose connection we want to interrogate. source
is an output parameter which will be set to the source connectable prim. sourceName
will be set to the name of the source shading attribute, which may be an input or an output, as specified by sourceType
sourceType
will have the type of the source shading attribute, i.e. whether it is an Input
or Output
true
if the shading attribute is connected to a valid, defined source attribute. false
if the shading attribute is not connected to a single, defined source attribute.None
|
inlinestatic |
Definition at line 449 of file connectableAPI.h.
|
inlinestatic |
Definition at line 460 of file connectableAPI.h.
|
static |
Finds the valid sources of connections for the given shading attribute.
shadingAttr
is the shading attribute whose connections we want to interrogate. invalidSourcePaths
is an optional output parameter to collect the invalid source paths that have not been reported in the returned vector.
Returns a vector of UsdShadeConnectionSourceInfo
structs with information about each upsteam attribute. If the vector is empty, there have been no connections.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
USDSHADE_API UsdShadeInput GetInput | ( | const TfToken & | name | ) | const |
Return the requested input if it exists.
name
is the unnamespaced base name.
USDSHADE_API std::vector< UsdShadeInput > GetInputs | ( | bool | onlyAuthored = true | ) | const |
Returns all inputs on the connectable prim (i.e.
shader or node-graph). Inputs are represented by attributes in the "inputs:" namespace. If onlyAuthored
is true (the default), then only return authored attributes; otherwise, this also returns un-authored builtins.
USDSHADE_API UsdShadeOutput GetOutput | ( | const TfToken & | name | ) | const |
Return the requested output if it exists.
name
is the unnamespaced base name.
USDSHADE_API std::vector< UsdShadeOutput > GetOutputs | ( | bool | onlyAuthored = true | ) | const |
Returns all outputs on the connectable prim (i.e.
shader or node-graph). Outputs are represented by attributes in the "outputs:" namespace. If onlyAuthored
is true (the default), then only return authored attributes; otherwise, this also returns un-authored builtins.
|
static |
Returns the "raw" (authored) connected source paths for the given shading attribute.
|
inlinestatic |
Definition at line 513 of file connectableAPI.h.
|
inlinestatic |
Definition at line 521 of file connectableAPI.h.
|
static |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended methods of the schemas involved.
|
inlinestatic |
Return true if the schema type T
has a connectableAPIBehavior registered, false otherwise.
Definition at line 663 of file connectableAPI.h.
|
static |
Return true if the schemaType
has a valid connectableAPIBehavior registered, false otherwise.
To check if a prim's connectableAPI has a behavior defined, use UsdSchemaBase::operator bool().
|
static |
Returns true if and only if the shading attribute is currently connected to at least one valid (defined) source.
If you will be calling GetConnectedSources() afterwards anyways, it will be much faster to instead check if the returned vector is empty:
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 546 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 552 of file connectableAPI.h.
USDSHADE_API bool IsContainer | ( | ) | const |
Returns true if the prim is a container.
The underlying prim type may provide runtime behavior that defines whether it is a container.
|
static |
Returns true if the connection to the given shading attribute's source, as returned by UsdShadeConnectableAPI::GetConnectedSource(), is authored across a specializes arc, which is used to denote a base material.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 566 of file connectableAPI.h.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 572 of file connectableAPI.h.
USDSHADE_API bool RequiresEncapsulation | ( | ) | const |
Returns true if container encapsulation rules should be respected when evaluating connectibility behavior, false otherwise.
The underlying prim type may provide runtime behavior that defines if encapsulation rules are respected or not.
|
static |
Authors a list of connections for a given shading attribute shadingAttr
.
shadingAttr
can represent a parameter, an input or an output. sourceInfos
is a vector of structs that describes the upstream source attributes with all the information necessary to make all the connections. See the documentation for UsdShadeConnectionSourceInfo.
true
if all connection were created successfully. false
if the shadingAttr
or one of the sources are invalid.UsdShadeConnectionSourceInfo
, which requires the existence of the upstream source prim. It does not require the existence of the source attribute as it will be create if necessary.
|
friend |
Definition at line 123 of file connectableAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 70 of file connectableAPI.h.