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

#include <shaderProperty.h>

+ Inheritance diagram for SdrShaderProperty:

Public Member Functions

SDR_API SdrShaderProperty (const TfToken &name, const TfToken &type, const VtValue &defaultValue, bool isOutput, size_t arraySize, const SdrTokenMap &metadata, const SdrTokenMap &hints, const SdrOptionVec &options)
 
Metadata

The metadata returned here is a direct result of what the parser plugin is able to determine about the property. See the documentation for a specific parser plugin to get help on what the parser is looking for to populate these values.

SDR_API const TfTokenGetLabel () const
 
SDR_API std::string GetHelp () const
 The help message assigned to this property, if any. More...
 
SDR_API const TfTokenGetPage () const
 
SDR_API const TfTokenGetWidget () const
 
SDR_API const SdrTokenMapGetHints () const
 
SDR_API const SdrOptionVecGetOptions () const
 
SDR_API std::string GetImplementationName () const
 
VStruct Information
SDR_API const TfTokenGetVStructMemberOf () const
 If this field is part of a vstruct, this is the name of the struct. More...
 
SDR_API const TfTokenGetVStructMemberName () const
 If this field is part of a vstruct, this is its name in the struct. More...
 
SDR_API bool IsVStructMember () const
 Returns true if this field is part of a vstruct. More...
 
SDR_API bool IsVStruct () const
 Returns true if the field is the head of a vstruct. More...
 
SDR_API const TfTokenGetVStructConditionalExpr () const
 If this field is part of a vstruct, this is the conditional expression. More...
 
Connection Information
SDR_API bool IsConnectable () const override
 
SDR_API const SdrTokenVecGetValidConnectionTypes () const
 
SDR_API bool CanConnectTo (const NdrProperty &other) const override
 
SDR_API bool CanConnectTo (const SdrShaderProperty &other) const
 Determines if this property can be connected to the specified property. More...
 
Utilities
SDR_API SdrSdfTypeIndicator GetTypeAsSdfType () const override
 
SDR_API const VtValueGetDefaultValueAsSdfType () const override
 
SDR_API bool IsAssetIdentifier () const
 
SDR_API bool IsDefaultInput () const
 
- Public Member Functions inherited from NdrProperty
NDR_API NdrProperty (const TfToken &name, const TfToken &type, const VtValue &defaultValue, bool isOutput, size_t arraySize, bool isDynamicArray, const NdrTokenMap &metadata)
 Constructor. More...
 
virtual NDR_API ~NdrProperty ()
 Destructor. More...
 
NDR_API const TfTokenGetName () const
 Gets the name of the property. More...
 
NDR_API const TfTokenGetType () const
 Gets the type of the property. More...
 
NDR_API const VtValueGetDefaultValue () const
 
NDR_API bool IsOutput () const
 Whether this property is an output. More...
 
NDR_API bool IsArray () const
 Whether this property's type is an array type. More...
 
NDR_API bool IsDynamicArray () const
 Whether this property's array type is dynamically-sized. More...
 
NDR_API int GetArraySize () const
 
virtual NDR_API std::string GetInfoString () const
 
virtual NDR_API const NdrTokenMapGetMetadata () const
 All of the metadata that came from the parse process. More...
 

Protected Member Functions

SdrShaderPropertyoperator= (const SdrShaderProperty &)=delete
 
void _SetUsdEncodingVersion (int usdEncodingVersion)
 
void _ConvertToVStruct ()
 
void _FinalizeProperty ()
 
- Protected Member Functions inherited from NdrProperty
NdrPropertyoperator= (const NdrProperty &)=delete
 

Protected Attributes

const SdrTokenMap _hints
 
const SdrOptionVec _options
 
SdrTokenVec _validConnectionTypes
 
TfToken _label
 
TfToken _page
 
TfToken _widget
 
TfToken _vstructMemberOf
 
TfToken _vstructMemberName
 
TfToken _vstructConditionalExpr
 
VtValue _sdfTypeDefaultValue
 
int _usdEncodingVersion
 
- Protected Attributes inherited from NdrProperty
TfToken _name
 
TfToken _type
 
VtValue _defaultValue
 
bool _isOutput
 
size_t _arraySize
 
bool _isDynamicArray
 
bool _isConnectable
 
NdrTokenMap _metadata
 

Friends

void SdrShaderNode::_PostProcessProperties ()
 

Detailed Description

Represents a property (input or output) that is part of a SdrShaderNode instance.

A property must have a name and type, but may also specify a host of additional metadata. Instances can also be queried to determine if another SdrShaderProperty instance can be connected to it.

Definition at line 98 of file shaderProperty.h.

Constructor & Destructor Documentation

SDR_API SdrShaderProperty::SdrShaderProperty ( const TfToken name,
const TfToken type,
const VtValue defaultValue,
bool  isOutput,
size_t  arraySize,
const SdrTokenMap metadata,
const SdrTokenMap hints,
const SdrOptionVec options 
)

Member Function Documentation

void SdrShaderProperty::_ConvertToVStruct ( )
protected
void SdrShaderProperty::_FinalizeProperty ( )
protected
void SdrShaderProperty::_SetUsdEncodingVersion ( int  usdEncodingVersion)
protected
SDR_API bool SdrShaderProperty::CanConnectTo ( const NdrProperty other) const
overridevirtual

Determines if this property can be connected to the specified property.

Deprecated:
Deprecated in favor of SdrShaderProperty::CanConnectTo(SdrShaderProperty)

Reimplemented from NdrProperty.

SDR_API bool SdrShaderProperty::CanConnectTo ( const SdrShaderProperty other) const

Determines if this property can be connected to the specified property.

SDR_API const VtValue& SdrShaderProperty::GetDefaultValueAsSdfType ( ) const
inlineoverridevirtual

Accessor for default value corresponding to the SdfValueTypeName returned by GetTypeAsSdfType. Note that this is different than GetDefaultValue which returns the default value associated with the SdrPropertyType and may differ from the SdfValueTypeName, example when sdrUsdDefinitionType metadata is specified for a sdr property.

See Also
GetTypeAsSdfType

Reimplemented from NdrProperty.

Definition at line 257 of file shaderProperty.h.

SDR_API std::string SdrShaderProperty::GetHelp ( ) const

The help message assigned to this property, if any.

SDR_API const SdrTokenMap& SdrShaderProperty::GetHints ( ) const
inline

Any UI "hints" that are associated with this property. "Hints" are simple key/value pairs.

Definition at line 146 of file shaderProperty.h.

SDR_API std::string SdrShaderProperty::GetImplementationName ( ) const

Returns the implementation name of this property. The name of the property is how to refer to the property in shader networks. The label is how to present this property to users. The implementation name is the name of the parameter this property represents in the implementation. Any client using the implementation must call this method to get the correct name; using getName() is not correct.

SDR_API const TfToken& SdrShaderProperty::GetLabel ( ) const
inline

The label assigned to this property, if any. Distinct from the name returned from GetName(). In the context of a UI, the label value might be used as the display name for the property instead of the name.

Definition at line 125 of file shaderProperty.h.

SDR_API const SdrOptionVec& SdrShaderProperty::GetOptions ( ) const
inline

If the property has a set of valid values that are pre-determined, this will return the valid option names and corresponding string values (if the option was specified with a value).

Definition at line 152 of file shaderProperty.h.

SDR_API const TfToken& SdrShaderProperty::GetPage ( ) const
inline

The page (group), eg "Advanced", this property appears on, if any. Note that the page for a shader property can be nested, delimited by ":", representing the hierarchy of sub-pages a property is defined in.

Definition at line 135 of file shaderProperty.h.

SDR_API SdrSdfTypeIndicator SdrShaderProperty::GetTypeAsSdfType ( ) const
overridevirtual

Converts the property's type from GetType() into a SdrSdfTypeIndicator.

Two scenarios can result: an exact mapping from property type to Sdf type, and an inexact mapping. In the first scenario, SdrSdfTypeIndicator will contain a cleanly-mapped Sdf type. In the second scenario, the SdrSdfTypeIndicator will contain an Sdf type set to Token to indicate an unclean mapping, and SdrSdfTypeIndicator::GetSdrType will be set to the original type returned by GetType().

Reimplemented from NdrProperty.

SDR_API const SdrTokenVec& SdrShaderProperty::GetValidConnectionTypes ( ) const
inline

Gets the list of valid connection types for this property. This value comes from shader metadata, and may not be specified. The value from SdrShaderProperty::GetType() can be used as a fallback, or you can use the connectability test in CanConnectTo().

Definition at line 214 of file shaderProperty.h.

SDR_API const TfToken& SdrShaderProperty::GetVStructConditionalExpr ( ) const
inline

If this field is part of a vstruct, this is the conditional expression.

Definition at line 193 of file shaderProperty.h.

SDR_API const TfToken& SdrShaderProperty::GetVStructMemberName ( ) const
inline

If this field is part of a vstruct, this is its name in the struct.

Definition at line 178 of file shaderProperty.h.

SDR_API const TfToken& SdrShaderProperty::GetVStructMemberOf ( ) const
inline

If this field is part of a vstruct, this is the name of the struct.

Definition at line 172 of file shaderProperty.h.

SDR_API const TfToken& SdrShaderProperty::GetWidget ( ) const
inline

The widget "hint" that indicates the widget that can best display the type of data contained in this property, if any. Examples of this value could include "number", "slider", etc.

Definition at line 141 of file shaderProperty.h.

SDR_API bool SdrShaderProperty::IsAssetIdentifier ( ) const

Determines if the value held by this property is an asset identifier (eg, a file path); the logic for this is left up to the parser.

Note: The type returned from GetTypeAsSdfType() will be Asset if this method returns true (even though its true underlying data type is string).

SDR_API bool SdrShaderProperty::IsConnectable ( ) const
inlineoverridevirtual

Whether this property can be connected to other properties. If this returns true, connectability to a specific property can be tested via CanConnectTo().

Reimplemented from NdrProperty.

Definition at line 207 of file shaderProperty.h.

SDR_API bool SdrShaderProperty::IsDefaultInput ( ) const

Determines if the value held by this property is the default input for this node.

SDR_API bool SdrShaderProperty::IsVStruct ( ) const

Returns true if the field is the head of a vstruct.

SDR_API bool SdrShaderProperty::IsVStructMember ( ) const

Returns true if this field is part of a vstruct.

SdrShaderProperty& SdrShaderProperty::operator= ( const SdrShaderProperty )
protecteddelete

Friends And Related Function Documentation

void SdrShaderNode::_PostProcessProperties ( )
friend

Member Data Documentation

const SdrTokenMap SdrShaderProperty::_hints
protected

Definition at line 301 of file shaderProperty.h.

TfToken SdrShaderProperty::_label
protected

Definition at line 306 of file shaderProperty.h.

const SdrOptionVec SdrShaderProperty::_options
protected

Definition at line 302 of file shaderProperty.h.

TfToken SdrShaderProperty::_page
protected

Definition at line 307 of file shaderProperty.h.

VtValue SdrShaderProperty::_sdfTypeDefaultValue
protected

Definition at line 313 of file shaderProperty.h.

int SdrShaderProperty::_usdEncodingVersion
protected

Definition at line 317 of file shaderProperty.h.

SdrTokenVec SdrShaderProperty::_validConnectionTypes
protected

Definition at line 305 of file shaderProperty.h.

TfToken SdrShaderProperty::_vstructConditionalExpr
protected

Definition at line 311 of file shaderProperty.h.

TfToken SdrShaderProperty::_vstructMemberName
protected

Definition at line 310 of file shaderProperty.h.

TfToken SdrShaderProperty::_vstructMemberOf
protected

Definition at line 309 of file shaderProperty.h.

TfToken SdrShaderProperty::_widget
protected

Definition at line 308 of file shaderProperty.h.


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