This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lightAPI.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 USDLUX_GENERATED_LIGHTAPI_H
8#define USDLUX_GENERATED_LIGHTAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdLux/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
20#include "pxr/usd/usdShade/input.h"
21#include "pxr/usd/usdShade/output.h"
22
23#include "pxr/base/vt/value.h"
24
25#include "pxr/base/gf/vec3d.h"
26#include "pxr/base/gf/vec3f.h"
28
29#include "pxr/base/tf/token.h"
30#include "pxr/base/tf/type.h"
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34class SdfAssetPath;
35
36// -------------------------------------------------------------------------- //
37// LIGHTAPI //
38// -------------------------------------------------------------------------- //
39
73{
74public:
78 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
79
84 explicit UsdLuxLightAPI(const UsdPrim& prim=UsdPrim())
85 : UsdAPISchemaBase(prim)
86 {
87 }
88
92 explicit UsdLuxLightAPI(const UsdSchemaBase& schemaObj)
93 : UsdAPISchemaBase(schemaObj)
94 {
95 }
96
98 USDLUX_API
99 virtual ~UsdLuxLightAPI();
100
104 USDLUX_API
105 static const TfTokenVector &
106 GetSchemaAttributeNames(bool includeInherited=true);
107
117 USDLUX_API
118 static UsdLuxLightAPI
119 Get(const UsdStagePtr &stage, const SdfPath &path);
120
121
138 USDLUX_API
139 static bool
140 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
141
157 USDLUX_API
158 static UsdLuxLightAPI
159 Apply(const UsdPrim &prim);
160
161protected:
165 USDLUX_API
167
168private:
169 // needs to invoke _GetStaticTfType.
170 friend class UsdSchemaRegistry;
171 USDLUX_API
172 static const TfType &_GetStaticTfType();
173
174 static bool _IsTypedSchema();
175
176 // override SchemaBase virtuals.
177 USDLUX_API
178 const TfType &_GetTfType() const override;
179
180public:
181 // --------------------------------------------------------------------- //
182 // SHADERID
183 // --------------------------------------------------------------------- //
205 USDLUX_API
207
213 USDLUX_API
214 UsdAttribute CreateShaderIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
215
216public:
217 // --------------------------------------------------------------------- //
218 // MATERIALSYNCMODE
219 // --------------------------------------------------------------------- //
256 USDLUX_API
258
264 USDLUX_API
265 UsdAttribute CreateMaterialSyncModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
266
267public:
268 // --------------------------------------------------------------------- //
269 // INTENSITY
270 // --------------------------------------------------------------------- //
278 USDLUX_API
280
286 USDLUX_API
287 UsdAttribute CreateIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
288
289public:
290 // --------------------------------------------------------------------- //
291 // EXPOSURE
292 // --------------------------------------------------------------------- //
302 USDLUX_API
304
310 USDLUX_API
311 UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
312
313public:
314 // --------------------------------------------------------------------- //
315 // DIFFUSE
316 // --------------------------------------------------------------------- //
325 USDLUX_API
327
333 USDLUX_API
334 UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
335
336public:
337 // --------------------------------------------------------------------- //
338 // SPECULAR
339 // --------------------------------------------------------------------- //
348 USDLUX_API
350
356 USDLUX_API
357 UsdAttribute CreateSpecularAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
358
359public:
360 // --------------------------------------------------------------------- //
361 // NORMALIZE
362 // --------------------------------------------------------------------- //
373 USDLUX_API
375
381 USDLUX_API
382 UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
383
384public:
385 // --------------------------------------------------------------------- //
386 // COLOR
387 // --------------------------------------------------------------------- //
395 USDLUX_API
397
403 USDLUX_API
404 UsdAttribute CreateColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
405
406public:
407 // --------------------------------------------------------------------- //
408 // ENABLECOLORTEMPERATURE
409 // --------------------------------------------------------------------- //
417 USDLUX_API
419
425 USDLUX_API
426 UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
427
428public:
429 // --------------------------------------------------------------------- //
430 // COLORTEMPERATURE
431 // --------------------------------------------------------------------- //
445 USDLUX_API
447
453 USDLUX_API
454 UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
455
456public:
457 // --------------------------------------------------------------------- //
458 // FILTERS
459 // --------------------------------------------------------------------- //
462 USDLUX_API
464
467 USDLUX_API
469
470public:
471 // ===================================================================== //
472 // Feel free to add custom code below this line, it will be preserved by
473 // the code generator.
474 //
475 // Just remember to:
476 // - Close the class declaration with };
477 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
478 // - Close the include guard with #endif
479 // ===================================================================== //
480 // --(BEGIN CUSTOM CODE)--
481
482 // -------------------------------------------------------------------------
486
489 USDLUX_API
491
500 USDLUX_API
502
504
505 // -------------------------------------------------------------------------
512
518 USDLUX_API
520 const SdfValueTypeName& typeName);
521
524 USDLUX_API
525 UsdShadeOutput GetOutput(const TfToken &name) const;
526
531 USDLUX_API
532 std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
533
535
536 // -------------------------------------------------------------------------
537
545
550 USDLUX_API
552 const SdfValueTypeName& typeName);
553
556 USDLUX_API
557 UsdShadeInput GetInput(const TfToken &name) const;
558
563 USDLUX_API
564 std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
565
567
571 USDLUX_API
573
577 USDLUX_API
579
594 USDLUX_API
596 const TfToken &renderContext) const;
597
605 USDLUX_API
607 const TfToken &renderContext,
608 VtValue const &defaultValue = VtValue(),
609 bool writeSparsely=false) const;
610
626 USDLUX_API
627 TfToken GetShaderId(const TfTokenVector &renderContexts) const;
628};
629
630PXR_NAMESPACE_CLOSE_SCOPE
631
632#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a value type name, i.e.
Definition: valueTypeName.h:71
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
A general purpose API schema used to describe a collection of prims and properties within a scene.
API schema that imparts the quality of being a light onto a prim.
Definition: lightAPI.h:73
USDLUX_API TfToken GetShaderId(const TfTokenVector &renderContexts) const
Return the light's shader ID for the given list of available renderContexts.
USDLUX_API UsdCollectionAPI GetLightLinkCollectionAPI() const
Return the UsdCollectionAPI interface used for examining and modifying the light-linking of this ligh...
USDLUX_API UsdAttribute GetMaterialSyncModeAttr() const
For a LightAPI applied to geometry that has a bound Material, which is entirely or partly emissive,...
USDLUX_API UsdAttribute GetEnableColorTemperatureAttr() const
Enables using colorTemperature.
USDLUX_API UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetColorTemperatureAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetNormalizeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API std::vector< UsdShadeOutput > GetOutputs(bool onlyAuthored=true) const
Outputs are represented by attributes in the "outputs:" namespace.
USDLUX_API UsdShadeOutput CreateOutput(const TfToken &name, const SdfValueTypeName &typeName)
Create an output which can either have a value or can be connected.
UsdLuxLightAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdLuxLightAPI on UsdPrim prim .
Definition: lightAPI.h:84
USDLUX_API UsdAttribute CreateSpecularAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSpecularAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: lightAPI.h:78
USDLUX_API UsdShadeInput CreateInput(const TfToken &name, const SdfValueTypeName &typeName)
Create an input which can either have a value or can be connected.
static USDLUX_API UsdLuxLightAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
USDLUX_API UsdAttribute GetShaderIdAttr() const
Default ID for the light's shader.
USDLUX_API UsdAttribute GetShaderIdAttrForRenderContext(const TfToken &renderContext) const
Returns the shader ID attribute for the given renderContext.
USDLUX_API UsdAttribute CreateShaderIdAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetShaderIdAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API UsdCollectionAPI GetShadowLinkCollectionAPI() const
Return the UsdCollectionAPI interface used for examining and modifying the shadow-linking of this lig...
USDLUX_API UsdAttribute CreateIntensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetIntensityAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API UsdShadeConnectableAPI ConnectableAPI() const
Contructs and returns a UsdShadeConnectableAPI object with this light.
USDLUX_API UsdAttribute GetDiffuseAttr() const
A multiplier for the effect of this light on the diffuse response of materials.
static USDLUX_API UsdLuxLightAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdLuxLightAPI holding the prim adhering to this schema at path on stage.
USDLUX_API UsdAttribute GetExposureAttr() const
Scales the power of the light exponentially as a power of 2 (similar to an F-stop control over exposu...
USDLUX_API UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetEnableColorTemperatureAttr(), and also Create vs Get Property Methods for when to use Get vs C...
USDLUX_API UsdAttribute CreateExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API UsdRelationship GetFiltersRel() const
Relationship to the light filters that apply to this light.
USDLUX_API UsdAttribute GetIntensityAttr() const
Scales the power of the light linearly.
USDLUX_API UsdRelationship CreateFiltersRel() const
See GetFiltersRel(), and also Create vs Get Property Methods for when to use Get vs Create.
virtual USDLUX_API ~UsdLuxLightAPI()
Destructor.
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDLUX_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDLUX_API UsdShadeOutput GetOutput(const TfToken &name) const
Return the requested output if it exists.
USDLUX_API UsdAttribute GetNormalizeAttr() const
Normalizes power by the surface area of the light.
USDLUX_API UsdLuxLightAPI(const UsdShadeConnectableAPI &connectable)
Constructor that takes a ConnectableAPI object.
USDLUX_API UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetDiffuseAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDLUX_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
USDLUX_API UsdAttribute GetColorTemperatureAttr() const
Color temperature, in degrees Kelvin, representing the white point.
USDLUX_API UsdAttribute GetSpecularAttr() const
A multiplier for the effect of this light on the specular response of materials.
UsdLuxLightAPI(const UsdSchemaBase &schemaObj)
Construct a UsdLuxLightAPI on the prim held by schemaObj .
Definition: lightAPI.h:92
USDLUX_API UsdAttribute CreateMaterialSyncModeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetMaterialSyncModeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API UsdShadeInput GetInput(const TfToken &name) const
Return the requested input if it exists.
USDLUX_API UsdAttribute CreateShaderIdAttrForRenderContext(const TfToken &renderContext, VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Creates the shader ID attribute for the given renderContext.
USDLUX_API UsdAttribute CreateColorAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetColorAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLUX_API std::vector< UsdShadeInput > GetInputs(bool onlyAuthored=true) const
Inputs are represented by attributes in the "inputs:" namespace.
USDLUX_API UsdAttribute GetColorAttr() const
The color of emitted light, in energy-linear terms.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and mak...
This class encapsulates a shader or node-graph input, which is a connectable attribute representing a...
Definition: input.h:32
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
Definition: output.h:31
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440