8#ifndef PXR_USD_SDR_SHADER_PROPERTY_METADATA_H
9#define PXR_USD_SDR_SHADER_PROPERTY_METADATA_H
14#include "pxr/usd/sdr/api.h"
17PXR_NAMESPACE_OPEN_SCOPE
22#define SDR_PROPERTY_METADATA_TOKENS \
26 ((RenderType, "renderType")) \
28 ((Widget, "widget")) \
30 ((Options, "options")) \
31 ((IsDynamicArray, "isDynamicArray")) \
32 ((TupleSize, "tupleSize")) \
33 ((Connectable, "connectable")) \
35 ((ShownIf, "shownIf")) \
36 ((ValidConnectionTypes, "validConnectionTypes")) \
37 ((VstructMemberOf, "vstructMemberOf")) \
38 ((VstructMemberName, "vstructMemberName")) \
39 ((VstructConditionalExpr, "vstructConditionalExpr"))\
40 ((IsAssetIdentifier, "__SDR__isAssetIdentifier"))\
41 ((ImplementationName, "__SDR__implementationName"))\
42 ((SdrUsdDefinitionType, "sdrUsdDefinitionType"))\
43 ((DefaultInput, "__SDR__defaultinput")) \
44 ((Target, "__SDR__target")) \
45 ((Colorspace, "__SDR__colorspace"))
49#define SDR_PROPERTY_ROLE_TOKENS \
52#define SDR_PROPERTY_TOKENS \
53 ((PageDelimiter, ":"))
65 SDR_PROPERTY_METADATA_TOKENS);
67 SDR_PROPERTY_ROLE_TOKENS);
97 const std::initializer_list<std::pair<TfToken, std::string>>& init
104 : _items(
std::move(items)) {}
124 template <
typename T>
143 template <
typename T>
147 const VtValue converted = VtValue::Cast<T>(v);
175 void SetLabel(
const TfToken& v);
180 bool HasHelp()
const;
182 std::string GetHelp()
const;
184 void SetHelp(
const std::string& v);
189 bool HasPage()
const;
193 void SetPage(
const TfToken& v);
198 bool HasRenderType()
const;
200 std::string GetRenderType()
const;
202 void SetRenderType(
const std::string& v);
204 void ClearRenderType();
207 bool HasRole()
const;
209 std::string GetRole()
const;
211 void SetRole(
const std::string& v);
216 bool HasWidget()
const;
220 void SetWidget(
const TfToken& v);
225 bool HasIsDynamicArray()
const;
227 bool GetIsDynamicArray()
const;
229 void SetIsDynamicArray(
const bool& v);
231 void ClearIsDynamicArray();
234 bool HasTupleSize()
const;
236 int GetTupleSize()
const;
238 void SetTupleSize(
const int& v);
240 void ClearTupleSize();
243 bool HasConnectable()
const;
245 bool GetConnectable()
const;
247 void SetConnectable(
const bool& v);
249 void ClearConnectable();
252 bool HasShownIf()
const;
254 std::string GetShownIf()
const;
256 void SetShownIf(
const std::string& v);
261 bool HasValidConnectionTypes()
const;
263 SdrTokenVec GetValidConnectionTypes()
const;
265 void SetValidConnectionTypes(
const SdrTokenVec& v);
267 void ClearValidConnectionTypes();
270 bool HasIsAssetIdentifier()
const;
272 bool GetIsAssetIdentifier()
const;
274 void SetIsAssetIdentifier(
const bool& v);
276 void ClearIsAssetIdentifier();
279 bool HasImplementationName()
const;
281 std::string GetImplementationName()
const;
283 void SetImplementationName(
const std::string& v);
285 void ClearImplementationName();
288 bool HasSdrUsdDefinitionType()
const;
290 TfToken GetSdrUsdDefinitionType()
const;
292 void SetSdrUsdDefinitionType(
const TfToken& v);
294 void ClearSdrUsdDefinitionType();
297 bool HasDefaultInput()
const;
299 bool GetDefaultInput()
const;
301 void SetDefaultInput(
const bool& v);
303 void ClearDefaultInput();
306 bool HasColorspace()
const;
310 void SetColorspace(
const TfToken& v);
312 void ClearColorspace();
323 SdrTokenMap _EncodeLegacyMetadata()
const;
326 SdrTokenMap _LegacyCtorFromInitializer(
327 std::initializer_list<std::pair<TfToken, std::string>> f)
329 return SdrTokenMap(f.begin(), f.end());
335PXR_NAMESPACE_CLOSE_SCOPE
Represents a property (input or output) that is part of a SdrShaderNode instance.
Token for efficient comparison, assignment, and hashing of known strings.
A map with string keys and VtValue values.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
bool IsEmpty() const
Returns true iff this value is empty.
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.