Loading...
Searching...
No Matches
lightAPI.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef USDLUX_GENERATED_LIGHTAPI_H
25#define USDLUX_GENERATED_LIGHTAPI_H
26
28
29#include "pxr/pxr.h"
30#include "pxr/usd/usdLux/api.h"
32#include "pxr/usd/usd/prim.h"
33#include "pxr/usd/usd/stage.h"
35
37#include "pxr/usd/usdShade/input.h"
38#include "pxr/usd/usdShade/output.h"
39
40#include "pxr/base/vt/value.h"
41
42#include "pxr/base/gf/vec3d.h"
43#include "pxr/base/gf/vec3f.h"
45
46#include "pxr/base/tf/token.h"
47#include "pxr/base/tf/type.h"
48
49PXR_NAMESPACE_OPEN_SCOPE
50
51class SdfAssetPath;
52
53// -------------------------------------------------------------------------- //
54// LIGHTAPI //
55// -------------------------------------------------------------------------- //
56
90{
91public:
95 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
96
101 explicit UsdLuxLightAPI(const UsdPrim& prim=UsdPrim())
102 : UsdAPISchemaBase(prim)
103 {
104 }
105
109 explicit UsdLuxLightAPI(const UsdSchemaBase& schemaObj)
110 : UsdAPISchemaBase(schemaObj)
111 {
112 }
113
115 USDLUX_API
117
121 USDLUX_API
122 static const TfTokenVector &
123 GetSchemaAttributeNames(bool includeInherited=true);
124
134 USDLUX_API
135 static UsdLuxLightAPI
136 Get(const UsdStagePtr &stage, const SdfPath &path);
137
138
155 USDLUX_API
156 static bool
157 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
158
174 USDLUX_API
175 static UsdLuxLightAPI
176 Apply(const UsdPrim &prim);
177
178protected:
182 USDLUX_API
184
185private:
186 // needs to invoke _GetStaticTfType.
187 friend class UsdSchemaRegistry;
188 USDLUX_API
189 static const TfType &_GetStaticTfType();
190
191 static bool _IsTypedSchema();
192
193 // override SchemaBase virtuals.
194 USDLUX_API
195 const TfType &_GetTfType() const override;
196
197public:
198 // --------------------------------------------------------------------- //
199 // SHADERID
200 // --------------------------------------------------------------------- //
222 USDLUX_API
224
230 USDLUX_API
231 UsdAttribute CreateShaderIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
232
233public:
234 // --------------------------------------------------------------------- //
235 // MATERIALSYNCMODE
236 // --------------------------------------------------------------------- //
272 USDLUX_API
274
280 USDLUX_API
281 UsdAttribute CreateMaterialSyncModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
282
283public:
284 // --------------------------------------------------------------------- //
285 // INTENSITY
286 // --------------------------------------------------------------------- //
294 USDLUX_API
296
302 USDLUX_API
303 UsdAttribute CreateIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
304
305public:
306 // --------------------------------------------------------------------- //
307 // EXPOSURE
308 // --------------------------------------------------------------------- //
318 USDLUX_API
320
326 USDLUX_API
327 UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
328
329public:
330 // --------------------------------------------------------------------- //
331 // DIFFUSE
332 // --------------------------------------------------------------------- //
341 USDLUX_API
343
349 USDLUX_API
350 UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
351
352public:
353 // --------------------------------------------------------------------- //
354 // SPECULAR
355 // --------------------------------------------------------------------- //
364 USDLUX_API
366
372 USDLUX_API
373 UsdAttribute CreateSpecularAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
374
375public:
376 // --------------------------------------------------------------------- //
377 // NORMALIZE
378 // --------------------------------------------------------------------- //
389 USDLUX_API
391
397 USDLUX_API
398 UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
399
400public:
401 // --------------------------------------------------------------------- //
402 // COLOR
403 // --------------------------------------------------------------------- //
411 USDLUX_API
413
419 USDLUX_API
420 UsdAttribute CreateColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
421
422public:
423 // --------------------------------------------------------------------- //
424 // ENABLECOLORTEMPERATURE
425 // --------------------------------------------------------------------- //
433 USDLUX_API
435
441 USDLUX_API
442 UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
443
444public:
445 // --------------------------------------------------------------------- //
446 // COLORTEMPERATURE
447 // --------------------------------------------------------------------- //
461 USDLUX_API
463
469 USDLUX_API
470 UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
471
472public:
473 // --------------------------------------------------------------------- //
474 // FILTERS
475 // --------------------------------------------------------------------- //
478 USDLUX_API
480
483 USDLUX_API
485
486public:
487 // ===================================================================== //
488 // Feel free to add custom code below this line, it will be preserved by
489 // the code generator.
490 //
491 // Just remember to:
492 // - Close the class declaration with };
493 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
494 // - Close the include guard with #endif
495 // ===================================================================== //
496 // --(BEGIN CUSTOM CODE)--
497
498 // -------------------------------------------------------------------------
502
505 USDLUX_API
507
516 USDLUX_API
518
520
521 // -------------------------------------------------------------------------
528
534 USDLUX_API
536 const SdfValueTypeName& typeName);
537
540 USDLUX_API
541 UsdShadeOutput GetOutput(const TfToken &name) const;
542
547 USDLUX_API
548 std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
549
551
552 // -------------------------------------------------------------------------
553
561
566 USDLUX_API
568 const SdfValueTypeName& typeName);
569
572 USDLUX_API
573 UsdShadeInput GetInput(const TfToken &name) const;
574
579 USDLUX_API
580 std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
581
583
587 USDLUX_API
589
593 USDLUX_API
595
610 USDLUX_API
612 const TfToken &renderContext) const;
613
621 USDLUX_API
623 const TfToken &renderContext,
624 VtValue const &defaultValue = VtValue(),
625 bool writeSparsely=false) const;
626
642 USDLUX_API
643 TfToken GetShaderId(const TfTokenVector &renderContexts) const;
644};
645
646PXR_NAMESPACE_CLOSE_SCOPE
647
648#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Represents a value type name, i.e.
Definition: valueTypeName.h:88
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
TfType represents a dynamic runtime type.
Definition: type.h:65
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
This is a general purpose API schema, used to describe a collection of heterogeneous objects within t...
API schema that imparts the quality of being a light onto a prim.
Definition: lightAPI.h:90
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:101
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:95
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:109
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:134
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128
The base class for all schema types in Usd.
Definition: schemaBase.h:56
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:49
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
Definition: output.h:48
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:129
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:457