Loading...
Searching...
No Matches
materialOverrideSchema.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_OVERRIDE_SCHEMA_H
19#define PXR_IMAGING_HD_MATERIAL_OVERRIDE_SCHEMA_H
20
22
23#include "pxr/imaging/hd/api.h"
24#include "pxr/imaging/hd/schemaTypeDefs.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_OVERRIDE_SCHEMA_TOKENS \
37 (materialOverride) \
38 (interfaceValues) \
39
40TF_DECLARE_PUBLIC_TOKENS(HdMaterialOverrideSchemaTokens, HD_API,
41 HD_MATERIAL_OVERRIDE_SCHEMA_TOKENS);
42
43//-----------------------------------------------------------------------------
44
45// The MaterialOverride schema allows overrides to be made to the material's
46// public UI. Overrides can be applied to both material or geometry scene
47// index prim locations.
48//
49// The following is an example of a material override. The data source to
50// author an override on the public UI name "globalSpecularKface" would look
51// like this:
52//
53// ds at: materialOverride/interfaceValues/globalSpecularKface/value = 0.666
54//
55// There needs to be an interface mapping defined for "globalSpecularKface",
56// which could look like this:
57//
58// ds at: material/<renderContext>/interfaceMappings/
59// globalSpecularKface/[0]/nodePath = MaterialLayer
60//
61// ds at: material/<renderContext>/interfaceMappings/
62// globalSpecularKface/[0]/inputName = specularKface
63//
64// The above means that the "globalSpecularKface" public UI name will map to
65// the node parameter "specularKface", and for example, this node parameter
66// may already have a data source for its value:
67//
68// ds at: material/<renderContext>/nodes/MaterialLayer/parameters/
69// specularKface/value = 0.222
70//
71// After resolving the material override, the data source of the node
72// parameter's value is replaced by the overriding value data source.
73//
74// ds at: material/<renderContext>/nodes/MaterialLayer/parameters/
75// specularKface/value = 0.666
76//
77// Note that the MaterialOverride schema does not specify a render context
78// token because material overrides are high-level and do not need to know
79// about implementation details--they just need to specify an overriding data
80// source. By contrast, the contents of a material network do specify a render
81// context token in order to define the material nodes and interface mappings
82// --you can imagine that a Renderman vs Storm implementation of a material
83// network would be quite different.
84//
85// See also the Material schema documentation for ASCII art diagram.
86//
87
88class HdMaterialOverrideSchema : public HdSchema
89{
90public:
93
94 HdMaterialOverrideSchema(HdContainerDataSourceHandle container)
95 : HdSchema(container) {}
96
102 HD_API
103 static HdMaterialOverrideSchema GetFromParent(
104 const HdContainerDataSourceHandle &fromParentContainer);
105
107
108// --(BEGIN CUSTOM CODE: Schema Methods)--
109// --(END CUSTOM CODE: Schema Methods)--
110
113
116 HD_API
117 HdMaterialNodeParameterContainerSchema GetInterfaceValues() const;
118
120
123
126 HD_API
127 static const TfToken &GetSchemaToken();
128
131 HD_API
132 static const HdDataSourceLocator &GetDefaultLocator();
133
135
138
146 HD_API
147 static HdContainerDataSourceHandle
148 BuildRetained(
149 const HdContainerDataSourceHandle &interfaceValues
150 );
151
159 {
160 public:
161 HD_API
162 Builder &SetInterfaceValues(
163 const HdContainerDataSourceHandle &interfaceValues);
164
166 HD_API
167 HdContainerDataSourceHandle Build();
168
169 private:
170 HdContainerDataSourceHandle _interfaceValues;
171
172 };
173
175};
176
177PXR_NAMESPACE_CLOSE_SCOPE
178
179#endif
Represents an object that can identify the location of a data source.
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
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