25 #ifndef PXR_USD_SDR_SHADER_NODE_H 26 #define PXR_USD_SDR_SHADER_NODE_H 31 #include "pxr/usd/sdr/api.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")) \ 51 ((SdrUsdEncodingVersion, "sdrUsdEncodingVersion")) \ 52 ((SdrDefinitionNameFallbackPrefix, "sdrDefinitionNameFallbackPrefix")) 59 #define SDR_NODE_CONTEXT_TOKENS \ 60 ((Pattern, "pattern")) \ 61 ((Surface, "surface")) \ 62 ((Volume, "volume")) \ 63 ((Displacement, "displacement")) \ 65 ((LightFilter, "lightFilter")) \ 66 ((SampleFilter, "sampleFilter")) \ 67 ((PixelFilter, "pixelFilter")) 69 #define SDR_NODE_ROLE_TOKENS \ 70 ((Primvar, "primvar")) \ 71 ((Texture, "texture")) \ 89 const NdrVersion& version,
90 const std::string& name,
94 const std::string& definitionURI,
95 const std::string& implementationURI,
96 NdrPropertyUniquePtrVec&& properties,
97 const NdrTokenMap& metadata = NdrTokenMap(),
98 const std::string &sourceCode = std::string());
170 const NdrTokenVec&
GetPages()
const {
return _pages; };
189 return _primvarNamingProperties;
227 void _PostProcessProperties();
236 NdrTokenVec _primvars;
237 NdrTokenVec _primvarNamingProperties;
242 NdrTokenVec _departments;
245 SdrPropertyMap _shaderInputs;
246 SdrPropertyMap _shaderOutputs;
250 void _InitializePrimvars();
253 NdrTokenVec _ComputePages()
const;
256 PXR_NAMESPACE_CLOSE_SCOPE
258 #endif // PXR_USD_SDR_SHADER_NODE_H 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 &definitionURI, const std::string &implementationURI, NdrPropertyUniquePtrVec &&properties, const NdrTokenMap &metadata=NdrTokenMap(), const std::string &sourceCode=std::string())
Constructor.
SDR_API NdrTokenVec GetAllVstructNames() const
Gets all vstructs that are present in the shader.
SDR_API std::string GetHelp() const
The help message assigned to this node, if any.
SDR_API const TfToken & GetLabel() const
The label assigned to this node, if any.
Token for efficient comparison, assignment, and hashing of known strings.
Represents an abstract node.
SDR_API std::string GetRole() const
Returns the role of this node.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
SDR_API NdrTokenVec GetAssetIdentifierInputNames() const
Returns the list of all inputs that are tagged as asset identifier inputs.
SDR_API SdrShaderPropertyConstPtr GetShaderOutput(const TfToken &outputName) const
Get a shader output property by name.
SDR_API SdrShaderPropertyConstPtr GetDefaultInput() const
Returns the first shader input that is tagged as the default input.
SDR_API const NdrTokenVec & GetPages() const
Gets the pages on which the node's properties reside (an aggregate of the unique SdrShaderProperty::G...
A specialized version of NdrNode which holds shading information.
SDR_API const TfToken & GetCategory() const
The category assigned to this node, if any.
This file defines some macros that are useful for declaring and using static TfTokens.
SDR_API std::string GetImplementationName() const
Returns the implementation name of this node.
SDR_API const NdrTokenVec & GetPrimvars() const
The list of primvars this node knows it requires / uses.
SDR_API const NdrTokenVec & GetAdditionalPrimvarProperties() const
The list of string input properties whose values provide the names of additional primvars consumed by...
SDR_API SdrShaderPropertyConstPtr GetShaderInput(const TfToken &inputName) const
Get a shader input property by name.
SDR_API const NdrTokenVec & GetDepartments() const
The departments this node is associated with, if any.
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()).