Loading...
Searching...
No Matches
materialNetworkSchema.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_NETWORK_SCHEMA_H
19#define PXR_IMAGING_HD_MATERIAL_NETWORK_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_NETWORK_SCHEMA_TOKENS \
37 (nodes) \
38 (terminals) \
39 (interfaceMappings) \
40 (config) \
41
42TF_DECLARE_PUBLIC_TOKENS(HdMaterialNetworkSchemaTokens, HD_API,
43 HD_MATERIAL_NETWORK_SCHEMA_TOKENS);
44
45//-----------------------------------------------------------------------------
46
47// The MaterialNetwork schema is a container schema that defines a material
48// for a specific render context. A network is composed of nodes, terminals,
49// and interface mappings.
50//
51// Interface mappings define the material's public UI. For example, the
52// following data sources define a public UI "globalVal" that maps to two
53// different node parameters:
54//
55// ds at: material/<renderContext>/interfaceMappings/globalVal/[0]/ nodePath =
56// Color_Manipulate
57//
58// ds at: material/<renderContext>/interfaceMappings/globalVal/[0]/ inputName
59// = adjustVal
60//
61// ds at: material/<renderContext>/interfaceMappings/globalVal/[1]/ nodePath =
62// Color_RetargetLayer
63//
64// ds at: material/<renderContext>/interfaceMappings/globalVal/[1]/ inputName
65// = valRemapAmount
66//
67// The above means that the "globalVal" public UI name maps to the following
68// parameter data sources at:
69//
70// ds at: material/<renderContext>/nodes/Color_Manipulate/parameters/
71// adjustVal
72//
73// ds at: material/<renderContext>/nodes/Color_RetargetLayer/
74// parameters/valRemapAmount
75//
76// See also the Material schema documentation for ASCII art diagram.
77//
78
79class HdMaterialNetworkSchema : public HdSchema
80{
81public:
84
85 HdMaterialNetworkSchema(HdContainerDataSourceHandle container)
86 : HdSchema(container) {}
87
89
90// --(BEGIN CUSTOM CODE: Schema Methods)--
91// --(END CUSTOM CODE: Schema Methods)--
92
95
99 HD_API
100 HdMaterialNodeContainerSchema GetNodes() const;
101
104 HD_API
105 HdMaterialConnectionContainerSchema GetTerminals() const;
106
110 HD_API
111 HdMaterialInterfaceMappingsContainerSchema GetInterfaceMappings() const;
112
113 HD_API
114 HdSampledDataSourceContainerSchema GetConfig() const;
115
117
120
128 HD_API
129 static HdContainerDataSourceHandle
130 BuildRetained(
131 const HdContainerDataSourceHandle &nodes,
132 const HdContainerDataSourceHandle &terminals,
133 const HdContainerDataSourceHandle &interfaceMappings,
134 const HdContainerDataSourceHandle &config
135 );
136
144 {
145 public:
146 HD_API
147 Builder &SetNodes(
148 const HdContainerDataSourceHandle &nodes);
149 HD_API
150 Builder &SetTerminals(
151 const HdContainerDataSourceHandle &terminals);
152 HD_API
153 Builder &SetInterfaceMappings(
154 const HdContainerDataSourceHandle &interfaceMappings);
155 HD_API
156 Builder &SetConfig(
157 const HdContainerDataSourceHandle &config);
158
160 HD_API
161 HdContainerDataSourceHandle Build();
162
163 private:
164 HdContainerDataSourceHandle _nodes;
165 HdContainerDataSourceHandle _terminals;
166 HdContainerDataSourceHandle _interfaceMappings;
167 HdContainerDataSourceHandle _config;
168
169 };
170
172};
173
174PXR_NAMESPACE_CLOSE_SCOPE
175
176#endif
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
Template class for a schema backed by a container whose children have arbitrary names but an expected...
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81