25 #ifndef SDR_SHADERNODE_H
26 #define SDR_SHADERNODE_H
31 #include "pxr/usd/sdr/api.h"
32 #include "pxr/base/tf/staticTokens.h"
33 #include "pxr/usd/ndr/node.h"
34 #include "pxr/usd/sdr/declare.h"
36 PXR_NAMESPACE_OPEN_SCOPE
41 #define SDR_NODE_METADATA_TOKENS \
42 ((Category, "category")) \
44 ((Departments, "departments")) \
48 ((Primvars, "primvars")) \
49 ((ImplementationName, "__SDR__implementationName"))\
50 ((Target, "__SDR__target"))
57 #define SDR_NODE_CONTEXT_TOKENS \
58 ((Pattern, "pattern")) \
59 ((Surface, "surface")) \
60 ((Volume, "volume")) \
61 ((Displacement, "displacement")) \
63 ((LightFilter, "lightFilter")) \
64 ((SampleFilter, "sampleFilter")) \
65 ((PixelFilter, "pixelFilter"))
67 #define SDR_NODE_ROLE_TOKENS \
68 ((Primvar, "primvar")) \
69 ((Texture, "texture")) \
86 const NdrVersion& version,
87 const std::string& name,
91 const std::string& uri,
92 NdrPropertyUniquePtrVec&& properties,
93 const NdrTokenMap& metadata = NdrTokenMap(),
94 const std::string &sourceCode = std::string());
150 const std::string &
GetRole()
const;
154 const std::string&
GetHelp()
const;
166 const NdrTokenVec&
GetPages()
const {
return _pages; };
185 return _primvarNamingProperties;
223 void _PostProcessProperties();
232 NdrTokenVec _primvars;
233 NdrTokenVec _primvarNamingProperties;
238 NdrTokenVec _departments;
241 SdrPropertyMap _shaderInputs;
242 SdrPropertyMap _shaderOutputs;
246 void _InitializePrimvars();
249 NdrTokenVec _ComputePages()
const;
252 PXR_NAMESPACE_CLOSE_SCOPE
254 #endif // SDR_SHADERNODE_H
SDR_API const std::string & GetHelp() const
The help message assigned to this node, if any.
SDR_API NdrTokenVec GetAssetIdentifierInputNames() const
Returns the list of all inputs that are tagged as asset identifier inputs.
SDR_API SdrShaderNode(const NdrIdentifier &identifier, const NdrVersion &version, const std::string &name, const TfToken &family, const TfToken &context, const TfToken &sourceType, const std::string &uri, NdrPropertyUniquePtrVec &&properties, const NdrTokenMap &metadata=NdrTokenMap(), const std::string &sourceCode=std::string())
Constructor.
SDR_API const NdrTokenVec & GetDepartments() const
The departments this node is associated with, if any.
SDR_API const std::string & GetRole() const
Returns the role of this node.
SDR_API const NdrTokenVec & GetPages() const
Gets the pages on which the node's properties reside (an aggregate of the unique SdrShaderProperty::G...
SDR_API const NdrTokenVec & GetPrimvars() const
The list of primvars this node knows it requires / uses.
SDR_API const TfToken & GetCategory() const
The category assigned to this node, if any.
Token for efficient comparison, assignment, and hashing of known strings.
SDR_API const std::string & GetImplementationName() const
Returns the implementation name of this node.
Represents an abstract node.
SDR_API NdrTokenVec GetAllVstructNames() const
Gets all vstructs that are present in the shader.
SDR_API const NdrTokenVec & GetAdditionalPrimvarProperties() const
The list of string input properties whose values provide the names of additional primvars consumed by...
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
SDR_API SdrShaderPropertyConstPtr GetShaderOutput(const TfToken &outputName) const
Get a shader output property by name.
A specialized version of NdrNode which holds shading information.
SDR_API SdrShaderPropertyConstPtr GetShaderInput(const TfToken &inputName) const
Get a shader input property by name.
SDR_API SdrShaderPropertyConstPtr GetDefaultInput() const
Returns the first shader input that is tagged as the default input.
SDR_API NdrTokenVec GetPropertyNamesForPage(const std::string &pageName) const
Gets the names of the properties on a certain page (one that was returned by GetPages()).
SDR_API const TfToken & GetLabel() const
The label assigned to this node, if any.