All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdShadeConnectableAPI Class Reference

UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and making connections between shading parameters and outputs. More...

+ Inheritance diagram for UsdShadeConnectableAPI:

Public Member Functions

 UsdShadeConnectableAPI (const UsdPrim &prim=UsdPrim())
 Construct a UsdShadeConnectableAPI on UsdPrim prim . More...
 
 UsdShadeConnectableAPI (const UsdSchemaBase &schemaObj)
 Construct a UsdShadeConnectableAPI on the prim held by schemaObj . More...
 
virtual USDSHADE_API ~UsdShadeConnectableAPI ()
 Destructor. More...
 
 UsdShadeConnectableAPI (const UsdShadeShader &shader)
 Constructor that takes a UsdShadeShader. More...
 
 UsdShadeConnectableAPI (const UsdShadeNodeGraph &nodeGraph)
 Constructor that takes a UsdShadeNodeGraph. More...
 
USDSHADE_API bool IsShader () const
 Returns true if the prim is a shader. More...
 
USDSHADE_API bool IsNodeGraph () const
 Returns true if the prim is a node-graph. More...
 
Outputs
USDSHADE_API UsdShadeOutput CreateOutput (const TfToken &name, const SdfValueTypeName &typeName) const
 Create an output, which represents and externally computed, typed value. More...
 
USDSHADE_API UsdShadeOutput GetOutput (const TfToken &name) const
 Return the requested output if it exists. More...
 
USDSHADE_API std::vector
< UsdShadeOutput
GetOutputs () const
 Returns all outputs on the connectable prim (i.e. More...
 
Inputs
USDSHADE_API UsdShadeInput CreateInput (const TfToken &name, const SdfValueTypeName &typeName) const
 Create an input which can both have a value and be connected. More...
 
USDSHADE_API UsdShadeInput GetInput (const TfToken &name) const
 Return the requested input if it exists. More...
 
USDSHADE_API std::vector
< UsdShadeInput
GetInputs () const
 Returns all inputs on the connectable prim (i.e. More...
 
- Public Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim=UsdPrim())
 Construct a UsdAPISchemaBase on UsdPrim prim . More...
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj)
 Construct a UsdAPISchemaBase on the prim held by schemaObj . More...
 
virtual USD_API ~UsdAPISchemaBase ()=0
 Destructor. More...
 
- 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. More...
 
bool IsTyped () const
 Returns whether or not this class inherits from UsdTyped. More...
 
bool IsAPISchema () const
 Returns whether this is an API schema or not. More...
 
bool IsAppliedAPISchema () const
 Returns whether this is an applied API schema or not. More...
 
bool IsMultipleApplyAPISchema () const
 Returns whether this is an applied API schema or not. More...
 
UsdSchemaType GetSchemaType () const
 
USD_API UsdSchemaBase (const UsdPrim &prim=UsdPrim())
 Construct and store prim as the held prim. More...
 
USD_API UsdSchemaBase (const UsdSchemaBase &otherSchema)
 Construct and store for the same prim held by otherSchema. More...
 
virtual USD_API ~UsdSchemaBase ()
 Destructor. More...
 
USD_API operator bool () const
 Return true if this schema object is compatible with its held prim, false otherwise. More...
 
UsdPrim GetPrim () const
 Return this schema object's held prim. More...
 
SdfPath GetPath () const
 Shorthand for GetPrim()->GetPath(). More...
 
USD_API const UsdPrimDefinitionGetSchemaClassPrimDefinition () const
 Return the prim definition associated with this schema instance if one exists, otherwise return null. More...
 

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. More...
 
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. More...
 
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.

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. More...
 
static USDSHADE_API bool CanConnect (const UsdShadeInput &input, const UsdShadeInput &sourceInput)
 
static USDSHADE_API bool CanConnect (const UsdShadeInput &input, const UsdShadeOutput &sourceOutput)
 
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. More...
 
static USDSHADE_API bool CanConnect (const UsdShadeOutput &output, const UsdShadeInput &sourceInput)
 
static USDSHADE_API bool CanConnect (const UsdShadeOutput &output, const UsdShadeOutput &sourceOutput)
 
static USDSHADE_API bool ConnectToSource (UsdAttribute const &shadingAttr, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
 Authors a connection for a given shading attribute shadingAttr. More...
 
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. More...
 
static USDSHADE_API bool ConnectToSource (UsdShadeInput const &input, SdfPath const &sourcePath)
 
static USDSHADE_API bool ConnectToSource (UsdShadeOutput const &output, SdfPath const &sourcePath)
 
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. More...
 
static USDSHADE_API bool ConnectToSource (UsdShadeInput const &input, UsdShadeInput const &sourceInput)
 
static USDSHADE_API bool ConnectToSource (UsdShadeOutput const &output, UsdShadeInput const &sourceInput)
 
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. More...
 
static USDSHADE_API bool ConnectToSource (UsdShadeInput const &input, UsdShadeOutput const &sourceOutput)
 
static USDSHADE_API bool ConnectToSource (UsdShadeOutput const &output, UsdShadeOutput const &sourceOutput)
 
static USDSHADE_API bool GetConnectedSource (UsdAttribute const &shadingAttr, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
 Finds the source of a connection for the given shading attribute. More...
 
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 bool GetRawConnectedSourcePaths (UsdAttribute const &shadingAttr, SdfPathVector *sourcePaths)
 Returns the "raw" (authored) connected source paths for the given shading attribute. More...
 
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 a valid (defined) source. More...
 
static USDSHADE_API bool HasConnectedSource (const UsdShadeInput &input)
 
static USDSHADE_API bool HasConnectedSource (const UsdShadeOutput &output)
 
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. More...
 
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial (const UsdShadeInput &input)
 
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial (const UsdShadeOutput &output)
 
static USDSHADE_API bool DisconnectSource (UsdAttribute const &shadingAttr)
 Disconnect source for this shading attribute. More...
 
static USDSHADE_API bool DisconnectSource (UsdShadeInput const &input)
 
static USDSHADE_API bool DisconnectSource (UsdShadeOutput const &output)
 
static USDSHADE_API bool ClearSource (UsdAttribute const &shadingAttr)
 Clears source for this shading attribute in the current UsdEditTarget. More...
 
static USDSHADE_API bool ClearSource (UsdShadeInput const &input)
 
static USDSHADE_API bool ClearSource (UsdShadeOutput const &output)
 
- 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. More...
 
- Static Public Member Functions inherited from UsdSchemaBase
static const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 

Static Public Attributes

static const UsdSchemaType schemaType = UsdSchemaType::NonAppliedAPI
 Compile time constant representing what kind of schema this class is. More...
 
- Static Public Attributes inherited from UsdAPISchemaBase
static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 
- Static Public Attributes inherited from UsdSchemaBase
static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 

Protected Member Functions

USDSHADE_API UsdSchemaType _GetSchemaType () const override
 Returns the type of schema this class belongs to. More...
 
USDSHADE_API bool _IsCompatible () const override
 Returns true if the given prim is compatible with this API schema, i.e. More...
 
- Protected Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName)
 Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName. More...
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName)
 Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName. More...
 
const TfToken_GetInstanceName () const
 Returns the instance name of the API schema object belonging to a multiple-apply API schema. More...
 
- Protected Member Functions inherited from UsdSchemaBase
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

- Static Protected Member Functions inherited from UsdAPISchemaBase
template<typename APISchemaType >
static APISchemaType _ApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName)
 Helper method to apply a single-apply API schema with the given schema name apiSchemaName' and C++ type 'APISchemaType'. More...
 
template<typename APISchemaType >
static APISchemaType _MultipleApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName, const TfToken &instanceName)
 Helper method to apply a multiple-apply API schema with the given schema name apiSchemaName', C++ type 'APISchemaType' and instance name instanceName. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

UsdShadeConnectableAPI ( const UsdPrim prim = UsdPrim())
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 91 of file connectableAPI.h.

UsdShadeConnectableAPI ( const UsdSchemaBase schemaObj)
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 USDSHADE_API ~UsdShadeConnectableAPI ( )
virtual

Destructor.

UsdShadeConnectableAPI ( const UsdShadeShader shader)
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.

UsdShadeConnectableAPI ( const UsdShadeNodeGraph nodeGraph)
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.

Member Function Documentation

USDSHADE_API UsdSchemaType _GetSchemaType ( ) const
overrideprotectedvirtual

Returns the type of schema this class belongs to.

See Also
UsdSchemaType

Reimplemented from UsdAPISchemaBase.

USDSHADE_API bool _IsCompatible ( ) const
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 USDSHADE_API bool CanConnect ( const UsdShadeInput input,
const UsdAttribute source 
)
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.

See Also
UsdShadeInput::SetConnectability
UsdShadeInput::GetConnectability
static USDSHADE_API bool CanConnect ( const UsdShadeInput input,
const UsdShadeInput sourceInput 
)
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 215 of file connectableAPI.h.

static USDSHADE_API bool CanConnect ( const UsdShadeInput input,
const UsdShadeOutput sourceOutput 
)
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 222 of file connectableAPI.h.

static USDSHADE_API bool CanConnect ( const UsdShadeOutput output,
const UsdAttribute source = UsdAttribute() 
)
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.

static USDSHADE_API bool CanConnect ( const UsdShadeOutput output,
const UsdShadeInput sourceInput 
)
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 243 of file connectableAPI.h.

static USDSHADE_API bool CanConnect ( const UsdShadeOutput output,
const UsdShadeOutput sourceOutput 
)
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 250 of file connectableAPI.h.

static USDSHADE_API bool ClearSource ( UsdAttribute const &  shadingAttr)
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.

See Also
DisconnectSource()
static USDSHADE_API bool ClearSource ( UsdShadeInput const &  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 539 of file connectableAPI.h.

static USDSHADE_API bool ClearSource ( UsdShadeOutput const &  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 545 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdAttribute const &  shadingAttr,
UsdShadeConnectableAPI const &  source,
TfToken const &  sourceName,
UsdShadeAttributeType const  sourceType = UsdShadeAttributeType::Output,
SdfValueTypeName  typeName = SdfValueTypeName() 
)
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.

Returns
true if a connection was created successfully. false if shadingAttr or source is invalid.
Note
This method does not verify the connectability of the shading attribute to the source. Clients must invoke CanConnect() themselves to ensure compatibility.
The source shading attribute is created if it doesn't exist already.
static USDSHADE_API bool ConnectToSource ( UsdShadeInput const &  input,
UsdShadeConnectableAPI const &  source,
TfToken const &  sourceName,
UsdShadeAttributeType const  sourceType = UsdShadeAttributeType::Output,
SdfValueTypeName  typeName = SdfValueTypeName() 
)
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 291 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdShadeOutput const &  output,
UsdShadeConnectableAPI const &  source,
TfToken const &  sourceName,
UsdShadeAttributeType const  sourceType = UsdShadeAttributeType::Output,
SdfValueTypeName  typeName = SdfValueTypeName() 
)
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 304 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdAttribute const &  shadingAttr,
SdfPath const &  sourcePath 
)
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 USDSHADE_API bool ConnectToSource ( UsdShadeInput const &  input,
SdfPath const &  sourcePath 
)
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 330 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdShadeOutput const &  output,
SdfPath const &  sourcePath 
)
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 337 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdAttribute const &  shadingAttr,
UsdShadeInput const &  sourceInput 
)
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 USDSHADE_API bool ConnectToSource ( UsdShadeInput const &  input,
UsdShadeInput const &  sourceInput 
)
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 352 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdShadeOutput const &  output,
UsdShadeInput const &  sourceInput 
)
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 359 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdAttribute const &  shadingAttr,
UsdShadeOutput const &  sourceOutput 
)
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.

static USDSHADE_API bool ConnectToSource ( UsdShadeInput const &  input,
UsdShadeOutput const &  sourceOutput 
)
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 374 of file connectableAPI.h.

static USDSHADE_API bool ConnectToSource ( UsdShadeOutput const &  output,
UsdShadeOutput const &  sourceOutput 
)
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 381 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 USDSHADE_API bool DisconnectSource ( UsdAttribute const &  shadingAttr)
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 in the current UsdEditTarget.

See Also
ConnectToSource().
static USDSHADE_API bool DisconnectSource ( UsdShadeInput const &  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 518 of file connectableAPI.h.

static USDSHADE_API bool DisconnectSource ( UsdShadeOutput const &  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 524 of file connectableAPI.h.

static USDSHADE_API UsdShadeConnectableAPI Get ( const UsdStagePtr &  stage,
const SdfPath path 
)
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:

* UsdShadeConnectableAPI(stage->GetPrimAtPath(path));
*
static USDSHADE_API bool GetConnectedSource ( UsdAttribute const &  shadingAttr,
UsdShadeConnectableAPI source,
TfToken sourceName,
UsdShadeAttributeType *  sourceType 
)
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

Returns
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.
Note
The python wrapping for this method returns a (source, sourceName, sourceType) tuple if the parameter is connected, else None
static USDSHADE_API bool GetConnectedSource ( UsdShadeInput const &  input,
UsdShadeConnectableAPI source,
TfToken sourceName,
UsdShadeAttributeType *  sourceType 
)
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 416 of file connectableAPI.h.

static USDSHADE_API bool GetConnectedSource ( UsdShadeOutput const &  output,
UsdShadeConnectableAPI source,
TfToken sourceName,
UsdShadeAttributeType *  sourceType 
)
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 426 of file connectableAPI.h.

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 ( ) 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 GetOutput ( const TfToken name) const

Return the requested output if it exists.

name is the unnamespaced base name.

USDSHADE_API std::vector<UsdShadeOutput> 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 USDSHADE_API bool GetRawConnectedSourcePaths ( UsdAttribute const &  shadingAttr,
SdfPathVector *  sourcePaths 
)
static

Returns the "raw" (authored) connected source paths for the given shading attribute.

static USDSHADE_API bool GetRawConnectedSourcePaths ( UsdShadeInput const &  input,
SdfPathVector *  sourcePaths 
)
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 443 of file connectableAPI.h.

static USDSHADE_API bool GetRawConnectedSourcePaths ( UsdShadeOutput const &  output,
SdfPathVector *  sourcePaths 
)
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 450 of file connectableAPI.h.

static USDSHADE_API const TfTokenVector& GetSchemaAttributeNames ( bool  includeInherited = true)
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 USDSHADE_API bool HasConnectedSource ( const UsdAttribute shadingAttr)
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:

* &sourceName, &sourceType)){
* // process connected attribute
* } else {
* // process unconnected attribute
* }
*
static USDSHADE_API bool HasConnectedSource ( const UsdShadeInput 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 473 of file connectableAPI.h.

static USDSHADE_API bool HasConnectedSource ( const UsdShadeOutput 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 479 of file connectableAPI.h.

USDSHADE_API bool IsNodeGraph ( ) const

Returns true if the prim is a node-graph.

USDSHADE_API bool IsShader ( ) const

Returns true if the prim is a shader.

static USDSHADE_API bool IsSourceConnectionFromBaseMaterial ( const UsdAttribute shadingAttr)
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.

static USDSHADE_API bool IsSourceConnectionFromBaseMaterial ( const UsdShadeInput 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 493 of file connectableAPI.h.

static USDSHADE_API bool IsSourceConnectionFromBaseMaterial ( const UsdShadeOutput 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 499 of file connectableAPI.h.

Member Data Documentation

const UsdSchemaType schemaType = UsdSchemaType::NonAppliedAPI
static

Compile time constant representing what kind of schema this class is.

See Also
UsdSchemaType

Definition at line 85 of file connectableAPI.h.


The documentation for this class was generated from the following file: