HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
settingsBase.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef USDRENDER_GENERATED_SETTINGSBASE_H
8 #define USDRENDER_GENERATED_SETTINGSBASE_H
9 
10 /// \file usdRender/settingsBase.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdRender/api.h"
14 #include "pxr/usd/usd/typed.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
18 
19 #include "pxr/base/vt/value.h"
20 
21 #include "pxr/base/gf/vec3d.h"
22 #include "pxr/base/gf/vec3f.h"
23 #include "pxr/base/gf/matrix4d.h"
24 
25 #include "pxr/base/tf/token.h"
26 #include "pxr/base/tf/type.h"
27 
29 
30 class SdfAssetPath;
31 
32 // -------------------------------------------------------------------------- //
33 // RENDERSETTINGSBASE //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdRenderSettingsBase
37 ///
38 /// Abstract base class that defines render settings that
39 /// can be specified on either a RenderSettings prim or a RenderProduct
40 /// prim.
41 ///
42 /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
43 /// that are text/tokens, the actual token is published and defined in \ref UsdRenderTokens.
44 /// So to set an attribute to the value "rightHanded", use UsdRenderTokens->rightHanded
45 /// as the value.
46 ///
48 {
49 public:
50  /// Compile time constant representing what kind of schema this class is.
51  ///
52  /// \sa UsdSchemaKind
54 
55  /// Construct a UsdRenderSettingsBase on UsdPrim \p prim .
56  /// Equivalent to UsdRenderSettingsBase::Get(prim.GetStage(), prim.GetPath())
57  /// for a \em valid \p prim, but will not immediately throw an error for
58  /// an invalid \p prim
59  explicit UsdRenderSettingsBase(const UsdPrim& prim=UsdPrim())
60  : UsdTyped(prim)
61  {
62  }
63 
64  /// Construct a UsdRenderSettingsBase on the prim held by \p schemaObj .
65  /// Should be preferred over UsdRenderSettingsBase(schemaObj.GetPrim()),
66  /// as it preserves SchemaBase state.
67  explicit UsdRenderSettingsBase(const UsdSchemaBase& schemaObj)
68  : UsdTyped(schemaObj)
69  {
70  }
71 
72  /// Destructor.
74  virtual ~UsdRenderSettingsBase();
75 
76  /// Return a vector of names of all pre-declared attributes for this schema
77  /// class and all its ancestor classes. Does not include attributes that
78  /// may be authored by custom/extended methods of the schemas involved.
80  static const TfTokenVector &
81  GetSchemaAttributeNames(bool includeInherited=true);
82 
83  /// Return a UsdRenderSettingsBase holding the prim adhering to this
84  /// schema at \p path on \p stage. If no prim exists at \p path on
85  /// \p stage, or if the prim at that path does not adhere to this schema,
86  /// return an invalid schema object. This is shorthand for the following:
87  ///
88  /// \code
89  /// UsdRenderSettingsBase(stage->GetPrimAtPath(path));
90  /// \endcode
91  ///
94  Get(const UsdStagePtr &stage, const SdfPath &path);
95 
96 
97 protected:
98  /// Returns the kind of schema this class belongs to.
99  ///
100  /// \sa UsdSchemaKind
102  UsdSchemaKind _GetSchemaKind() const override;
103 
104 private:
105  // needs to invoke _GetStaticTfType.
106  friend class UsdSchemaRegistry;
108  static const TfType &_GetStaticTfType();
109 
110  static bool _IsTypedSchema();
111 
112  // override SchemaBase virtuals.
114  const TfType &_GetTfType() const override;
115 
116 public:
117  // --------------------------------------------------------------------- //
118  // RESOLUTION
119  // --------------------------------------------------------------------- //
120  /// The image pixel resolution, corresponding to the
121  /// camera's screen window.
122  ///
123  /// | ||
124  /// | -- | -- |
125  /// | Declaration | `uniform int2 resolution = (2048, 1080)` |
126  /// | C++ Type | GfVec2i |
127  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int2 |
128  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
131 
132  /// See GetResolutionAttr(), and also
133  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
134  /// If specified, author \p defaultValue as the attribute's default,
135  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
136  /// the default for \p writeSparsely is \c false.
138  UsdAttribute CreateResolutionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
139 
140 public:
141  // --------------------------------------------------------------------- //
142  // PIXELASPECTRATIO
143  // --------------------------------------------------------------------- //
144  /// The aspect ratio (width/height) of image pixels..
145  /// The default ratio 1.0 indicates square pixels.
146  ///
147  /// | ||
148  /// | -- | -- |
149  /// | Declaration | `uniform float pixelAspectRatio = 1` |
150  /// | C++ Type | float |
151  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
152  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
155 
156  /// See GetPixelAspectRatioAttr(), and also
157  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
158  /// If specified, author \p defaultValue as the attribute's default,
159  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
160  /// the default for \p writeSparsely is \c false.
162  UsdAttribute CreatePixelAspectRatioAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
163 
164 public:
165  // --------------------------------------------------------------------- //
166  // ASPECTRATIOCONFORMPOLICY
167  // --------------------------------------------------------------------- //
168  ///
169  /// Indicates the policy to use to resolve an aspect
170  /// ratio mismatch between the camera aperture and image settings.
171  ///
172  /// This policy allows a standard render setting to do something
173  /// reasonable given varying camera inputs.
174  ///
175  /// The camera aperture aspect ratio is determined by the
176  /// aperture atributes on the UsdGeomCamera.
177  ///
178  /// The image aspect ratio is determined by the resolution and
179  /// pixelAspectRatio attributes in the render settings.
180  ///
181  /// - "expandAperture": if necessary, expand the aperture to
182  /// fit the image, exposing additional scene content
183  /// - "cropAperture": if necessary, crop the aperture to fit
184  /// the image, cropping scene content
185  /// - "adjustApertureWidth": if necessary, adjust aperture width
186  /// to make its aspect ratio match the image
187  /// - "adjustApertureHeight": if necessary, adjust aperture height
188  /// to make its aspect ratio match the image
189  /// - "adjustPixelAspectRatio": compute pixelAspectRatio to
190  /// make the image exactly cover the aperture; disregards
191  /// existing attribute value of pixelAspectRatio
192  ///
193  ///
194  /// | ||
195  /// | -- | -- |
196  /// | Declaration | `uniform token aspectRatioConformPolicy = "expandAperture"` |
197  /// | C++ Type | TfToken |
198  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
199  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
200  /// | \ref UsdRenderTokens "Allowed Values" | expandAperture, cropAperture, adjustApertureWidth, adjustApertureHeight, adjustPixelAspectRatio |
203 
204  /// See GetAspectRatioConformPolicyAttr(), and also
205  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
206  /// If specified, author \p defaultValue as the attribute's default,
207  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
208  /// the default for \p writeSparsely is \c false.
210  UsdAttribute CreateAspectRatioConformPolicyAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
211 
212 public:
213  // --------------------------------------------------------------------- //
214  // DATAWINDOWNDC
215  // --------------------------------------------------------------------- //
216  /// dataWindowNDC specifies the axis-aligned rectangular
217  /// region in the adjusted aperture window within which the renderer
218  /// should produce data.
219  ///
220  /// It is specified as (xmin, ymin, xmax, ymax) in normalized
221  /// device coordinates, where the range 0 to 1 corresponds to the
222  /// aperture. (0,0) corresponds to the bottom-left
223  /// corner and (1,1) corresponds to the upper-right corner.
224  ///
225  /// Specifying a window outside the unit square will produce
226  /// overscan data. Specifying a window that does not cover the unit
227  /// square will produce a cropped render.
228  ///
229  /// A pixel is included in the rendered result if the pixel
230  /// center is contained by the data window. This is consistent
231  /// with standard rules used by polygon rasterization engines.
232  /// \ref UsdRenderRasterization
233  ///
234  /// The data window is expressed in NDC so that cropping and
235  /// overscan may be resolution independent. In interactive
236  /// workflows, incremental cropping and resolution adjustment
237  /// may be intermixed to isolate and examine parts of the scene.
238  /// In compositing workflows, overscan may be used to support
239  /// image post-processing kernels, and reduced-resolution proxy
240  /// renders may be used for faster iteration.
241  ///
242  /// The dataWindow:ndc coordinate system references the
243  /// aperture after any adjustments required by
244  /// aspectRatioConformPolicy.
245  ///
246  ///
247  /// | ||
248  /// | -- | -- |
249  /// | Declaration | `uniform float4 dataWindowNDC = (0, 0, 1, 1)` |
250  /// | C++ Type | GfVec4f |
251  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float4 |
252  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
255 
256  /// See GetDataWindowNDCAttr(), and also
257  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
258  /// If specified, author \p defaultValue as the attribute's default,
259  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
260  /// the default for \p writeSparsely is \c false.
262  UsdAttribute CreateDataWindowNDCAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
263 
264 public:
265  // --------------------------------------------------------------------- //
266  // INSTANTANEOUSSHUTTER
267  // --------------------------------------------------------------------- //
268  /// Deprecated - use disableMotionBlur instead. Override
269  /// the targeted _camera_'s _shutterClose_ to be equal to the
270  /// value of its _shutterOpen_, to produce a zero-width shutter
271  /// interval. This gives us a convenient way to disable motion
272  /// blur.
273  ///
274  /// | ||
275  /// | -- | -- |
276  /// | Declaration | `uniform bool instantaneousShutter = 0` |
277  /// | C++ Type | bool |
278  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
279  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
282 
283  /// See GetInstantaneousShutterAttr(), and also
284  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
285  /// If specified, author \p defaultValue as the attribute's default,
286  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
287  /// the default for \p writeSparsely is \c false.
289  UsdAttribute CreateInstantaneousShutterAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
290 
291 public:
292  // --------------------------------------------------------------------- //
293  // DISABLEMOTIONBLUR
294  // --------------------------------------------------------------------- //
295  /// Disable all motion blur by setting the shutter interval
296  /// of the targeted camera to [0,0] - that is, take only one sample,
297  /// namely at the current time code.
298  ///
299  /// | ||
300  /// | -- | -- |
301  /// | Declaration | `uniform bool disableMotionBlur = 0` |
302  /// | C++ Type | bool |
303  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
304  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
307 
308  /// See GetDisableMotionBlurAttr(), and also
309  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
310  /// If specified, author \p defaultValue as the attribute's default,
311  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
312  /// the default for \p writeSparsely is \c false.
314  UsdAttribute CreateDisableMotionBlurAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
315 
316 public:
317  // --------------------------------------------------------------------- //
318  // DISABLEDEPTHOFFIELD
319  // --------------------------------------------------------------------- //
320  /// Disable all depth of field by setting F-stop of the targeted
321  /// camera to infinity.
322  ///
323  /// | ||
324  /// | -- | -- |
325  /// | Declaration | `uniform bool disableDepthOfField = 0` |
326  /// | C++ Type | bool |
327  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
328  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
331 
332  /// See GetDisableDepthOfFieldAttr(), and also
333  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
334  /// If specified, author \p defaultValue as the attribute's default,
335  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
336  /// the default for \p writeSparsely is \c false.
338  UsdAttribute CreateDisableDepthOfFieldAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
339 
340 public:
341  // --------------------------------------------------------------------- //
342  // CAMERA
343  // --------------------------------------------------------------------- //
344  /// The _camera_ relationship specifies the primary
345  /// camera to use in a render. It must target a UsdGeomCamera.
346  ///
349 
350  /// See GetCameraRel(), and also
351  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
354 
355 public:
356  // ===================================================================== //
357  // Feel free to add custom code below this line, it will be preserved by
358  // the code generator.
359  //
360  // Just remember to:
361  // - Close the class declaration with };
362  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
363  // - Close the include guard with #endif
364  // ===================================================================== //
365  // --(BEGIN CUSTOM CODE)--
366 };
367 
369 
370 #endif
USDRENDER_API UsdAttribute CreateDisableDepthOfFieldAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
#define USDRENDER_API
Definition: api.h:23
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
USDRENDER_API UsdRelationship CreateCameraRel() const
USDRENDER_API UsdAttribute CreateAspectRatioConformPolicyAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRENDER_API UsdAttribute GetDisableMotionBlurAttr() const
USDRENDER_API UsdAttribute GetDisableDepthOfFieldAttr() const
Represents a non-concrete typed schema.
USDRENDER_API UsdAttribute GetAspectRatioConformPolicyAttr() const
USDRENDER_API UsdAttribute GetDataWindowNDCAttr() const
static USDRENDER_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDRENDER_API UsdRelationship GetCameraRel() const
static USDRENDER_API UsdRenderSettingsBase Get(const UsdStagePtr &stage, const SdfPath &path)
Definition: prim.h:116
USDRENDER_API UsdAttribute CreateInstantaneousShutterAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: typed.h:44
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDRENDER_API UsdAttribute CreatePixelAspectRatioAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: path.h:273
USDRENDER_API UsdSchemaKind _GetSchemaKind() const override
UsdSchemaKind
Definition: common.h:112
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDRENDER_API UsdAttribute GetPixelAspectRatioAttr() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
USDRENDER_API UsdAttribute CreateResolutionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRENDER_API UsdAttribute GetResolutionAttr() const
USDRENDER_API UsdAttribute CreateDataWindowNDCAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRENDER_API UsdAttribute GetInstantaneousShutterAttr() const
USDRENDER_API UsdAttribute CreateDisableMotionBlurAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdRenderSettingsBase(const UsdPrim &prim=UsdPrim())
Definition: settingsBase.h:59
virtual USDRENDER_API ~UsdRenderSettingsBase()
Destructor.
Definition: value.h:146
static const UsdSchemaKind schemaKind
Definition: settingsBase.h:53
UsdRenderSettingsBase(const UsdSchemaBase &schemaObj)
Definition: settingsBase.h:67