Loading...
Searching...
No Matches
materialSchema.h
Go to the documentation of this file.
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
8
9/* ************************************************************************** */
10/* ** ** */
11/* ** This file is generated by a script. ** */
12/* ** ** */
13/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14/* ** Edit hdSchemaDefs.py instead to make changes. ** */
15/* ** ** */
16/* ************************************************************************** */
17
18#ifndef PXR_IMAGING_HD_MATERIAL_SCHEMA_H
19#define PXR_IMAGING_HD_MATERIAL_SCHEMA_H
20
22
23#include "pxr/imaging/hd/api.h"
25
26#include "pxr/imaging/hd/schema.h"
27
28// --(BEGIN CUSTOM CODE: Includes)--
29// --(END CUSTOM CODE: Includes)--
30
31PXR_NAMESPACE_OPEN_SCOPE
32
33// --(BEGIN CUSTOM CODE: Declares)--
34// --(END CUSTOM CODE: Declares)--
35
36#define HD_MATERIAL_SCHEMA_TOKENS \
37 (material) \
38 ((universalRenderContext, "")) \
39 ((all, "__all")) \
40 (terminals) \
41 (surface) \
42 (displacement) \
43 (volume) \
44
45TF_DECLARE_PUBLIC_TOKENS(HdMaterialSchemaTokens, HD_API,
46 HD_MATERIAL_SCHEMA_TOKENS);
47
48//-----------------------------------------------------------------------------
49
50// The Material schema is a container schema that provides the correct
51// material definition per render context.
52//
53// For example, a material may specify several render contexts like the
54// universalRenderContext (""), Renderman ("ri"), Storm ("glslfx"), etc. Each
55// render context will then provide the specific definition for the renderer,
56// which is defined by the MaterialNetwork schema. The universalRenderContext
57// applies to all renderers.
58//
59// See "Custom Code: Schema Methods" section for ASCII art diagram.
60//
61
62class HdMaterialSchema : public HdSchema
63{
64public:
67
68 HdMaterialSchema(HdContainerDataSourceHandle container)
69 : HdSchema(container) {}
70
76 HD_API
77 static HdMaterialSchema GetFromParent(
78 const HdContainerDataSourceHandle &fromParentContainer);
79
81
82// --(BEGIN CUSTOM CODE: Schema Methods)--
83
86
93
104
146
148
149 HD_API
150 HdMaterialNetworkSchema GetMaterialNetwork();
151
152 HD_API
153 HdMaterialNetworkSchema GetMaterialNetwork(TfToken const &context);
154
155 HD_API
156 HdMaterialNetworkSchema GetMaterialNetwork(TfTokenVector const &contexts);
157
158 // Find the terminal (surface/volume/displcement) from a given data source locator.
159 HD_API
160 static TfToken
161 GetLocatorTerminal(
162 HdDataSourceLocator const& locator);
163
164 HD_API
165 static TfToken
166 GetLocatorTerminal(
167 HdDataSourceLocator const& locator,
168 TfToken const& context);
169
170 HD_API
171 static TfToken
172 GetLocatorTerminal(
173 HdDataSourceLocator const& locator,
174 TfTokenVector const &contexts);
175
176// --(END CUSTOM CODE: Schema Methods)--
177
180
182
185
188 HD_API
189 static const TfToken &GetSchemaToken();
190
193 HD_API
194 static const HdDataSourceLocator &GetDefaultLocator();
195
197
200 HD_API
201 static HdContainerDataSourceHandle
202 BuildRetained(
203 size_t count,
204 const TfToken *names,
205 const HdDataSourceBaseHandle *values);
206
208};
209
210PXR_NAMESPACE_CLOSE_SCOPE
211
212#endif
Represents an object that can identify the location of a data source.
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:26
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440