7#ifndef USDSHADE_GENERATED_CONNECTABLEAPI_H
8#define USDSHADE_GENERATED_CONNECTABLEAPI_H
13#include "pxr/usd/usdShade/api.h"
19#include "pxr/usd/usdShade/input.h"
20#include "pxr/usd/usdShade/output.h"
22#include "pxr/usd/usdShade/types.h"
24#include "pxr/base/vt/value.h"
31#include "pxr/base/tf/type.h"
33PXR_NAMESPACE_OPEN_SCOPE
125 static const TfType &_GetStaticTfType();
127 static bool _IsTypedSchema();
131 const TfType &_GetTfType()
const override;
232 using ConnectionModification = UsdShadeConnectionModification;
259 ConnectionModification
const mod = ConnectionModification::Replace);
266 ConnectionModification
const mod = ConnectionModification::Replace)
276 ConnectionModification
const mod = ConnectionModification::Replace)
289 UsdShadeAttributeType
const sourceType=UsdShadeAttributeType::Output,
299 UsdShadeAttributeType
const sourceType=UsdShadeAttributeType::Output,
313 UsdShadeAttributeType
const sourceType=UsdShadeAttributeType::Output,
410 std::vector<UsdShadeConnectionSourceInfo>
const &sourceInfos);
444 UsdShadeAttributeType *sourceType);
452 UsdShadeAttributeType *sourceType) {
463 UsdShadeAttributeType *sourceType) {
487 SdfPathVector *invalidSourcePaths =
nullptr);
493 SdfPathVector *invalidSourcePaths =
nullptr);
499 SdfPathVector *invalidSourcePaths =
nullptr);
508 SdfPathVector *sourcePaths);
514 SdfPathVector *sourcePaths) {
522 SdfPathVector *sourcePaths) {
662 template <
typename T>
665 static_assert(std::is_base_of<UsdSchemaBase, T>::value,
666 "Provided type must derive UsdSchemaBase.");
700 bool onlyAuthored=
true)
const;
729 bool onlyAuthored=
true)
const;
749 UsdShadeAttributeType
sourceType = UsdShadeAttributeType::Invalid;
758 UsdShadeAttributeType sourceType_,
769 ,
typeName(input.GetAttr().GetTypeName())
772 :
source(output.GetPrim())
775 ,
typeName(output.GetAttr().GetTypeName())
783 UsdStagePtr
const& stage,
793 return (
sourceType != UsdShadeAttributeType::Invalid) &&
797 explicit operator bool()
const {
807 return !(*
this == other);
811PXR_NAMESPACE_CLOSE_SCOPE
Contains an asset path and an optional resolved path.
A path value used to locate objects in layers or scenegraphs.
Represents a value type name, i.e.
This is a small-vector class with local storage optimization, the local storage can be specified via ...
Token for efficient comparison, assignment, and hashing of known strings.
bool IsEmpty() const
Returns true iff this token contains the empty string "".
TfType represents a dynamic runtime type.
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
The base class for all schema types in Usd.
UsdPrim GetPrim() const
Return this schema object's held prim.
Singleton registry that provides access to schema type information and the prim definitions for regis...
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and mak...
virtual USDSHADE_API ~UsdShadeConnectableAPI()
Destructor.
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 o...
static USDSHADE_API bool ClearSource(UsdAttribute const &shadingAttr)
static USDSHADE_API bool ClearSources(UsdAttribute const &shadingAttr)
Clears sources for this shading attribute in the current UsdEditTarget.
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(UsdShadeInput const &input, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdAttribute &source)
Determines whether the given input can be connected to the given source 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 o...
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 o...
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 o...
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
USDSHADE_API UsdShadeOutput CreateOutput(const TfToken &name, const SdfValueTypeName &typeName) const
Create an output, which represents and externally computed, typed value.
static USDSHADE_API bool HasConnectedSource(const UsdShadeOutput &output)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool GetConnectedSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
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.
USDSHADE_API bool _IsCompatible() const override
Returns true if the given prim is compatible with this API schema, i.e.
static USDSHADE_API bool ClearSources(UsdShadeOutput const &output)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr, SdfPathVector *sourcePaths)
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 o...
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeInput &input)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeOutput const &output, SdfPathVector *sourcePaths)
USDSHADE_API UsdShadeInput GetInput(const TfToken &name) const
Return the requested input if it exists.
UsdShadeConnectableAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdShadeConnectableAPI on UsdPrim prim .
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 o...
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 CanConnect(const UsdShadeInput &input, const UsdShadeOutput &sourceOutput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool DisconnectSource(UsdAttribute const &shadingAttr, UsdAttribute const &sourceAttr=UsdAttribute())
Disconnect source for this shading attribute.
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 o...
static USDSHADE_API bool HasConnectedSource(const UsdShadeInput &input)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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,...
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 o...
USDSHADE_API UsdShadeInput CreateInput(const TfToken &name, const SdfValueTypeName &typeName) const
Create an input which can both have a value and be connected.
static USDSHADE_API bool ClearSource(UsdShadeOutput const &output)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdAttribute &shadingAttr)
Returns true if the connection to the given shading attribute's source, as returned by UsdShadeConnec...
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeInput const &input, SdfPathVector *sourcePaths)
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
USDSHADE_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDSHADE_API bool GetConnectedSource(UsdShadeOutput const &output, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeOutput &output)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDSHADE_API bool RequiresEncapsulation() const
Returns true if container encapsulation rules should be respected when evaluating connectibility beha...
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 o...
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(UsdAttribute const &shadingAttr, SdfPath const &sourcePath)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 o...
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 (defin...
UsdShadeConnectableAPI(const UsdSchemaBase &schemaObj)
Construct a UsdShadeConnectableAPI on the prim held by schemaObj .
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 o...
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 o...
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 o...
USDSHADE_API UsdShadeOutput GetOutput(const TfToken &name) const
Return the requested output if it exists.
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 o...
static USDSHADE_API bool ClearSource(UsdShadeInput const &input)
USDSHADE_API std::vector< UsdShadeInput > GetInputs(bool onlyAuthored=true) const
Returns all inputs on the connectable prim (i.e.
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 o...
USDSHADE_API std::vector< UsdShadeOutput > GetOutputs(bool onlyAuthored=true) const
Returns all outputs on the connectable prim (i.e.
static USDSHADE_API bool HasConnectableAPI(const TfType &schemaType)
Return true if the schemaType has a valid connectableAPIBehavior registered, false otherwise.
static USDSHADE_API bool ClearSources(UsdShadeInput const &input)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDSHADE_API bool IsContainer() const
Returns true if the prim is a container.
static bool HasConnectableAPI()
Return true if the schema type T has a connectableAPIBehavior registered, false otherwise.
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 o...
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 o...
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
const UsdAttribute & GetAttr() const
Explicit UsdAttribute extractor.
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
A compact struct to represent a bundle of information about an upstream source attribute.
SdfValueTypeName typeName
typeName, if specified, is the typename of the attribute to create on the source if it doesn't exist ...
UsdShadeAttributeType sourceType
sourceType is used to indicate the type of the shading attribute that is the target of the connection...
TfToken sourceName
sourceName is the name of the shading attribute that is the target of the connection.
USDSHADE_API UsdShadeConnectionSourceInfo(UsdStagePtr const &stage, SdfPath const &sourcePath)
Construct the information for this struct from a property path.
bool IsValid() const
Return true if this source info is valid for setting up a connection.
UsdShadeConnectableAPI source
source is the connectable prim that produces or contains a value for the given shading attribute.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.