HDK
|
#include <connectableAPI.h>
Static Public Attributes | |
static const UsdSchemaType | schemaType = UsdSchemaType::NonAppliedAPI |
![]() | |
static const UsdSchemaType | schemaType = UsdSchemaType::AbstractBase |
![]() | |
static const UsdSchemaType | schemaType = UsdSchemaType::AbstractBase |
Protected Member Functions | |
USDSHADE_API UsdSchemaType | _GetSchemaType () const override |
USDSHADE_API bool | _IsCompatible () const override |
![]() | |
UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName) | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName) | |
const TfToken & | _GetInstanceName () 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 |
Additional Inherited Members | |
![]() | |
template<typename APISchemaType > | |
static APISchemaType | _ApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName) |
template<typename APISchemaType > | |
static APISchemaType | _MultipleApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName, const TfToken &instanceName) |
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 79 of file connectableAPI.h.
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 91 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 99 of file connectableAPI.h.
|
virtual |
Destructor.
|
inline |
Constructor that takes a UsdShadeShader. Allow implicit (auto) conversion of UsdShadeShader to UsdShadeConnectableAPI, so that a shader can be passed into any function that accepts a ConnectableAPI.
Definition at line 172 of file connectableAPI.h.
|
inline |
Constructor that takes a UsdShadeNodeGraph. Allow implicit (auto) conversion of UsdShadeNodeGraph to UsdShadeConnectableAPI, so that a nodegraph can be passed into any function that accepts a ConnectableAPI.
Definition at line 180 of file connectableAPI.h.
|
overrideprotectedvirtual |
Returns the type 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.
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.
|
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 214 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 221 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 242 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 249 of file connectableAPI.h.
|
static |
Clears source 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 539 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 545 of file connectableAPI.h.
|
static |
Authors a connection for a given shading attribute shadingAttr
.
shadingAttr
can represent a parameter, an input or an output. sourceName
is the name of the shading attribute that is the target of the connection. This excludes any namespace prefix that determines the type of the source (eg, output). sourceType
is used to indicate the type of the shading attribute that is the target of the connection. The source type is used to determine the namespace prefix that must be attached to sourceName
to determine the source full attribute name. typeName
if specified, is the typename of the attribute to create on the source if it doesn't exist. It is also used to validate whether the types of the source and consumer of the connection are compatible. source
is the connectable prim that produces or contains a value for the given shading attribute.
true
if a connection was created successfully. false
if shadingAttr
or source
is invalid.
|
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 290 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 303 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.
|
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 329 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 336 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 given source input.
|
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 351 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 358 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 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 373 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 380 of file connectableAPI.h.
USDSHADE_API UsdShadeInput UsdShadeConnectableAPI::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 UsdShadeConnectableAPI::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.
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 (see for e.g. UsdRelationship::BlockTargets()) 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 518 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 524 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 |
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 415 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 425 of file connectableAPI.h.
USDSHADE_API UsdShadeInput UsdShadeConnectableAPI::GetInput | ( | const TfToken & | name | ) | const |
Return the requested input if it exists.
name
is the unnamespaced base name.
USDSHADE_API std::vector<UsdShadeInput> UsdShadeConnectableAPI::GetInputs | ( | ) | const |
Returns all inputs on the connectable prim (i.e. shader or node-graph). Inputs are represented by attributes in the "inputs:" namespace.
USDSHADE_API UsdShadeOutput UsdShadeConnectableAPI::GetOutput | ( | const TfToken & | name | ) | const |
Return the requested output if it exists.
name
is the unnamespaced base name.
USDSHADE_API std::vector<UsdShadeOutput> UsdShadeConnectableAPI::GetOutputs | ( | ) | const |
Returns all outputs on the connectable prim (i.e. shader or node-graph). Outputs are represented by attributes in the "outputs:" namespace.
|
static |
Returns the "raw" (authored) connected source paths for the given shading attribute.
|
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 442 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 449 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.
|
static |
Returns true if and only if the shading attribute is currently connected to a valid (defined) source.
If you will be calling GetConnectedSource() afterwards anyways, it will be much faster to instead guard like so:
|
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 472 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 478 of file connectableAPI.h.
USDSHADE_API bool UsdShadeConnectableAPI::IsNodeGraph | ( | ) | const |
Returns true if the prim is a node-graph.
USDSHADE_API bool UsdShadeConnectableAPI::IsShader | ( | ) | const |
Returns true if the prim is a shader.
|
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 492 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 498 of file connectableAPI.h.
|
friend |
Definition at line 138 of file connectableAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 85 of file connectableAPI.h.