24 #ifndef PXR_USD_USD_SHADE_OUTPUT_H 25 #define PXR_USD_USD_SHADE_OUTPUT_H 28 #include "pxr/usd/usdShade/api.h" 29 #include "pxr/usd/usdShade/types.h" 30 #include "pxr/usd/usdShade/utils.h" 31 #include "pxr/usd/usd/attribute.h" 36 PXR_NAMESPACE_OPEN_SCOPE
98 return attr.Set(value, time);
168 const std::string &value)
const;
252 using ConnectionModification = UsdShadeConnectionModification;
279 ConnectionModification
const mod =
280 ConnectionModification::Replace)
const;
288 UsdShadeAttributeType
const sourceType=UsdShadeAttributeType::Output,
318 std::vector<UsdShadeConnectionSourceInfo>
const &sourceInfos)
const;
342 SdfPathVector *invalidSourcePaths =
nullptr)
const;
348 UsdShadeAttributeType *sourceType)
const;
410 bool shaderOutputsOnly =
false)
const;
416 explicit operator bool()
const {
429 return !(lhs == rhs);
446 PXR_NAMESPACE_CLOSE_SCOPE
448 #endif // PXR_USD_USD_SHADE_OUTPUT_H UsdAttribute GetAttr() const
Explicit UsdAttribute extractor.
USDSHADE_API SdfValueTypeName GetTypeName() const
Get the "scene description" value type name of the attribute associated with the output.
USDSHADE_API bool ClearSources() const
Clears sources for this Output in the current UsdEditTarget.
This is a small-vector class with local storage optimization, the local storage can be specified via ...
UsdShadeOutput()
Default constructor returns an invalid Output.
USDSHADE_API bool CanConnect(const UsdAttribute &source) const
Determines whether this Output can be connected to the given source attribute, which can be an input ...
USDSHADE_API bool HasConnectedSource() const
Returns true if and only if this Output is currently connected to a valid (defined) source.
Represents a value type name, i.e.
USDSHADE_API bool SetConnectedSources(std::vector< UsdShadeConnectionSourceInfo > const &sourceInfos) const
Connects this Output to the given sources, sourceInfos.
friend bool operator!=(const UsdShadeOutput &lhs, const UsdShadeOutput &rhs)
Inequality comparison.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
static USDSHADE_API bool IsOutput(const UsdAttribute &attr)
Test whether a given UsdAttribute represents a valid Output, which implies that creating a UsdShadeOu...
USDSHADE_API void ClearSdrMetadata() const
Clears any "sdrMetadata" value authored on the Output in the current EditTarget.
Token for efficient comparison, assignment, and hashing of known strings.
TfToken const & GetFullName() const
Get the name of the attribute associated with the output.
USDSHADE_API bool SetRenderType(TfToken const &renderType) const
Specify an alternative, renderer-specific type to use when emitting/translating this output,...
USDSHADE_API std::string GetSdrMetadataByKey(const TfToken &key) const
Returns the value corresponding to key in the composed sdrMetadata dictionary.
bool IsDefined() const
Return true if the wrapped UsdAttribute is defined, and in addition the attribute is identified as an...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and mak...
USDSHADE_API bool ClearSource() const
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
USDSHADE_API NdrTokenMap GetSdrMetadata() const
Returns this Output's composed "sdrMetadata" dictionary as a NdrTokenMap.
USDSHADE_API bool Set(const VtValue &value, UsdTimeCode time=UsdTimeCode::Default()) const
Set a value for the output.
USDSHADE_API void SetSdrMetadataByKey(const TfToken &key, const std::string &value) const
Sets the value corresponding to key to the given string value, in the Output's "sdrMetadata" dictiona...
USDSHADE_API void SetSdrMetadata(const NdrTokenMap &sdrMetadata) const
Authors the given sdrMetadata value on this Output at the current EditTarget.
USDSHADE_API bool GetConnectedSource(UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType) const
A path value used to locate objects in layers or scenegraphs.
USDSHADE_API bool HasSdrMetadata() const
Returns true if the Output has a non-empty composed "sdrMetadata" dictionary value.
USDSHADE_API bool HasRenderType() const
Return true if a renderType has been specified for this output.
UsdPrim GetPrim() const
Get the prim that the output belongs to.
USDSHADE_API TfToken GetRenderType() const
Return this output's specialized renderType, or an empty token if none was authored.
bool Set(const T &value, UsdTimeCode time=UsdTimeCode::Default()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDSHADE_API SourceInfoVector GetConnectedSources(SdfPathVector *invalidSourcePaths=nullptr) const
Finds the valid sources of connections for the Output.
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
const TfToken & GetName() const
Return the full name of this object, i.e.
USDSHADE_API bool HasSdrMetadataByKey(const TfToken &key) const
Returns true if there is a value corresponding to the given key in the composed "sdrMetadata" diction...
USDSHADE_API UsdShadeAttributeVector GetValueProducingAttributes(bool shaderOutputsOnly=false) const
Find what is connected to this Output recursively.
USDSHADE_API bool GetRawConnectedSourcePaths(SdfPathVector *sourcePaths) const
A compact struct to represent a bundle of information about an upstream source attribute.
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
USDSHADE_API TfToken GetBaseName() const
Returns the name of the output.
USDSHADE_API bool DisconnectSource(UsdAttribute const &sourceAttr=UsdAttribute()) const
Disconnect source for this Output.
friend bool operator==(const UsdShadeOutput &lhs, const UsdShadeOutput &rhs)
Equality comparison.
USDSHADE_API void ClearSdrMetadataByKey(const TfToken &key) const
Clears the entry corresponding to the given key in the "sdrMetadata" dictionary authored in the curre...
UsdPrim GetPrim() const
Return this object if it is a prim, otherwise return this object's nearest owning prim.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
USDSHADE_API bool IsSourceConnectionFromBaseMaterial() const
Returns true if the connection to this Output's source, as returned by GetConnectedSource(),...
USDSHADE_API bool ConnectToSource(UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace) const
Authors a connection for this Output.