Loading...
Searching...
No Matches
sceneGlobalsSchema.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_SCENE_GLOBALS_SCHEMA_H
19#define PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
20
22
23#include "pxr/imaging/hd/api.h"
24
25#include "pxr/imaging/hd/schema.h"
26
27// --(BEGIN CUSTOM CODE: Includes)--
28#include "pxr/usd/sdf/path.h"
29#include "pxr/imaging/hd/sceneIndex.h"
30// --(END CUSTOM CODE: Includes)--
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34// --(BEGIN CUSTOM CODE: Declares)--
35// --(END CUSTOM CODE: Declares)--
36
37#define HD_SCENE_GLOBALS_SCHEMA_TOKENS \
38 (sceneGlobals) \
39 (primaryCameraPrim) \
40 (activeRenderPassPrim) \
41 (activeRenderSettingsPrim) \
42 (startTimeCode) \
43 (endTimeCode) \
44 (timeCodesPerSecond) \
45 (currentFrame) \
46 (sceneStateId) \
47
48TF_DECLARE_PUBLIC_TOKENS(HdSceneGlobalsSchemaTokens, HD_API,
49 HD_SCENE_GLOBALS_SCHEMA_TOKENS);
50
51//-----------------------------------------------------------------------------
52
53// The HdSceneGlobalsSchema encapsulates "global" state to orchestrate a
54// render. It currently houses the active render settings and pass prim paths
55// that describe the information necessary to generate images from a single
56// invocation of a renderer, the active time sample range and current frame
57// number that may be relevant to downstream scene indices (e.g. procedural
58// evaluation), the time codes per second (sometimes informally referred to as
59// FPS), and the primary camera.
60//
61// We shall use the convention of a container data source at the root prim of
62// the scene index that is populated with this global state. The renderer and
63// downstream scene indices can query it to configure their behavior as
64// necessary.
65//
66
67class HdSceneGlobalsSchema : public HdSchema
68{
69public:
72
73 HdSceneGlobalsSchema(HdContainerDataSourceHandle container)
74 : HdSchema(container) {}
75
81 HD_API
82 static HdSceneGlobalsSchema GetFromParent(
83 const HdContainerDataSourceHandle &fromParentContainer);
84
86
87// --(BEGIN CUSTOM CODE: Schema Methods)--
88
95 HD_API
96 static HdSceneGlobalsSchema
97 GetFromSceneIndex(
98 const HdSceneIndexBaseRefPtr &si);
99
102 static const SdfPath&
103 GetDefaultPrimPath() {
105 }
106
107// --(END CUSTOM CODE: Schema Methods)--
108
111
112 HD_API
113 HdPathDataSourceHandle GetPrimaryCameraPrim() const;
114
115 HD_API
116 HdPathDataSourceHandle GetActiveRenderPassPrim() const;
117
118 HD_API
119 HdPathDataSourceHandle GetActiveRenderSettingsPrim() const;
120
121 HD_API
122 HdDoubleDataSourceHandle GetStartTimeCode() const;
123
124 HD_API
125 HdDoubleDataSourceHandle GetEndTimeCode() const;
126
127 HD_API
128 HdDoubleDataSourceHandle GetTimeCodesPerSecond() const;
129
130 HD_API
131 HdDoubleDataSourceHandle GetCurrentFrame() const;
132
133 HD_API
134 HdIntDataSourceHandle GetSceneStateId() const;
135
137
140
143 HD_API
144 static const TfToken &GetSchemaToken();
145
148 HD_API
149 static const HdDataSourceLocator &GetDefaultLocator();
150
152
161
163 HD_API
164 static const HdDataSourceLocator &GetPrimaryCameraPrimLocator();
165
167 HD_API
168 static const HdDataSourceLocator &GetActiveRenderPassPrimLocator();
169
171 HD_API
172 static const HdDataSourceLocator &GetActiveRenderSettingsPrimLocator();
173
175 HD_API
176 static const HdDataSourceLocator &GetStartTimeCodeLocator();
177
179 HD_API
180 static const HdDataSourceLocator &GetEndTimeCodeLocator();
181
183 HD_API
184 static const HdDataSourceLocator &GetTimeCodesPerSecondLocator();
185
187 HD_API
188 static const HdDataSourceLocator &GetCurrentFrameLocator();
189
191 HD_API
192 static const HdDataSourceLocator &GetSceneStateIdLocator();
194
197
205 HD_API
206 static HdContainerDataSourceHandle
207 BuildRetained(
208 const HdPathDataSourceHandle &primaryCameraPrim,
209 const HdPathDataSourceHandle &activeRenderPassPrim,
210 const HdPathDataSourceHandle &activeRenderSettingsPrim,
211 const HdDoubleDataSourceHandle &startTimeCode,
212 const HdDoubleDataSourceHandle &endTimeCode,
213 const HdDoubleDataSourceHandle &timeCodesPerSecond,
214 const HdDoubleDataSourceHandle &currentFrame,
215 const HdIntDataSourceHandle &sceneStateId
216 );
217
225 {
226 public:
227 HD_API
228 Builder &SetPrimaryCameraPrim(
229 const HdPathDataSourceHandle &primaryCameraPrim);
230 HD_API
231 Builder &SetActiveRenderPassPrim(
232 const HdPathDataSourceHandle &activeRenderPassPrim);
233 HD_API
234 Builder &SetActiveRenderSettingsPrim(
235 const HdPathDataSourceHandle &activeRenderSettingsPrim);
236 HD_API
237 Builder &SetStartTimeCode(
238 const HdDoubleDataSourceHandle &startTimeCode);
239 HD_API
240 Builder &SetEndTimeCode(
241 const HdDoubleDataSourceHandle &endTimeCode);
242 HD_API
243 Builder &SetTimeCodesPerSecond(
244 const HdDoubleDataSourceHandle &timeCodesPerSecond);
245 HD_API
246 Builder &SetCurrentFrame(
247 const HdDoubleDataSourceHandle &currentFrame);
248 HD_API
249 Builder &SetSceneStateId(
250 const HdIntDataSourceHandle &sceneStateId);
251
253 HD_API
254 HdContainerDataSourceHandle Build();
255
256 private:
257 HdPathDataSourceHandle _primaryCameraPrim;
258 HdPathDataSourceHandle _activeRenderPassPrim;
259 HdPathDataSourceHandle _activeRenderSettingsPrim;
260 HdDoubleDataSourceHandle _startTimeCode;
261 HdDoubleDataSourceHandle _endTimeCode;
262 HdDoubleDataSourceHandle _timeCodesPerSecond;
263 HdDoubleDataSourceHandle _currentFrame;
264 HdIntDataSourceHandle _sceneStateId;
265
266 };
267
269};
270
271PXR_NAMESPACE_CLOSE_SCOPE
272
273#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
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
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