25 #ifndef PXR_USD_SDR_SHADER_PROPERTY_H 26 #define PXR_USD_SDR_SHADER_PROPERTY_H 31 #include "pxr/usd/sdr/api.h" 35 #include "pxr/base/vt/value.h" 39 PXR_NAMESPACE_OPEN_SCOPE
43 #define SDR_PROPERTY_TYPE_TOKENS \ 45 ((String, "string")) \ 48 ((Color4, "color4")) \ 50 ((Normal, "normal")) \ 51 ((Vector, "vector")) \ 52 ((Matrix, "matrix")) \ 53 ((Struct, "struct")) \ 54 ((Terminal, "terminal")) \ 55 ((Vstruct, "vstruct")) \ 56 ((Unknown, "unknown")) 61 #define SDR_PROPERTY_METADATA_TOKENS \ 65 ((RenderType, "renderType")) \ 67 ((Widget, "widget")) \ 69 ((Options, "options")) \ 70 ((IsDynamicArray, "isDynamicArray")) \ 71 ((Connectable, "connectable")) \ 73 ((ValidConnectionTypes, "validConnectionTypes")) \ 74 ((VstructMemberOf, "vstructMemberOf")) \ 75 ((VstructMemberName, "vstructMemberName")) \ 76 ((VstructConditionalExpr, "vstructConditionalExpr"))\ 77 ((IsAssetIdentifier, "__SDR__isAssetIdentifier"))\ 78 ((ImplementationName, "__SDR__implementationName"))\ 79 ((SdrUsdDefinitionType, "sdrUsdDefinitionType"))\ 80 ((DefaultInput, "__SDR__defaultinput")) \ 81 ((Target, "__SDR__target")) \ 82 ((Colorspace, "__SDR__colorspace")) 86 #define SDR_PROPERTY_ROLE_TOKENS \ 89 #define SDR_PROPERTY_TOKENS \ 90 ((PageDelimiter, ":")) 94 SDR_PROPERTY_METADATA_TOKENS);
96 SDR_PROPERTY_ROLE_TOKENS);
114 const NdrTokenMap& metadata,
115 const NdrTokenMap& hints,
116 const NdrOptionVec& options
151 const NdrTokenMap&
GetHints()
const {
return _hints; }
178 return _vstructMemberOf;
184 return _vstructMemberName;
199 return _vstructConditionalExpr;
220 return _validConnectionTypes;
255 return _sdfTypeDefaultValue;
280 friend void SdrShaderNode::_PostProcessProperties();
285 void _SetUsdEncodingVersion(
int usdEncodingVersion);
289 void _ConvertToVStruct();
294 void _FinalizeProperty();
298 const NdrTokenMap _hints;
299 const NdrOptionVec _options;
302 NdrTokenVec _validConnectionTypes;
308 TfToken _vstructConditionalExpr;
314 int _usdEncodingVersion;
317 PXR_NAMESPACE_CLOSE_SCOPE
319 #endif // PXR_USD_SDR_SHADER_PROPERTY_H SDR_API const NdrTokenVec & GetValidConnectionTypes() const
Gets the list of valid connection types for this property.
SDR_API const TfToken & GetVStructMemberOf() const
If this field is part of a vstruct, this is the name of the struct.
SDR_API bool IsVStructMember() const
Returns true if this field is part of a vstruct.
SDR_API bool IsVStruct() const
Returns true if the field is the head of a vstruct.
SDR_API const TfToken & GetLabel() const
The label assigned to this property, if any.
SDR_API std::string GetHelp() const
The help message assigned to this property, if any.
A specialized version of NdrProperty which holds shading information.
SDR_API const TfToken & GetWidget() const
The widget "hint" that indicates the widget that can best display the type of data contained in this ...
SDR_API const TfToken & GetPage() const
The page (group), eg "Advanced", this property appears on, if any.
SDR_API const NdrOptionVec & GetOptions() const
If the property has a set of valid values that are pre-determined, this will return the valid option ...
SDR_API bool CanConnectTo(const NdrProperty &other) const override
Determines if this property can be connected to the specified property.
Token for efficient comparison, assignment, and hashing of known strings.
SDR_API const NdrTokenMap & GetHints() const
Any UI "hints" that are associated with this property.
SDR_API const TfToken & GetVStructConditionalExpr() const
If this field is part of a vstruct, this is the conditional expression.
Represents a property (input or output) that is part of a NdrNode instance.
SDR_API const NdrSdfTypeIndicator GetTypeAsSdfType() const override
Converts the property's type from GetType() into a SdfValueTypeName.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
SDR_API bool IsAssetIdentifier() const
Determines if the value held by this property is an asset identifier (eg, a file path); the logic for...
This file defines some macros that are useful for declaring and using static TfTokens.
SDR_API bool IsDefaultInput() const
Determines if the value held by this property is the default input for this node.
SDR_API const VtValue & GetDefaultValueAsSdfType() const override
Accessor for default value corresponding to the SdfValueTypeName returned by GetTypeAsSdfType.
SDR_API bool IsConnectable() const override
Whether this property can be connected to other properties.
SDR_API std::string GetImplementationName() const
Returns the implementation name of this property.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
SDR_API const TfToken & GetVStructMemberName() const
If this field is part of a vstruct, this is its name in the struct.