add usd-21-11-win64_py39
This commit is contained in:
1 parent
41d23e71ba
commit
ba5e1f7e67
15684 files changed
+3069957
No files matched your search
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// Copyright 2017 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_API_H
|
||||
#define USDLUX_API_H
|
||||
|
||||
#include "pxr/base/arch/export.h"
|
||||
|
||||
#if defined(PXR_STATIC)
|
||||
# define USDLUX_API
|
||||
# define USDLUX_API_TEMPLATE_CLASS(...)
|
||||
# define USDLUX_API_TEMPLATE_STRUCT(...)
|
||||
# define USDLUX_LOCAL
|
||||
#else
|
||||
# if defined(USDLUX_EXPORTS)
|
||||
# define USDLUX_API ARCH_EXPORT
|
||||
# define USDLUX_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
|
||||
# define USDLUX_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
|
||||
# else
|
||||
# define USDLUX_API ARCH_IMPORT
|
||||
# define USDLUX_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
|
||||
# define USDLUX_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
|
||||
# endif
|
||||
# define USDLUX_LOCAL ARCH_HIDDEN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef PXR_USD_USD_LUX_BLACKBODY_H
|
||||
#define PXR_USD_USD_LUX_BLACKBODY_H
|
||||
|
||||
/// \file usdLux/blackbody.h
|
||||
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
/// Compute the RGB equivalent of the spectrum emitted by a blackbody
|
||||
/// with the given temperature in degrees Kelvin, with normalized
|
||||
/// luminance.
|
||||
USDLUX_API
|
||||
GfVec3f UsdLuxBlackbodyTemperatureAsRgb(float colorTemp);
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_BOUNDABLELIGHTBASE_H
|
||||
#define USDLUX_GENERATED_BOUNDABLELIGHTBASE_H
|
||||
|
||||
/// \file usdLux/boundableLightBase.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdGeom/boundable.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/lightAPI.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// BOUNDABLELIGHTBASE //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxBoundableLightBase
|
||||
///
|
||||
/// Base class for intrinsic lights that are boundable.
|
||||
///
|
||||
/// The primary purpose of this class is to provide a direct API to the
|
||||
/// functions provided by LightAPI for concrete derived light types.
|
||||
///
|
||||
///
|
||||
class UsdLuxBoundableLightBase : public UsdGeomBoundable
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
|
||||
|
||||
/// Construct a UsdLuxBoundableLightBase on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxBoundableLightBase::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxBoundableLightBase(const UsdPrim& prim=UsdPrim())
|
||||
: UsdGeomBoundable(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxBoundableLightBase on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxBoundableLightBase(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxBoundableLightBase(const UsdSchemaBase& schemaObj)
|
||||
: UsdGeomBoundable(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxBoundableLightBase();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxBoundableLightBase holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxBoundableLightBase(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxBoundableLightBase
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
/// \name LightAPI
|
||||
///
|
||||
/// Convenience accessors for the light's built-in UsdLuxLightAPI
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Contructs and returns a UsdLuxLightAPI object for this light.
|
||||
USDLUX_API
|
||||
UsdLuxLightAPI LightAPI() const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetIntensityAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetIntensityAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateIntensityAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateIntensityAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetExposureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetExposureAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateExposureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateExposureAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetDiffuseAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetDiffuseAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateDiffuseAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateDiffuseAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetSpecularAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetSpecularAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateSpecularAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateSpecularAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetNormalizeAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetNormalizeAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateNormalizeAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateNormalizeAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetColorAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetColorAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateColorAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateColorAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetEnableColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetEnableColorTemperatureAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateEnableColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateEnableColorTemperatureAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetColorTemperatureAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateColorTemperatureAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetFiltersRel().
|
||||
USDLUX_API
|
||||
UsdRelationship GetFiltersRel() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateFiltersRel().
|
||||
USDLUX_API
|
||||
UsdRelationship CreateFiltersRel() const;
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,243 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_CYLINDERLIGHT_H
|
||||
#define USDLUX_GENERATED_CYLINDERLIGHT_H
|
||||
|
||||
/// \file usdLux/cylinderLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/boundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// CYLINDERLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxCylinderLight
|
||||
///
|
||||
/// Light emitted outward from a cylinder.
|
||||
/// The cylinder is centered at the origin and has its major axis on the X axis.
|
||||
/// The cylinder does not emit light from the flat end-caps.
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxCylinderLight : public UsdLuxBoundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxCylinderLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxCylinderLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxCylinderLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxBoundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxCylinderLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxCylinderLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxCylinderLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxBoundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxCylinderLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxCylinderLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxCylinderLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxCylinderLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxCylinderLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// LENGTH
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Width of the rectangle, in the local X axis.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:length = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetLengthAttr() const;
|
||||
|
||||
/// See GetLengthAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateLengthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// RADIUS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Radius of the cylinder.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:radius = 0.5` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetRadiusAttr() const;
|
||||
|
||||
/// See GetRadiusAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// TREATASLINE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A hint that this light can be treated as a 'line'
|
||||
/// light (effectively, a zero-radius cylinder) by renderers that
|
||||
/// benefit from non-area lighting. Renderers that only support
|
||||
/// area lights can disregard this.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `bool treatAsLine = 0` |
|
||||
/// | C++ Type | bool |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
|
||||
USDLUX_API
|
||||
UsdAttribute GetTreatAsLineAttr() const;
|
||||
|
||||
/// See GetTreatAsLineAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateTreatAsLineAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,194 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_DISKLIGHT_H
|
||||
#define USDLUX_GENERATED_DISKLIGHT_H
|
||||
|
||||
/// \file usdLux/diskLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/boundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// DISKLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxDiskLight
|
||||
///
|
||||
/// Light emitted from one side of a circular disk.
|
||||
/// The disk is centered in the XY plane and emits light along the -Z axis.
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxDiskLight : public UsdLuxBoundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxDiskLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxDiskLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxDiskLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxBoundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxDiskLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxDiskLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxDiskLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxBoundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxDiskLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxDiskLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxDiskLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxDiskLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxDiskLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// RADIUS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Radius of the disk.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:radius = 0.5` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetRadiusAttr() const;
|
||||
|
||||
/// See GetRadiusAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,220 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_DISTANTLIGHT_H
|
||||
#define USDLUX_GENERATED_DISTANTLIGHT_H
|
||||
|
||||
/// \file usdLux/distantLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/nonboundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// DISTANTLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxDistantLight
|
||||
///
|
||||
/// Light emitted from a distant source along the -Z axis.
|
||||
/// Also known as a directional light.
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxDistantLight : public UsdLuxNonboundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxDistantLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxDistantLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxDistantLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxNonboundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxDistantLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxDistantLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxDistantLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxNonboundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxDistantLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxDistantLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxDistantLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxDistantLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxDistantLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// ANGLE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Angular size of the light in degrees.
|
||||
/// As an example, the Sun is approximately 0.53 degrees as seen from Earth.
|
||||
/// Higher values broaden the light and therefore soften shadow edges.
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:angle = 0.53` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetAngleAttr() const;
|
||||
|
||||
/// See GetAngleAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateAngleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// INTENSITY
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Scales the emission of the light linearly.
|
||||
/// The DistantLight has a high default intensity to approximate the Sun.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:intensity = 50000` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetIntensityAttr() const;
|
||||
|
||||
/// See GetIntensityAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,279 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_DOMELIGHT_H
|
||||
#define USDLUX_GENERATED_DOMELIGHT_H
|
||||
|
||||
/// \file usdLux/domeLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/nonboundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// DOMELIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxDomeLight
|
||||
///
|
||||
/// Light emitted inward from a distant external environment,
|
||||
/// such as a sky or IBL light probe. The orientation of a dome light with a
|
||||
/// latlong texture is expected to match the OpenEXR specification for latlong
|
||||
/// environment maps. From the OpenEXR documentation:
|
||||
///
|
||||
/// -------------------------------------------------------------------------
|
||||
/// Latitude-Longitude Map:
|
||||
///
|
||||
/// The environment is projected onto the image using polar coordinates
|
||||
/// (latitude and longitude). A pixel's x coordinate corresponds to
|
||||
/// its longitude, and the y coordinate corresponds to its latitude.
|
||||
/// Pixel (dataWindow.min.x, dataWindow.min.y) has latitude +pi/2 and
|
||||
/// longitude +pi; pixel (dataWindow.max.x, dataWindow.max.y) has
|
||||
/// latitude -pi/2 and longitude -pi.
|
||||
///
|
||||
/// In 3D space, latitudes -pi/2 and +pi/2 correspond to the negative and
|
||||
/// positive y direction. Latitude 0, longitude 0 points into positive
|
||||
/// z direction; and latitude 0, longitude pi/2 points into positive x
|
||||
/// direction.
|
||||
///
|
||||
/// The size of the data window should be 2*N by N pixels (width by height),
|
||||
/// where N can be any integer greater than 0.
|
||||
/// -------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxDomeLight : public UsdLuxNonboundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxDomeLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxDomeLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxDomeLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxNonboundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxDomeLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxDomeLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxDomeLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxNonboundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxDomeLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxDomeLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxDomeLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxDomeLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxDomeLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// TEXTUREFILE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A color texture to use on the dome, such as an HDR (high
|
||||
/// dynamic range) texture intended for IBL (image based lighting).
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `asset inputs:texture:file` |
|
||||
/// | C++ Type | SdfAssetPath |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
|
||||
USDLUX_API
|
||||
UsdAttribute GetTextureFileAttr() const;
|
||||
|
||||
/// See GetTextureFileAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateTextureFileAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// TEXTUREFORMAT
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Specifies the parameterization of the color map file.
|
||||
/// Valid values are:
|
||||
/// - automatic: Tries to determine the layout from the file itself.
|
||||
/// For example, Renderman texture files embed an explicit
|
||||
/// parameterization.
|
||||
/// - latlong: Latitude as X, longitude as Y.
|
||||
/// - mirroredBall: An image of the environment reflected in a
|
||||
/// sphere, using an implicitly orthogonal projection.
|
||||
/// - angular: Similar to mirroredBall but the radial dimension
|
||||
/// is mapped linearly to the angle, providing better sampling
|
||||
/// at the edges.
|
||||
/// - cubeMapVerticalCross: A cube map with faces laid out as a
|
||||
/// vertical cross.
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token inputs:texture:format = "automatic"` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref UsdLuxTokens "Allowed Values" | automatic, latlong, mirroredBall, angular, cubeMapVerticalCross |
|
||||
USDLUX_API
|
||||
UsdAttribute GetTextureFormatAttr() const;
|
||||
|
||||
/// See GetTextureFormatAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateTextureFormatAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// PORTALS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Optional portals to guide light sampling.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdRelationship GetPortalsRel() const;
|
||||
|
||||
/// See GetPortalsRel(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
|
||||
USDLUX_API
|
||||
UsdRelationship CreatePortalsRel() const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
/// Adds a transformation op, if neeeded, to orient the dome to align with
|
||||
/// the stage's up axis. Uses UsdLuxTokens->orientToStageUpAxis as the op
|
||||
/// suffix. If an op with this suffix already exists, this method assumes
|
||||
/// it is already applying the proper correction and does nothing further.
|
||||
/// If no op is required to match the stage's up axis, no op will be
|
||||
/// created.
|
||||
///
|
||||
/// \see UsdGeomXformOp
|
||||
/// \see UsdGeomGetStageUpAxis
|
||||
USDLUX_API
|
||||
void OrientToStageUpAxis() const;
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,187 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_GEOMETRYLIGHT_H
|
||||
#define USDLUX_GENERATED_GEOMETRYLIGHT_H
|
||||
|
||||
/// \file usdLux/geometryLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/nonboundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// GEOMETRYLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxGeometryLight
|
||||
///
|
||||
/// \deprecated
|
||||
/// Light emitted outward from a geometric prim (UsdGeomGprim),
|
||||
/// which is typically a mesh.
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxGeometryLight : public UsdLuxNonboundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxGeometryLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxGeometryLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxGeometryLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxNonboundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxGeometryLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxGeometryLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxGeometryLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxNonboundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxGeometryLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxGeometryLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxGeometryLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxGeometryLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxGeometryLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// GEOMETRY
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Relationship to the geometry to use as the light source.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdRelationship GetGeometryRel() const;
|
||||
|
||||
/// See GetGeometryRel(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
|
||||
USDLUX_API
|
||||
UsdRelationship CreateGeometryRel() const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,648 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_LIGHTAPI_H
|
||||
#define USDLUX_GENERATED_LIGHTAPI_H
|
||||
|
||||
/// \file usdLux/lightAPI.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usd/apiSchemaBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/usd/usd/collectionAPI.h"
|
||||
#include "pxr/usd/usdShade/input.h"
|
||||
#include "pxr/usd/usdShade/output.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// LIGHTAPI //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxLightAPI
|
||||
///
|
||||
/// API schema that imparts the quality of being a light onto a prim.
|
||||
///
|
||||
/// A light is any prim that has this schema applied to it. This is true
|
||||
/// regardless of whether LightAPI is included as a built-in API of the prim
|
||||
/// type (e.g. RectLight or DistantLight) or is applied directly to a Gprim
|
||||
/// that should be treated as a light.
|
||||
///
|
||||
/// <b>Linking</b>
|
||||
///
|
||||
/// Lights can be linked to geometry. Linking controls which geometry
|
||||
/// a light illuminates, and which geometry casts shadows from the light.
|
||||
///
|
||||
/// Linking is specified as collections (UsdCollectionAPI) which can
|
||||
/// be accessed via GetLightLinkCollection() and GetShadowLinkCollection().
|
||||
/// Note that these collections have their includeRoot set to true,
|
||||
/// so that lights will illuminate and cast shadows from all objects
|
||||
/// by default. To illuminate only a specific set of objects, there
|
||||
/// are two options. One option is to modify the collection paths
|
||||
/// to explicitly exclude everything else, assuming it is known;
|
||||
/// the other option is to set includeRoot to false and explicitly
|
||||
/// include the desired objects. These are complementary approaches
|
||||
/// that may each be preferable depending on the scenario and how
|
||||
/// to best express the intent of the light setup.
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxLightAPI : public UsdAPISchemaBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
|
||||
|
||||
/// Construct a UsdLuxLightAPI on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxLightAPI::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxLightAPI(const UsdPrim& prim=UsdPrim())
|
||||
: UsdAPISchemaBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxLightAPI on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxLightAPI(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxLightAPI(const UsdSchemaBase& schemaObj)
|
||||
: UsdAPISchemaBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxLightAPI();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxLightAPI holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxLightAPI(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxLightAPI
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
/// Returns true if this <b>single-apply</b> API schema can be applied to
|
||||
/// the given \p prim. If this schema can not be a applied to the prim,
|
||||
/// this returns false and, if provided, populates \p whyNot with the
|
||||
/// reason it can not be applied.
|
||||
///
|
||||
/// Note that if CanApply returns false, that does not necessarily imply
|
||||
/// that calling Apply will fail. Callers are expected to call CanApply
|
||||
/// before calling Apply if they want to ensure that it is valid to
|
||||
/// apply a schema.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static bool
|
||||
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
|
||||
|
||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||
/// This information is stored by adding "LightAPI" to the
|
||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||
///
|
||||
/// \return A valid UsdLuxLightAPI object is returned upon success.
|
||||
/// An invalid (or empty) UsdLuxLightAPI object is returned upon
|
||||
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
|
||||
/// resulting in failure.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxLightAPI
|
||||
Apply(const UsdPrim &prim);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADERID
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Default ID for the light's shader.
|
||||
/// This defines the shader ID for this light when a render context specific
|
||||
/// shader ID is not available.
|
||||
///
|
||||
/// The default shaderId for the intrinsic UsdLux lights (RectLight,
|
||||
/// DistantLight, etc.) are set to default to the light's type name. For
|
||||
/// each intrinsic UsdLux light, we will always register an SdrShaderNode in
|
||||
/// the SdrRegistry, with the identifier matching the type name and the
|
||||
/// source type "USD", that corresponds to the light's inputs.
|
||||
/// \see GetShaderId
|
||||
/// \see GetShaderIdAttrForRenderContext
|
||||
/// \see SdrRegistry::GetShaderNodeByIdentifier
|
||||
/// \see SdrRegistry::GetShaderNodeByIdentifierAndType
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `uniform token light:shaderId = ""` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShaderIdAttr() const;
|
||||
|
||||
/// See GetShaderIdAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShaderIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// MATERIALSYNCMODE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// For a LightAPI applied to geometry that has a bound Material,
|
||||
/// which is entirely or partly emissive, this specifies the relationship
|
||||
/// of the Material response to the lighting response.
|
||||
/// Valid values are:
|
||||
/// - materialGlowTintsLight: All primary and secondary rays see the
|
||||
/// emissive/glow response as dictated by the bound Material while the
|
||||
/// base color seen by light rays (which is then modulated by all of the
|
||||
/// other LightAPI controls) is the multiplication of the color feeding
|
||||
/// the emission/glow input of the Material (i.e. its surface or volume
|
||||
/// shader) with the scalar or pattern input to *inputs:color*.
|
||||
/// This allows the light's color to tint the geometry's glow color while
|
||||
/// preserving access to intensity and other light controls as ways to
|
||||
/// further modulate the illumination.
|
||||
/// - independent: All primary and secondary rays see the emissive/glow
|
||||
/// response as dictated by the bound Material, while the base color seen
|
||||
/// by light rays is determined solely by *inputs:color*. Note that for
|
||||
/// partially emissive geometry (in which some parts are reflective
|
||||
/// rather than emissive), a suitable pattern must be connected to the
|
||||
/// light's color input, or else the light will radiate uniformly from
|
||||
/// the geometry.
|
||||
/// - noMaterialResponse: The geometry behaves as if there is no Material
|
||||
/// bound at all, i.e. there is no diffuse, specular, or transmissive
|
||||
/// response. The base color of light rays is entirely controlled by the
|
||||
/// *inputs:color*. This is the standard mode for "canonical" lights in
|
||||
/// UsdLux and indicates to renderers that a Material will either never
|
||||
/// be bound or can always be ignored.
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `uniform token light:materialSyncMode = "noMaterialResponse"` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
|
||||
/// | \ref UsdLuxTokens "Allowed Values" | materialGlowTintsLight, independent, noMaterialResponse |
|
||||
USDLUX_API
|
||||
UsdAttribute GetMaterialSyncModeAttr() const;
|
||||
|
||||
/// See GetMaterialSyncModeAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateMaterialSyncModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// INTENSITY
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Scales the power of the light linearly.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:intensity = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetIntensityAttr() const;
|
||||
|
||||
/// See GetIntensityAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// EXPOSURE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Scales the power of the light exponentially as a power
|
||||
/// of 2 (similar to an F-stop control over exposure). The result
|
||||
/// is multiplied against the intensity.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:exposure = 0` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetExposureAttr() const;
|
||||
|
||||
/// See GetExposureAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// DIFFUSE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A multiplier for the effect of this light on the diffuse
|
||||
/// response of materials. This is a non-physical control.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:diffuse = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetDiffuseAttr() const;
|
||||
|
||||
/// See GetDiffuseAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SPECULAR
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A multiplier for the effect of this light on the specular
|
||||
/// response of materials. This is a non-physical control.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:specular = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetSpecularAttr() const;
|
||||
|
||||
/// See GetSpecularAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateSpecularAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// NORMALIZE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Normalizes power by the surface area of the light.
|
||||
/// This makes it easier to independently adjust the power and shape
|
||||
/// of the light, by causing the power to not vary with the area or
|
||||
/// angular size of the light.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `bool inputs:normalize = 0` |
|
||||
/// | C++ Type | bool |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
|
||||
USDLUX_API
|
||||
UsdAttribute GetNormalizeAttr() const;
|
||||
|
||||
/// See GetNormalizeAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// COLOR
|
||||
// --------------------------------------------------------------------- //
|
||||
/// The color of emitted light, in energy-linear terms.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `color3f inputs:color = (1, 1, 1)` |
|
||||
/// | C++ Type | GfVec3f |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Color3f |
|
||||
USDLUX_API
|
||||
UsdAttribute GetColorAttr() const;
|
||||
|
||||
/// See GetColorAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// ENABLECOLORTEMPERATURE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Enables using colorTemperature.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `bool inputs:enableColorTemperature = 0` |
|
||||
/// | C++ Type | bool |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
|
||||
USDLUX_API
|
||||
UsdAttribute GetEnableColorTemperatureAttr() const;
|
||||
|
||||
/// See GetEnableColorTemperatureAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// COLORTEMPERATURE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Color temperature, in degrees Kelvin, representing the
|
||||
/// white point. The default is a common white point, D65. Lower
|
||||
/// values are warmer and higher values are cooler. The valid range
|
||||
/// is from 1000 to 10000. Only takes effect when
|
||||
/// enableColorTemperature is set to true. When active, the
|
||||
/// computed result multiplies against the color attribute.
|
||||
/// See UsdLuxBlackbodyTemperatureAsRgb().
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:colorTemperature = 6500` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetColorTemperatureAttr() const;
|
||||
|
||||
/// See GetColorTemperatureAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FILTERS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Relationship to the light filters that apply to this light.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdRelationship GetFiltersRel() const;
|
||||
|
||||
/// See GetFiltersRel(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
|
||||
USDLUX_API
|
||||
UsdRelationship CreateFiltersRel() const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Conversion to and from UsdShadeConnectableAPI
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Constructor that takes a ConnectableAPI object.
|
||||
/// Allow implicit conversion of a UsdShadeConnectableAPI to UsdLuxLightAPI
|
||||
USDLUX_API
|
||||
UsdLuxLightAPI(const UsdShadeConnectableAPI &connectable);
|
||||
|
||||
/// Contructs and returns a UsdShadeConnectableAPI object with this light.
|
||||
///
|
||||
/// Note that most tasks can be accomplished without explicitly constructing
|
||||
/// a UsdShadeConnectable API, since connection-related API such as
|
||||
/// UsdShadeConnectableAPI::ConnectToSource() are static methods, and
|
||||
/// UsdLuxLightAPI will auto-convert to a UsdShadeConnectableAPI when
|
||||
/// passed to functions that want to act generically on a connectable
|
||||
/// UsdShadeConnectableAPI object.
|
||||
USDLUX_API
|
||||
UsdShadeConnectableAPI ConnectableAPI() const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Outputs API
|
||||
///
|
||||
/// Outputs represent a typed attribute on a light whose value is computed
|
||||
/// externally.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an output which can either have a value or can be connected.
|
||||
/// The attribute representing the output is created in the "outputs:"
|
||||
/// namespace. Outputs on a light cannot be connected, as their
|
||||
/// value is assumed to be computed externally.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput CreateOutput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested output if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput GetOutput(const TfToken &name) const;
|
||||
|
||||
/// Outputs are represented by attributes in the "outputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/// \name Inputs API
|
||||
///
|
||||
/// Inputs are connectable attribute with a typed value.
|
||||
///
|
||||
/// Light parameters are encoded as inputs.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an input which can either have a value or can be connected.
|
||||
/// The attribute representing the input is created in the "inputs:"
|
||||
/// namespace. Inputs on lights are connectable.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput CreateInput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested input if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput GetInput(const TfToken &name) const;
|
||||
|
||||
/// Inputs are represented by attributes in the "inputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
|
||||
/// Return the UsdCollectionAPI interface used for examining and
|
||||
/// modifying the light-linking of this light. Light-linking
|
||||
/// controls which geometry this light illuminates.
|
||||
USDLUX_API
|
||||
UsdCollectionAPI GetLightLinkCollectionAPI() const;
|
||||
|
||||
/// Return the UsdCollectionAPI interface used for examining and
|
||||
/// modifying the shadow-linking of this light. Shadow-linking
|
||||
/// controls which geometry casts shadows from this light.
|
||||
USDLUX_API
|
||||
UsdCollectionAPI GetShadowLinkCollectionAPI() const;
|
||||
|
||||
/// Returns the shader ID attribute for the given \p renderContext.
|
||||
///
|
||||
/// If \p renderContext is non-empty, this will try to return an attribute
|
||||
/// named _light:shaderId_ with the namespace prefix \p renderContext. For
|
||||
/// example, if the passed in render context is "ri" then the attribute
|
||||
/// returned by this function would have the following signature:
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token ri:light:shaderId` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
///
|
||||
/// If the render context is empty, this will return the default shader ID
|
||||
/// attribute as returned by GetShaderIdAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetShaderIdAttrForRenderContext(
|
||||
const TfToken &renderContext) const;
|
||||
|
||||
/// Creates the shader ID attribute for the given \p renderContext.
|
||||
///
|
||||
/// See GetShaderIdAttrForRenderContext(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShaderIdAttrForRenderContext(
|
||||
const TfToken &renderContext,
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// Return the light's shader ID for the given list of available
|
||||
/// \p renderContexts.
|
||||
///
|
||||
/// The shader ID returned by this function is the identifier to use when
|
||||
/// looking up the shader definition for this light in the
|
||||
/// \ref SdrRegistry "shader registry".
|
||||
///
|
||||
/// The render contexts are expected to be listed in priority order, so
|
||||
/// for each render context provided, this will try to find the shader ID
|
||||
/// attribute specific to that render context (see
|
||||
/// GetShaderIdAttrForRenderContext()) and will return the
|
||||
/// value of the first one found that has a non-empty value. If no shader ID
|
||||
/// value can be found for any of the given render contexts or
|
||||
/// \p renderContexts is empty, then this will return the value of the
|
||||
/// default shader ID attribute (see GetShaderIdAttr()).
|
||||
USDLUX_API
|
||||
TfToken GetShaderId(const TfTokenVector &renderContexts) const;
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,362 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_LIGHTFILTER_H
|
||||
#define USDLUX_GENERATED_LIGHTFILTER_H
|
||||
|
||||
/// \file usdLux/lightFilter.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdGeom/xformable.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/usd/usd/collectionAPI.h"
|
||||
#include "pxr/usd/usdShade/input.h"
|
||||
#include "pxr/usd/usdShade/output.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// LIGHTFILTER //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxLightFilter
|
||||
///
|
||||
/// A light filter modifies the effect of a light.
|
||||
/// Lights refer to filters via relationships so that filters may be
|
||||
/// shared.
|
||||
///
|
||||
/// <b>Linking</b>
|
||||
///
|
||||
/// Filters can be linked to geometry. Linking controls which geometry
|
||||
/// a light-filter affects, when considering the light filters attached
|
||||
/// to a light illuminating the geometry.
|
||||
///
|
||||
/// Linking is specified as a collection (UsdCollectionAPI) which can
|
||||
/// be accessed via GetFilterLinkCollection().
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxLightFilter : public UsdGeomXformable
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxLightFilter on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxLightFilter::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxLightFilter(const UsdPrim& prim=UsdPrim())
|
||||
: UsdGeomXformable(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxLightFilter on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxLightFilter(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxLightFilter(const UsdSchemaBase& schemaObj)
|
||||
: UsdGeomXformable(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxLightFilter();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxLightFilter holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxLightFilter(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxLightFilter
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxLightFilter
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADERID
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Default ID for the light filter's shader.
|
||||
/// This defines the shader ID for this light filter when a render context
|
||||
/// specific shader ID is not available.
|
||||
///
|
||||
/// \see GetShaderId
|
||||
/// \see GetShaderIdAttrForRenderContext
|
||||
/// \see SdrRegistry::GetShaderNodeByIdentifier
|
||||
/// \see SdrRegistry::GetShaderNodeByIdentifierAndType
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `uniform token lightFilter:shaderId = ""` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShaderIdAttr() const;
|
||||
|
||||
/// See GetShaderIdAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShaderIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Conversion to and from UsdShadeConnectableAPI
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Constructor that takes a ConnectableAPI object.
|
||||
/// Allow implicit conversion of UsdShadeConnectableAPI to
|
||||
/// UsdLuxLightFilter.
|
||||
USDLUX_API
|
||||
UsdLuxLightFilter(const UsdShadeConnectableAPI &connectable);
|
||||
|
||||
/// Contructs and returns a UsdShadeConnectableAPI object with this light
|
||||
/// filter.
|
||||
///
|
||||
/// Note that most tasks can be accomplished without explicitly constructing
|
||||
/// a UsdShadeConnectable API, since connection-related API such as
|
||||
/// UsdShadeConnectableAPI::ConnectToSource() are static methods, and
|
||||
/// UsdLuxLightFilter will auto-convert to a UsdShadeConnectableAPI when
|
||||
/// passed to functions that want to act generically on a connectable
|
||||
/// UsdShadeConnectableAPI object.
|
||||
USDLUX_API
|
||||
UsdShadeConnectableAPI ConnectableAPI() const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Outputs API
|
||||
///
|
||||
/// Outputs represent a typed attribute on a light filter whose value is
|
||||
/// computed externally.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an output which can either have a value or can be connected.
|
||||
/// The attribute representing the output is created in the "outputs:"
|
||||
/// namespace. Outputs on a light filter cannot be connected, as their
|
||||
/// value is assumed to be computed externally.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput CreateOutput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested output if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput GetOutput(const TfToken &name) const;
|
||||
|
||||
/// Outputs are represented by attributes in the "outputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/// \name Inputs API
|
||||
///
|
||||
/// Inputs are connectable attribute with a typed value.
|
||||
///
|
||||
/// Light filter parameters are encoded as inputs.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an input which can either have a value or can be connected.
|
||||
/// The attribute representing the input is created in the "inputs:"
|
||||
/// namespace. Inputs on light filters are connectable.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput CreateInput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested input if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput GetInput(const TfToken &name) const;
|
||||
|
||||
/// Inputs are represented by attributes in the "inputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
|
||||
/// Return the UsdCollectionAPI interface used for examining and
|
||||
/// modifying the filter-linking of this light filter. Linking
|
||||
/// controls which geometry this light filter affects.
|
||||
USDLUX_API
|
||||
UsdCollectionAPI GetFilterLinkCollectionAPI() const;
|
||||
|
||||
/// Returns the shader ID attribute for the given \p renderContext.
|
||||
///
|
||||
/// If \p renderContext is non-empty, this will try to return an attribute
|
||||
/// named _lightFilter:shaderId_ with the namespace prefix \p renderContext.
|
||||
/// For example, if the passed in render context is "ri" then the attribute
|
||||
/// returned by this function would have the following signature:
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token ri:lightFilter:shaderId` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
///
|
||||
/// If the render context is empty, this will return the default shader ID
|
||||
/// attribute as returned by GetShaderIdAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetShaderIdAttrForRenderContext(
|
||||
const TfToken &renderContext) const;
|
||||
|
||||
/// Creates the shader ID attribute for the given \p renderContext.
|
||||
///
|
||||
/// See GetShaderIdAttrForRenderContext(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShaderIdAttrForRenderContext(
|
||||
const TfToken &renderContext,
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// Return the light filter's shader ID for the given list of available
|
||||
/// \p renderContexts.
|
||||
///
|
||||
/// The shader ID returned by this function is the identifier to use when
|
||||
/// looking up the shader definition for this light filter in the
|
||||
/// \ref SdrRegistry "shader registry".
|
||||
///
|
||||
/// The render contexts are expected to be listed in priority order, so
|
||||
/// for each render context provided, this will try to find the shader ID
|
||||
/// attribute specific to that render context (see
|
||||
/// GetShaderIdAttrForRenderContext()) and will return the
|
||||
/// value of the first one found that has a non-empty value. If no shader ID
|
||||
/// value can be found for any of the given render contexts or
|
||||
/// \p renderContexts is empty, then this will return the value of the
|
||||
/// default shader ID attribute (see GetShaderIdAttr()).
|
||||
USDLUX_API
|
||||
TfToken GetShaderId(const TfTokenVector &renderContexts) const;
|
||||
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,395 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_LISTAPI_H
|
||||
#define USDLUX_GENERATED_LISTAPI_H
|
||||
|
||||
/// \file usdLux/listAPI.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usd/apiSchemaBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// LISTAPI //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxListAPI
|
||||
///
|
||||
/// API schema to support discovery and publishing of lights in a scene.
|
||||
///
|
||||
/// \section UsdLuxListAPI_Discovery Discovering Lights via Traversal
|
||||
///
|
||||
/// To motivate this API, consider what is required to discover all
|
||||
/// lights in a scene. We must load all payloads and traverse all prims:
|
||||
///
|
||||
/// \code
|
||||
/// 01 // Load everything on the stage so we can find all lights,
|
||||
/// 02 // including those inside payloads
|
||||
/// 03 stage->Load();
|
||||
/// 04
|
||||
/// 05 // Traverse all prims, checking if they have an applied UsdLuxLightAPI
|
||||
/// 06 // (Note: ignoring instancing and a few other things for simplicity)
|
||||
/// 07 SdfPathVector lights;
|
||||
/// 08 for (UsdPrim prim: stage->Traverse()) {
|
||||
/// 09 if (prim.HasAPI<UsdLuxLightAPI>()) {
|
||||
/// 10 lights.push_back(i->GetPath());
|
||||
/// 11 }
|
||||
/// 12 }
|
||||
/// \endcode
|
||||
///
|
||||
/// This traversal -- suitably elaborated to handle certain details --
|
||||
/// is the first and simplest thing UsdLuxListAPI provides.
|
||||
/// UsdLuxListAPI::ComputeLightList() performs this traversal and returns
|
||||
/// all lights in the scene:
|
||||
///
|
||||
/// \code
|
||||
/// 01 UsdLuxListAPI listAPI(stage->GetPseudoRoot());
|
||||
/// 02 SdfPathVector lights = listAPI.ComputeLightList();
|
||||
/// \endcode
|
||||
///
|
||||
/// \section UsdLuxListAPI_LightList Publishing a Cached Light List
|
||||
///
|
||||
/// Consider a USD client that needs to quickly discover lights but
|
||||
/// wants to defer loading payloads and traversing the entire scene
|
||||
/// where possible, and is willing to do up-front computation and
|
||||
/// caching to achieve that.
|
||||
///
|
||||
/// UsdLuxListAPI provides a way to cache the computed light list,
|
||||
/// by publishing the list of lights onto prims in the model
|
||||
/// hierarchy. Consider a big set that contains lights:
|
||||
///
|
||||
/// \code
|
||||
/// 01 def Xform "BigSetWithLights" (
|
||||
/// 02 kind = "assembly"
|
||||
/// 03 payload = @BigSetWithLights.usd@ // Heavy payload
|
||||
/// 04 ) {
|
||||
/// 05 // Pre-computed, cached list of lights inside payload
|
||||
/// 06 rel lightList = [
|
||||
/// 07 <./Lights/light_1>,
|
||||
/// 08 <./Lights/light_2>,
|
||||
/// 09 ...
|
||||
/// 10 ]
|
||||
/// 11 token lightList:cacheBehavior = "consumeAndContinue";
|
||||
/// 12 }
|
||||
/// \endcode
|
||||
///
|
||||
/// The lightList relationship encodes a set of lights, and the
|
||||
/// lightList:cacheBehavior property provides fine-grained
|
||||
/// control over how to use that cache. (See details below.)
|
||||
///
|
||||
/// The cache can be created by first invoking
|
||||
/// ComputeLightList(ComputeModeIgnoreCache) to pre-compute the list
|
||||
/// and then storing the result with UsdLuxListAPI::StoreLightList().
|
||||
///
|
||||
/// To enable efficient retrieval of the cache, it should be stored
|
||||
/// on a model hierarchy prim. Furthermore, note that while you can
|
||||
/// use a UsdLuxListAPI bound to the pseudo-root prim to query the
|
||||
/// lights (as in the example above) because it will perform a
|
||||
/// traversal over descendants, you cannot store the cache back to the
|
||||
/// pseduo-root prim.
|
||||
///
|
||||
/// To consult the cached list, we invoke
|
||||
/// ComputeLightList(ComputeModeConsultModelHierarchyCache):
|
||||
///
|
||||
/// \code
|
||||
/// 01 // Find and load all lights, using lightList cache where available
|
||||
/// 02 UsdLuxListAPI list(stage->GetPseudoRoot());
|
||||
/// 03 SdfPathSet lights = list.ComputeLightList(
|
||||
/// 04 UsdLuxListAPI::ComputeModeConsultModelHierarchyCache);
|
||||
/// 05 stage.LoadAndUnload(lights, SdfPathSet());
|
||||
/// \endcode
|
||||
///
|
||||
/// In this mode, ComputeLightList() will traverse the model
|
||||
/// hierarchy, accumulating cached light lists.
|
||||
///
|
||||
/// \section UsdLuxListAPI_CacheBehavior Controlling Cache Behavior
|
||||
///
|
||||
/// The lightList:cacheBehavior property gives additional fine-grained
|
||||
/// control over cache behavior:
|
||||
///
|
||||
/// \li The fallback value, "ignore", indicates that the lightList should
|
||||
/// be disregarded. This provides a way to invalidate cache entries.
|
||||
/// Note that unless "ignore" is specified, a lightList with an empty
|
||||
/// list of targets is considered a cache indicating that no lights
|
||||
/// are present.
|
||||
///
|
||||
/// \li The value "consumeAndContinue" indicates that the cache should
|
||||
/// be consulted to contribute lights to the scene, and that recursion
|
||||
/// should continue down the model hierarchy in case additional lights
|
||||
/// are added as descedants. This is the default value established when
|
||||
/// StoreLightList() is invoked. This behavior allows the lights within
|
||||
/// a large model, such as the BigSetWithLights example above, to be
|
||||
/// published outside the payload, while also allowing referencing and
|
||||
/// layering to add additional lights over that set.
|
||||
///
|
||||
/// \li The value "consumeAndHalt" provides a way to terminate recursive
|
||||
/// traversal of the scene for light discovery. The cache will be
|
||||
/// consulted but no descendant prims will be examined.
|
||||
///
|
||||
/// \section UsdLuxListAPI_Instancing Instancing
|
||||
///
|
||||
/// Where instances are present, UsdLuxListAPI::ComputeLightList() will
|
||||
/// return the instance-unique paths to any lights discovered within
|
||||
/// those instances. Lights within a UsdGeomPointInstancer will
|
||||
/// not be returned, however, since they cannot be referred to
|
||||
/// solely via paths.
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxListAPI : public UsdAPISchemaBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
|
||||
|
||||
/// Construct a UsdLuxListAPI on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxListAPI::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxListAPI(const UsdPrim& prim=UsdPrim())
|
||||
: UsdAPISchemaBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxListAPI on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxListAPI(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxListAPI(const UsdSchemaBase& schemaObj)
|
||||
: UsdAPISchemaBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxListAPI();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxListAPI holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxListAPI(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxListAPI
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
/// Returns true if this <b>single-apply</b> API schema can be applied to
|
||||
/// the given \p prim. If this schema can not be a applied to the prim,
|
||||
/// this returns false and, if provided, populates \p whyNot with the
|
||||
/// reason it can not be applied.
|
||||
///
|
||||
/// Note that if CanApply returns false, that does not necessarily imply
|
||||
/// that calling Apply will fail. Callers are expected to call CanApply
|
||||
/// before calling Apply if they want to ensure that it is valid to
|
||||
/// apply a schema.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static bool
|
||||
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
|
||||
|
||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||
/// This information is stored by adding "ListAPI" to the
|
||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||
///
|
||||
/// \return A valid UsdLuxListAPI object is returned upon success.
|
||||
/// An invalid (or empty) UsdLuxListAPI object is returned upon
|
||||
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
|
||||
/// resulting in failure.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxListAPI
|
||||
Apply(const UsdPrim &prim);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// LIGHTLISTCACHEBEHAVIOR
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Controls how the lightList should be interpreted.
|
||||
/// Valid values are:
|
||||
/// - consumeAndHalt: The lightList should be consulted,
|
||||
/// and if it exists, treated as a final authoritative statement
|
||||
/// of any lights that exist at or below this prim, halting
|
||||
/// recursive discovery of lights.
|
||||
/// - consumeAndContinue: The lightList should be consulted,
|
||||
/// but recursive traversal over nameChildren should continue
|
||||
/// in case additional lights are added by descendants.
|
||||
/// - ignore: The lightList should be entirely ignored. This
|
||||
/// provides a simple way to temporarily invalidate an existing
|
||||
/// cache. This is the fallback behavior.
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token lightList:cacheBehavior` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref UsdLuxTokens "Allowed Values" | consumeAndHalt, consumeAndContinue, ignore |
|
||||
USDLUX_API
|
||||
UsdAttribute GetLightListCacheBehaviorAttr() const;
|
||||
|
||||
/// See GetLightListCacheBehaviorAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateLightListCacheBehaviorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// LIGHTLIST
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Relationship to lights in the scene.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdRelationship GetLightListRel() const;
|
||||
|
||||
/// See GetLightListRel(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
|
||||
USDLUX_API
|
||||
UsdRelationship CreateLightListRel() const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
/// Runtime control over whether to consult stored lightList caches.
|
||||
enum ComputeMode {
|
||||
/// Consult any caches found on the model hierarchy.
|
||||
/// Do not traverse beneath the model hierarchy.
|
||||
ComputeModeConsultModelHierarchyCache,
|
||||
/// Ignore any caches found, and do a full prim traversal.
|
||||
ComputeModeIgnoreCache,
|
||||
};
|
||||
|
||||
/// Computes and returns the list of lights and light filters in
|
||||
/// the stage, optionally consulting a cached result.
|
||||
///
|
||||
/// In ComputeModeIgnoreCache mode, caching is ignored, and this
|
||||
/// does a prim traversal looking for prims that have a UsdLuxLightAPI
|
||||
/// or are of type UsdLuxLightFilter.
|
||||
///
|
||||
/// In ComputeModeConsultModelHierarchyCache, this does a traversal
|
||||
/// only of the model hierarchy. In this traversal, any lights that
|
||||
/// live as model hierarchy prims are accumulated, as well as any
|
||||
/// paths stored in lightList caches. The lightList:cacheBehavior
|
||||
/// attribute gives further control over the cache behavior; see the
|
||||
/// class overview for details.
|
||||
///
|
||||
/// When instances are present, ComputeLightList(ComputeModeIgnoreCache)
|
||||
/// will return the instance-uniqiue paths to any lights discovered
|
||||
/// within those instances. Lights within a UsdGeomPointInstancer
|
||||
/// will not be returned, however, since they cannot be referred to
|
||||
/// solely via paths.
|
||||
USDLUX_API
|
||||
SdfPathSet ComputeLightList(ComputeMode mode) const;
|
||||
|
||||
/// Store the given paths as the lightlist for this prim.
|
||||
/// Paths that do not have this prim's path as a prefix
|
||||
/// will be silently ignored.
|
||||
/// This will set the listList:cacheBehavior to "consumeAndContinue".
|
||||
USDLUX_API
|
||||
void StoreLightList(const SdfPathSet &) const;
|
||||
|
||||
/// Mark any stored lightlist as invalid, by setting the
|
||||
/// lightList:cacheBehavior attribute to ignore.
|
||||
USDLUX_API
|
||||
void InvalidateLightList() const;
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,194 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_MESHLIGHTAPI_H
|
||||
#define USDLUX_GENERATED_MESHLIGHTAPI_H
|
||||
|
||||
/// \file usdLux/meshLightAPI.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usd/apiSchemaBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// MESHLIGHTAPI //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxMeshLightAPI
|
||||
///
|
||||
/// This is the preferred API schema to apply to
|
||||
/// \ref UsdGeomMesh "Mesh" type prims when adding light behaviors to a mesh.
|
||||
/// At its base, this API schema has the built-in behavior of applying LightAPI
|
||||
/// to the mesh and overriding the default materialSyncMode to allow the
|
||||
/// emission/glow of the bound material to affect the color of the light.
|
||||
/// But, it additionally serves as a hook for plugins to attach additional
|
||||
/// properties to "mesh lights" through the creation of API schemas which are
|
||||
/// authored to auto-apply to MeshLightAPI.
|
||||
/// \see \ref Usd_AutoAppliedAPISchemas
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxMeshLightAPI : public UsdAPISchemaBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
|
||||
|
||||
/// Construct a UsdLuxMeshLightAPI on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxMeshLightAPI::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxMeshLightAPI(const UsdPrim& prim=UsdPrim())
|
||||
: UsdAPISchemaBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxMeshLightAPI on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxMeshLightAPI(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxMeshLightAPI(const UsdSchemaBase& schemaObj)
|
||||
: UsdAPISchemaBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxMeshLightAPI();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxMeshLightAPI holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxMeshLightAPI(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxMeshLightAPI
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
/// Returns true if this <b>single-apply</b> API schema can be applied to
|
||||
/// the given \p prim. If this schema can not be a applied to the prim,
|
||||
/// this returns false and, if provided, populates \p whyNot with the
|
||||
/// reason it can not be applied.
|
||||
///
|
||||
/// Note that if CanApply returns false, that does not necessarily imply
|
||||
/// that calling Apply will fail. Callers are expected to call CanApply
|
||||
/// before calling Apply if they want to ensure that it is valid to
|
||||
/// apply a schema.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static bool
|
||||
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
|
||||
|
||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||
/// This information is stored by adding "MeshLightAPI" to the
|
||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||
///
|
||||
/// \return A valid UsdLuxMeshLightAPI object is returned upon success.
|
||||
/// An invalid (or empty) UsdLuxMeshLightAPI object is returned upon
|
||||
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
|
||||
/// resulting in failure.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxMeshLightAPI
|
||||
Apply(const UsdPrim &prim);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H
|
||||
#define USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H
|
||||
|
||||
/// \file usdLux/nonboundableLightBase.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdGeom/xformable.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/lightAPI.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// NONBOUNDABLELIGHTBASE //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxNonboundableLightBase
|
||||
///
|
||||
/// Base class for intrinsic lights that are not boundable.
|
||||
///
|
||||
/// The primary purpose of this class is to provide a direct API to the
|
||||
/// functions provided by LightAPI for concrete derived light types.
|
||||
///
|
||||
///
|
||||
class UsdLuxNonboundableLightBase : public UsdGeomXformable
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
|
||||
|
||||
/// Construct a UsdLuxNonboundableLightBase on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxNonboundableLightBase::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxNonboundableLightBase(const UsdPrim& prim=UsdPrim())
|
||||
: UsdGeomXformable(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxNonboundableLightBase on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxNonboundableLightBase(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxNonboundableLightBase(const UsdSchemaBase& schemaObj)
|
||||
: UsdGeomXformable(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxNonboundableLightBase();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxNonboundableLightBase holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxNonboundableLightBase(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxNonboundableLightBase
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
/// \name LightAPI
|
||||
///
|
||||
/// Convenience accessors for the light's built-in UsdLuxLightAPI
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Contructs and returns a UsdLuxLightAPI object for this light.
|
||||
USDLUX_API
|
||||
UsdLuxLightAPI LightAPI() const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetIntensityAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetIntensityAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateIntensityAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateIntensityAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetExposureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetExposureAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateExposureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateExposureAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetDiffuseAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetDiffuseAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateDiffuseAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateDiffuseAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetSpecularAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetSpecularAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateSpecularAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateSpecularAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetNormalizeAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetNormalizeAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateNormalizeAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateNormalizeAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetColorAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetColorAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateColorAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateColorAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetEnableColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetEnableColorTemperatureAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateEnableColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateEnableColorTemperatureAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute GetColorTemperatureAttr() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateColorTemperatureAttr().
|
||||
USDLUX_API
|
||||
UsdAttribute CreateColorTemperatureAttr(
|
||||
VtValue const &defaultValue = VtValue(),
|
||||
bool writeSparsely=false) const;
|
||||
|
||||
/// See UsdLuxLightAPI::GetFiltersRel().
|
||||
USDLUX_API
|
||||
UsdRelationship GetFiltersRel() const;
|
||||
|
||||
/// See UsdLuxLightAPI::CreateFiltersRel().
|
||||
USDLUX_API
|
||||
UsdRelationship CreateFiltersRel() const;
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,179 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_PLUGINLIGHT_H
|
||||
#define USDLUX_GENERATED_PLUGINLIGHT_H
|
||||
|
||||
/// \file usdLux/pluginLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdGeom/xformable.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
|
||||
#include "pxr/usd/usdShade/nodeDefAPI.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// PLUGINLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxPluginLight
|
||||
///
|
||||
/// Light that provides properties that allow it to identify an
|
||||
/// external SdrShadingNode definition, through UsdShadeNodeDefAPI, that can be
|
||||
/// provided to render delegates without the need to provide a schema
|
||||
/// definition for the light's type.
|
||||
///
|
||||
/// \see \ref usdLux_PluginSchemas
|
||||
///
|
||||
///
|
||||
class UsdLuxPluginLight : public UsdGeomXformable
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxPluginLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxPluginLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxPluginLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdGeomXformable(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxPluginLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxPluginLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxPluginLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdGeomXformable(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxPluginLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxPluginLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxPluginLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxPluginLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxPluginLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
/// Convenience method for accessing the UsdShadeNodeDefAPI functionality
|
||||
/// for this prim.
|
||||
/// One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
|
||||
USDLUX_API
|
||||
UsdShadeNodeDefAPI GetNodeDefAPI() const;
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,179 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_PLUGINLIGHTFILTER_H
|
||||
#define USDLUX_GENERATED_PLUGINLIGHTFILTER_H
|
||||
|
||||
/// \file usdLux/pluginLightFilter.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/lightFilter.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
|
||||
#include "pxr/usd/usdShade/nodeDefAPI.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// PLUGINLIGHTFILTER //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxPluginLightFilter
|
||||
///
|
||||
/// Light filter that provides properties that allow it to identify an
|
||||
/// external SdrShadingNode definition, through UsdShadeNodeDefAPI, that can be
|
||||
/// provided to render delegates without the need to provide a schema
|
||||
/// definition for the light filter's type.
|
||||
///
|
||||
/// \see \ref usdLux_PluginSchemas
|
||||
///
|
||||
///
|
||||
class UsdLuxPluginLightFilter : public UsdLuxLightFilter
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxPluginLightFilter on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxPluginLightFilter::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxPluginLightFilter(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxLightFilter(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxPluginLightFilter on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxPluginLightFilter(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxPluginLightFilter(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxLightFilter(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxPluginLightFilter();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxPluginLightFilter holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxPluginLightFilter(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxPluginLightFilter
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxPluginLightFilter
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
/// Convenience method for accessing the UsdShadeNodeDefAPI functionality
|
||||
/// for this prim.
|
||||
/// One can also construct a UsdShadeNodeDefAPI directly from a UsdPrim.
|
||||
USDLUX_API
|
||||
UsdShadeNodeDefAPI GetNodeDefAPI() const;
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,173 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_PORTALLIGHT_H
|
||||
#define USDLUX_GENERATED_PORTALLIGHT_H
|
||||
|
||||
/// \file usdLux/portalLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/boundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// PORTALLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxPortalLight
|
||||
///
|
||||
/// A rectangular portal in the local XY plane that guides sampling
|
||||
/// of a dome light. Transmits light in the -Z direction.
|
||||
/// The rectangle is 1 unit in length.
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxPortalLight : public UsdLuxBoundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxPortalLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxPortalLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxPortalLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxBoundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxPortalLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxPortalLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxPortalLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxBoundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxPortalLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxPortalLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxPortalLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxPortalLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxPortalLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,241 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_RECTLIGHT_H
|
||||
#define USDLUX_GENERATED_RECTLIGHT_H
|
||||
|
||||
/// \file usdLux/rectLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/boundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// RECTLIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxRectLight
|
||||
///
|
||||
/// Light emitted from one side of a rectangle.
|
||||
/// The rectangle is centered in the XY plane and emits light along the -Z axis.
|
||||
/// The rectangle is 1 unit in length in the X and Y axis. In the default
|
||||
/// position, a texture file's min coordinates should be at (+X, +Y) and
|
||||
/// max coordinates at (-X, -Y).
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxRectLight : public UsdLuxBoundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxRectLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxRectLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxRectLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxBoundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxRectLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxRectLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxRectLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxBoundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxRectLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxRectLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxRectLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxRectLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxRectLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// WIDTH
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Width of the rectangle, in the local X axis.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:width = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetWidthAttr() const;
|
||||
|
||||
/// See GetWidthAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateWidthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// HEIGHT
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Height of the rectangle, in the local Y axis.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:height = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetHeightAttr() const;
|
||||
|
||||
/// See GetHeightAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateHeightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// TEXTUREFILE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A color texture to use on the rectangle.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `asset inputs:texture:file` |
|
||||
/// | C++ Type | SdfAssetPath |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
|
||||
USDLUX_API
|
||||
UsdAttribute GetTextureFileAttr() const;
|
||||
|
||||
/// See GetTextureFileAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateTextureFileAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,384 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_SHADOWAPI_H
|
||||
#define USDLUX_GENERATED_SHADOWAPI_H
|
||||
|
||||
/// \file usdLux/shadowAPI.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usd/apiSchemaBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/usd/usdShade/input.h"
|
||||
#include "pxr/usd/usdShade/output.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// SHADOWAPI //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxShadowAPI
|
||||
///
|
||||
/// Controls to refine a light's shadow behavior. These are
|
||||
/// non-physical controls that are valuable for visual lighting work.
|
||||
///
|
||||
class UsdLuxShadowAPI : public UsdAPISchemaBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
|
||||
|
||||
/// Construct a UsdLuxShadowAPI on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxShadowAPI::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxShadowAPI(const UsdPrim& prim=UsdPrim())
|
||||
: UsdAPISchemaBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxShadowAPI on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxShadowAPI(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxShadowAPI(const UsdSchemaBase& schemaObj)
|
||||
: UsdAPISchemaBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxShadowAPI();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxShadowAPI holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxShadowAPI(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxShadowAPI
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
/// Returns true if this <b>single-apply</b> API schema can be applied to
|
||||
/// the given \p prim. If this schema can not be a applied to the prim,
|
||||
/// this returns false and, if provided, populates \p whyNot with the
|
||||
/// reason it can not be applied.
|
||||
///
|
||||
/// Note that if CanApply returns false, that does not necessarily imply
|
||||
/// that calling Apply will fail. Callers are expected to call CanApply
|
||||
/// before calling Apply if they want to ensure that it is valid to
|
||||
/// apply a schema.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static bool
|
||||
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
|
||||
|
||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||
/// This information is stored by adding "ShadowAPI" to the
|
||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||
///
|
||||
/// \return A valid UsdLuxShadowAPI object is returned upon success.
|
||||
/// An invalid (or empty) UsdLuxShadowAPI object is returned upon
|
||||
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
|
||||
/// resulting in failure.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxShadowAPI
|
||||
Apply(const UsdPrim &prim);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADOW:ENABLE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Enables shadows to be cast by this light.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `bool inputs:shadow:enable = 1` |
|
||||
/// | C++ Type | bool |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShadowEnableAttr() const;
|
||||
|
||||
/// See GetShadowEnableAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShadowEnableAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADOW:COLOR
|
||||
// --------------------------------------------------------------------- //
|
||||
/// The color of shadows cast by the light. This is a
|
||||
/// non-physical control. The default is to cast black shadows.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `color3f inputs:shadow:color = (0, 0, 0)` |
|
||||
/// | C++ Type | GfVec3f |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Color3f |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShadowColorAttr() const;
|
||||
|
||||
/// See GetShadowColorAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShadowColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADOW:DISTANCE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// The maximum distance shadows are cast.
|
||||
/// The default value (-1) indicates no limit.
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shadow:distance = -1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShadowDistanceAttr() const;
|
||||
|
||||
/// See GetShadowDistanceAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShadowDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADOW:FALLOFF
|
||||
// --------------------------------------------------------------------- //
|
||||
/// The near distance at which shadow falloff begins.
|
||||
/// The default value (-1) indicates no falloff.
|
||||
///
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shadow:falloff = -1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShadowFalloffAttr() const;
|
||||
|
||||
/// See GetShadowFalloffAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShadowFalloffAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHADOW:FALLOFFGAMMA
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A gamma (i.e., exponential) control over shadow strength
|
||||
/// with linear distance within the falloff zone.
|
||||
/// This requires the use of shadowDistance and shadowFalloff.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shadow:falloffGamma = 1` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShadowFalloffGammaAttr() const;
|
||||
|
||||
/// See GetShadowFalloffGammaAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShadowFalloffGammaAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Conversion to and from UsdShadeConnectableAPI
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Constructor that takes a ConnectableAPI object.
|
||||
/// Allow implicit conversion of UsdShadeConnectableAPI to
|
||||
/// UsdLuxShadowAPI.
|
||||
USDLUX_API
|
||||
UsdLuxShadowAPI(const UsdShadeConnectableAPI &connectable);
|
||||
|
||||
/// Contructs and returns a UsdShadeConnectableAPI object with this shadow
|
||||
/// API prim. Note that a valid UsdLuxShadowAPI will only return a valid
|
||||
/// UsdShadeConnectableAPI if the its prim's Typed schema type is actually
|
||||
/// connectable.
|
||||
USDLUX_API
|
||||
UsdShadeConnectableAPI ConnectableAPI() const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Outputs API
|
||||
///
|
||||
/// Outputs represent a typed attribute on a shadow API whose value is
|
||||
/// computed externally.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an output which can either have a value or can be connected.
|
||||
/// The attribute representing the output is created in the "outputs:"
|
||||
/// namespace. Outputs on a shadow API cannot be connected, as their
|
||||
/// value is assumed to be computed externally.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput CreateOutput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested output if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput GetOutput(const TfToken &name) const;
|
||||
|
||||
/// Outputs are represented by attributes in the "outputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/// \name Inputs API
|
||||
///
|
||||
/// Inputs are connectable attribute with a typed value.
|
||||
///
|
||||
/// Shadow API parameters are encoded as inputs.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an input which can either have a value or can be connected.
|
||||
/// The attribute representing the input is created in the "inputs:"
|
||||
/// namespace. Inputs on shadow API are connectable.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput CreateInput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested input if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput GetInput(const TfToken &name) const;
|
||||
|
||||
/// Inputs are represented by attributes in the "inputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,430 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_SHAPINGAPI_H
|
||||
#define USDLUX_GENERATED_SHAPINGAPI_H
|
||||
|
||||
/// \file usdLux/shapingAPI.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usd/apiSchemaBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/usd/usdShade/input.h"
|
||||
#include "pxr/usd/usdShade/output.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// SHAPINGAPI //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxShapingAPI
|
||||
///
|
||||
/// Controls for shaping a light's emission.
|
||||
///
|
||||
class UsdLuxShapingAPI : public UsdAPISchemaBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
|
||||
|
||||
/// Construct a UsdLuxShapingAPI on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxShapingAPI::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxShapingAPI(const UsdPrim& prim=UsdPrim())
|
||||
: UsdAPISchemaBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxShapingAPI on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxShapingAPI(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxShapingAPI(const UsdSchemaBase& schemaObj)
|
||||
: UsdAPISchemaBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxShapingAPI();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxShapingAPI holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxShapingAPI(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxShapingAPI
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
/// Returns true if this <b>single-apply</b> API schema can be applied to
|
||||
/// the given \p prim. If this schema can not be a applied to the prim,
|
||||
/// this returns false and, if provided, populates \p whyNot with the
|
||||
/// reason it can not be applied.
|
||||
///
|
||||
/// Note that if CanApply returns false, that does not necessarily imply
|
||||
/// that calling Apply will fail. Callers are expected to call CanApply
|
||||
/// before calling Apply if they want to ensure that it is valid to
|
||||
/// apply a schema.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static bool
|
||||
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
|
||||
|
||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||
/// This information is stored by adding "ShapingAPI" to the
|
||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||
///
|
||||
/// \return A valid UsdLuxShapingAPI object is returned upon success.
|
||||
/// An invalid (or empty) UsdLuxShapingAPI object is returned upon
|
||||
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
|
||||
/// resulting in failure.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxShapingAPI
|
||||
Apply(const UsdPrim &prim);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:FOCUS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A control to shape the spread of light. Higher focus
|
||||
/// values pull light towards the center and narrow the spread.
|
||||
/// Implemented as an off-axis cosine power exponent.
|
||||
/// TODO: clarify semantics
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shaping:focus = 0` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingFocusAttr() const;
|
||||
|
||||
/// See GetShapingFocusAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingFocusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:FOCUSTINT
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Off-axis color tint. This tints the emission in the
|
||||
/// falloff region. The default tint is black.
|
||||
/// TODO: clarify semantics
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `color3f inputs:shaping:focusTint = (0, 0, 0)` |
|
||||
/// | C++ Type | GfVec3f |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Color3f |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingFocusTintAttr() const;
|
||||
|
||||
/// See GetShapingFocusTintAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingFocusTintAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:CONE:ANGLE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Angular limit off the primary axis to restrict the
|
||||
/// light spread.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shaping:cone:angle = 90` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingConeAngleAttr() const;
|
||||
|
||||
/// See GetShapingConeAngleAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingConeAngleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:CONE:SOFTNESS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Controls the cutoff softness for cone angle.
|
||||
/// TODO: clarify semantics
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shaping:cone:softness = 0` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingConeSoftnessAttr() const;
|
||||
|
||||
/// See GetShapingConeSoftnessAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingConeSoftnessAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:IES:FILE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// An IES (Illumination Engineering Society) light
|
||||
/// profile describing the angular distribution of light.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `asset inputs:shaping:ies:file` |
|
||||
/// | C++ Type | SdfAssetPath |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingIesFileAttr() const;
|
||||
|
||||
/// See GetShapingIesFileAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingIesFileAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:IES:ANGLESCALE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Rescales the angular distribution of the IES profile.
|
||||
/// TODO: clarify semantics
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:shaping:ies:angleScale = 0` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingIesAngleScaleAttr() const;
|
||||
|
||||
/// See GetShapingIesAngleScaleAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingIesAngleScaleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// SHAPING:IES:NORMALIZE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Normalizes the IES profile so that it affects the shaping
|
||||
/// of the light while preserving the overall energy output.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `bool inputs:shaping:ies:normalize = 0` |
|
||||
/// | C++ Type | bool |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
|
||||
USDLUX_API
|
||||
UsdAttribute GetShapingIesNormalizeAttr() const;
|
||||
|
||||
/// See GetShapingIesNormalizeAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateShapingIesNormalizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Conversion to and from UsdShadeConnectableAPI
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Constructor that takes a ConnectableAPI object.
|
||||
/// Allow implicit conversion of UsdShadeConnectableAPI to
|
||||
/// UsdLuxShapingAPI.
|
||||
USDLUX_API
|
||||
UsdLuxShapingAPI(const UsdShadeConnectableAPI &connectable);
|
||||
|
||||
/// Contructs and returns a UsdShadeConnectableAPI object with this shaping
|
||||
/// API prim. Note that a valid UsdLuxShapingAPI will only return a valid
|
||||
/// UsdShadeConnectableAPI if the its prim's Typed schema type is actually
|
||||
/// connectable.
|
||||
USDLUX_API
|
||||
UsdShadeConnectableAPI ConnectableAPI() const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/// \name Outputs API
|
||||
///
|
||||
/// Outputs represent a typed attribute on a shaping API whose value is
|
||||
/// computed externally.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an output which can either have a value or can be connected.
|
||||
/// The attribute representing the output is created in the "outputs:"
|
||||
/// namespace. Outputs on a shaping API cannot be connected, as their
|
||||
/// value is assumed to be computed externally.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput CreateOutput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested output if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeOutput GetOutput(const TfToken &name) const;
|
||||
|
||||
/// Outputs are represented by attributes in the "outputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/// \name Inputs API
|
||||
///
|
||||
/// Inputs are connectable attribute with a typed value.
|
||||
///
|
||||
/// Shaping API parameters are encoded as inputs.
|
||||
///
|
||||
/// @{
|
||||
|
||||
/// Create an input which can either have a value or can be connected.
|
||||
/// The attribute representing the input is created in the "inputs:"
|
||||
/// namespace. Inputs on shaping API are connectable.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput CreateInput(const TfToken& name,
|
||||
const SdfValueTypeName& typeName);
|
||||
|
||||
/// Return the requested input if it exists.
|
||||
///
|
||||
USDLUX_API
|
||||
UsdShadeInput GetInput(const TfToken &name) const;
|
||||
|
||||
/// Inputs are represented by attributes in the "inputs:" namespace.
|
||||
/// If \p onlyAuthored is true (the default), then only return authored
|
||||
/// attributes; otherwise, this also returns un-authored builtins.
|
||||
///
|
||||
USDLUX_API
|
||||
std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,218 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_SPHERELIGHT_H
|
||||
#define USDLUX_GENERATED_SPHERELIGHT_H
|
||||
|
||||
/// \file usdLux/sphereLight.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usdLux/boundableLightBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// SPHERELIGHT //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxSphereLight
|
||||
///
|
||||
/// Light emitted outward from a sphere.
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxSphereLight : public UsdLuxBoundableLightBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
|
||||
|
||||
/// Construct a UsdLuxSphereLight on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxSphereLight::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxSphereLight(const UsdPrim& prim=UsdPrim())
|
||||
: UsdLuxBoundableLightBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxSphereLight on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxSphereLight(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxSphereLight(const UsdSchemaBase& schemaObj)
|
||||
: UsdLuxBoundableLightBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxSphereLight();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxSphereLight holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxSphereLight(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxSphereLight
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
|
||||
/// is defined (according to UsdPrim::IsDefined()) on this stage.
|
||||
///
|
||||
/// If a prim adhering to this schema at \p path is already defined on this
|
||||
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
|
||||
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
|
||||
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
|
||||
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
|
||||
/// current EditTarget for any nonexistent, or existing but not \a Defined
|
||||
/// ancestors.
|
||||
///
|
||||
/// The given \a path must be an absolute prim path that does not contain
|
||||
/// any variant selections.
|
||||
///
|
||||
/// If it is impossible to author any of the necessary PrimSpecs, (for
|
||||
/// example, in case \a path cannot map to the current UsdEditTarget's
|
||||
/// namespace) issue an error and return an invalid \a UsdPrim.
|
||||
///
|
||||
/// Note that this method may return a defined prim whose typeName does not
|
||||
/// specify this schema class, in case a stronger typeName opinion overrides
|
||||
/// the opinion at the current EditTarget.
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxSphereLight
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// RADIUS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Radius of the sphere.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `float inputs:radius = 0.5` |
|
||||
/// | C++ Type | float |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
|
||||
USDLUX_API
|
||||
UsdAttribute GetRadiusAttr() const;
|
||||
|
||||
/// See GetRadiusAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// TREATASPOINT
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A hint that this light can be treated as a 'point'
|
||||
/// light (effectively, a zero-radius sphere) by renderers that
|
||||
/// benefit from non-area lighting. Renderers that only support
|
||||
/// area lights can disregard this.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `bool treatAsPoint = 0` |
|
||||
/// | C++ Type | bool |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
|
||||
USDLUX_API
|
||||
UsdAttribute GetTreatAsPointAttr() const;
|
||||
|
||||
/// See GetTreatAsPointAttr(), and also
|
||||
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
|
||||
/// If specified, author \p defaultValue as the attribute's default,
|
||||
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
|
||||
/// the default for \p writeSparsely is \c false.
|
||||
USDLUX_API
|
||||
UsdAttribute CreateTreatAsPointAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,341 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_TOKENS_H
|
||||
#define USDLUX_TOKENS_H
|
||||
|
||||
/// \file usdLux/tokens.h
|
||||
|
||||
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
//
|
||||
// This is an automatically generated file (by usdGenSchema.py).
|
||||
// Do not hand-edit!
|
||||
//
|
||||
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/base/tf/staticData.h"
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include <vector>
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
|
||||
/// \class UsdLuxTokensType
|
||||
///
|
||||
/// \link UsdLuxTokens \endlink provides static, efficient
|
||||
/// \link TfToken TfTokens\endlink for use in all public USD API.
|
||||
///
|
||||
/// These tokens are auto-generated from the module's schema, representing
|
||||
/// property names, for when you need to fetch an attribute or relationship
|
||||
/// directly by name, e.g. UsdPrim::GetAttribute(), in the most efficient
|
||||
/// manner, and allow the compiler to verify that you spelled the name
|
||||
/// correctly.
|
||||
///
|
||||
/// UsdLuxTokens also contains all of the \em allowedTokens values
|
||||
/// declared for schema builtin attributes of 'token' scene description type.
|
||||
/// Use UsdLuxTokens like so:
|
||||
///
|
||||
/// \code
|
||||
/// gprim.GetMyTokenValuedAttr().Set(UsdLuxTokens->angular);
|
||||
/// \endcode
|
||||
struct UsdLuxTokensType {
|
||||
USDLUX_API UsdLuxTokensType();
|
||||
/// \brief "angular"
|
||||
///
|
||||
/// Possible value for UsdLuxDomeLight::GetTextureFormatAttr()
|
||||
const TfToken angular;
|
||||
/// \brief "automatic"
|
||||
///
|
||||
/// Possible value for UsdLuxDomeLight::GetTextureFormatAttr(), Default value for UsdLuxDomeLight::GetTextureFormatAttr()
|
||||
const TfToken automatic;
|
||||
/// \brief "collection:filterLink:includeRoot"
|
||||
///
|
||||
/// UsdLuxLightFilter
|
||||
const TfToken collectionFilterLinkIncludeRoot;
|
||||
/// \brief "collection:lightLink:includeRoot"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken collectionLightLinkIncludeRoot;
|
||||
/// \brief "collection:shadowLink:includeRoot"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken collectionShadowLinkIncludeRoot;
|
||||
/// \brief "consumeAndContinue"
|
||||
///
|
||||
/// Possible value for UsdLuxListAPI::GetLightListCacheBehaviorAttr()
|
||||
const TfToken consumeAndContinue;
|
||||
/// \brief "consumeAndHalt"
|
||||
///
|
||||
/// Possible value for UsdLuxListAPI::GetLightListCacheBehaviorAttr()
|
||||
const TfToken consumeAndHalt;
|
||||
/// \brief "cubeMapVerticalCross"
|
||||
///
|
||||
/// Possible value for UsdLuxDomeLight::GetTextureFormatAttr()
|
||||
const TfToken cubeMapVerticalCross;
|
||||
/// \brief "CylinderLight"
|
||||
///
|
||||
/// Default value for UsdLuxCylinderLight schema attribute light:shaderId
|
||||
const TfToken cylinderLight;
|
||||
/// \brief "DiskLight"
|
||||
///
|
||||
/// Default value for UsdLuxDiskLight schema attribute light:shaderId
|
||||
const TfToken diskLight;
|
||||
/// \brief "DistantLight"
|
||||
///
|
||||
/// Default value for UsdLuxDistantLight schema attribute light:shaderId
|
||||
const TfToken distantLight;
|
||||
/// \brief "DomeLight"
|
||||
///
|
||||
/// Default value for UsdLuxDomeLight schema attribute light:shaderId
|
||||
const TfToken domeLight;
|
||||
/// \brief "extent"
|
||||
///
|
||||
/// UsdLuxPortalLight
|
||||
const TfToken extent;
|
||||
/// \brief "filterLink"
|
||||
///
|
||||
/// This token represents the collection name to use with UsdCollectionAPI to represent filter-linking of a UsdLuxLightFilter prim.
|
||||
const TfToken filterLink;
|
||||
/// \brief "geometry"
|
||||
///
|
||||
/// UsdLuxGeometryLight
|
||||
const TfToken geometry;
|
||||
/// \brief "GeometryLight"
|
||||
///
|
||||
/// Default value for UsdLuxGeometryLight schema attribute light:shaderId
|
||||
const TfToken geometryLight;
|
||||
/// \brief "ignore"
|
||||
///
|
||||
/// Possible value for UsdLuxListAPI::GetLightListCacheBehaviorAttr()
|
||||
const TfToken ignore;
|
||||
/// \brief "independent"
|
||||
///
|
||||
/// Possible value for UsdLuxLightAPI::GetMaterialSyncModeAttr()
|
||||
const TfToken independent;
|
||||
/// \brief "inputs:angle"
|
||||
///
|
||||
/// UsdLuxDistantLight
|
||||
const TfToken inputsAngle;
|
||||
/// \brief "inputs:color"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsColor;
|
||||
/// \brief "inputs:colorTemperature"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsColorTemperature;
|
||||
/// \brief "inputs:diffuse"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsDiffuse;
|
||||
/// \brief "inputs:enableColorTemperature"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsEnableColorTemperature;
|
||||
/// \brief "inputs:exposure"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsExposure;
|
||||
/// \brief "inputs:height"
|
||||
///
|
||||
/// UsdLuxRectLight
|
||||
const TfToken inputsHeight;
|
||||
/// \brief "inputs:intensity"
|
||||
///
|
||||
/// UsdLuxDistantLight, UsdLuxLightAPI
|
||||
const TfToken inputsIntensity;
|
||||
/// \brief "inputs:length"
|
||||
///
|
||||
/// UsdLuxCylinderLight
|
||||
const TfToken inputsLength;
|
||||
/// \brief "inputs:normalize"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsNormalize;
|
||||
/// \brief "inputs:radius"
|
||||
///
|
||||
/// UsdLuxCylinderLight, UsdLuxSphereLight, UsdLuxDiskLight
|
||||
const TfToken inputsRadius;
|
||||
/// \brief "inputs:shadow:color"
|
||||
///
|
||||
/// UsdLuxShadowAPI
|
||||
const TfToken inputsShadowColor;
|
||||
/// \brief "inputs:shadow:distance"
|
||||
///
|
||||
/// UsdLuxShadowAPI
|
||||
const TfToken inputsShadowDistance;
|
||||
/// \brief "inputs:shadow:enable"
|
||||
///
|
||||
/// UsdLuxShadowAPI
|
||||
const TfToken inputsShadowEnable;
|
||||
/// \brief "inputs:shadow:falloff"
|
||||
///
|
||||
/// UsdLuxShadowAPI
|
||||
const TfToken inputsShadowFalloff;
|
||||
/// \brief "inputs:shadow:falloffGamma"
|
||||
///
|
||||
/// UsdLuxShadowAPI
|
||||
const TfToken inputsShadowFalloffGamma;
|
||||
/// \brief "inputs:shaping:cone:angle"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingConeAngle;
|
||||
/// \brief "inputs:shaping:cone:softness"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingConeSoftness;
|
||||
/// \brief "inputs:shaping:focus"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingFocus;
|
||||
/// \brief "inputs:shaping:focusTint"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingFocusTint;
|
||||
/// \brief "inputs:shaping:ies:angleScale"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingIesAngleScale;
|
||||
/// \brief "inputs:shaping:ies:file"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingIesFile;
|
||||
/// \brief "inputs:shaping:ies:normalize"
|
||||
///
|
||||
/// UsdLuxShapingAPI
|
||||
const TfToken inputsShapingIesNormalize;
|
||||
/// \brief "inputs:specular"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken inputsSpecular;
|
||||
/// \brief "inputs:texture:file"
|
||||
///
|
||||
/// UsdLuxDomeLight, UsdLuxRectLight
|
||||
const TfToken inputsTextureFile;
|
||||
/// \brief "inputs:texture:format"
|
||||
///
|
||||
/// UsdLuxDomeLight
|
||||
const TfToken inputsTextureFormat;
|
||||
/// \brief "inputs:width"
|
||||
///
|
||||
/// UsdLuxRectLight
|
||||
const TfToken inputsWidth;
|
||||
/// \brief "latlong"
|
||||
///
|
||||
/// Possible value for UsdLuxDomeLight::GetTextureFormatAttr()
|
||||
const TfToken latlong;
|
||||
/// \brief "light:filters"
|
||||
///
|
||||
/// UsdLuxLightAPI
|
||||
const TfToken lightFilters;
|
||||
/// \brief "lightFilter:shaderId"
|
||||
///
|
||||
/// UsdLuxLightFilter
|
||||
const TfToken lightFilterShaderId;
|
||||
/// \brief "lightLink"
|
||||
///
|
||||
/// This token represents the collection name to use with UsdCollectionAPI to represent light-linking of a prim with an applied UsdLuxLightAPI.
|
||||
const TfToken lightLink;
|
||||
/// \brief "lightList"
|
||||
///
|
||||
/// UsdLuxListAPI
|
||||
const TfToken lightList;
|
||||
/// \brief "lightList:cacheBehavior"
|
||||
///
|
||||
/// UsdLuxListAPI
|
||||
const TfToken lightListCacheBehavior;
|
||||
/// \brief "light:materialSyncMode"
|
||||
///
|
||||
/// UsdLuxVolumeLightAPI, UsdLuxMeshLightAPI, UsdLuxLightAPI
|
||||
const TfToken lightMaterialSyncMode;
|
||||
/// \brief "light:shaderId"
|
||||
///
|
||||
/// UsdLuxPortalLight, UsdLuxDomeLight, UsdLuxGeometryLight, UsdLuxCylinderLight, UsdLuxSphereLight, UsdLuxRectLight, UsdLuxDiskLight, UsdLuxDistantLight, UsdLuxVolumeLightAPI, UsdLuxMeshLightAPI, UsdLuxLightAPI
|
||||
const TfToken lightShaderId;
|
||||
/// \brief "materialGlowTintsLight"
|
||||
///
|
||||
/// Default value for UsdLuxVolumeLightAPI schema attribute light:materialSyncMode, Default value for UsdLuxMeshLightAPI schema attribute light:materialSyncMode, Possible value for UsdLuxLightAPI::GetMaterialSyncModeAttr()
|
||||
const TfToken materialGlowTintsLight;
|
||||
/// \brief "MeshLight"
|
||||
///
|
||||
/// Default value for UsdLuxMeshLightAPI schema attribute light:shaderId
|
||||
const TfToken meshLight;
|
||||
/// \brief "mirroredBall"
|
||||
///
|
||||
/// Possible value for UsdLuxDomeLight::GetTextureFormatAttr()
|
||||
const TfToken mirroredBall;
|
||||
/// \brief "noMaterialResponse"
|
||||
///
|
||||
/// Possible value for UsdLuxLightAPI::GetMaterialSyncModeAttr(), Default value for UsdLuxLightAPI::GetMaterialSyncModeAttr()
|
||||
const TfToken noMaterialResponse;
|
||||
/// \brief "orientToStageUpAxis"
|
||||
///
|
||||
/// This token represents the suffix for a UsdGeomXformOp used to orient a light with the stage's up axis.
|
||||
const TfToken orientToStageUpAxis;
|
||||
/// \brief "PortalLight"
|
||||
///
|
||||
/// Default value for UsdLuxPortalLight schema attribute light:shaderId
|
||||
const TfToken portalLight;
|
||||
/// \brief "portals"
|
||||
///
|
||||
/// UsdLuxDomeLight
|
||||
const TfToken portals;
|
||||
/// \brief "RectLight"
|
||||
///
|
||||
/// Default value for UsdLuxRectLight schema attribute light:shaderId
|
||||
const TfToken rectLight;
|
||||
/// \brief "shadowLink"
|
||||
///
|
||||
/// This token represents the collection name to use with UsdCollectionAPI to represent shadow-linking of a prim with an applied UsdLuxLightAPI.
|
||||
const TfToken shadowLink;
|
||||
/// \brief "SphereLight"
|
||||
///
|
||||
/// Default value for UsdLuxSphereLight schema attribute light:shaderId
|
||||
const TfToken sphereLight;
|
||||
/// \brief "treatAsLine"
|
||||
///
|
||||
/// UsdLuxCylinderLight
|
||||
const TfToken treatAsLine;
|
||||
/// \brief "treatAsPoint"
|
||||
///
|
||||
/// UsdLuxSphereLight
|
||||
const TfToken treatAsPoint;
|
||||
/// \brief "VolumeLight"
|
||||
///
|
||||
/// Default value for UsdLuxVolumeLightAPI schema attribute light:shaderId
|
||||
const TfToken volumeLight;
|
||||
/// A vector of all of the tokens listed above.
|
||||
const std::vector<TfToken> allTokens;
|
||||
};
|
||||
|
||||
/// \var UsdLuxTokens
|
||||
///
|
||||
/// A global variable with static, efficient \link TfToken TfTokens\endlink
|
||||
/// for use in all public USD API. \sa UsdLuxTokensType
|
||||
extern USDLUX_API TfStaticData<UsdLuxTokensType> UsdLuxTokens;
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,194 @@
|
||||
//
|
||||
// Copyright 2016 Pixar
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
||||
// with the following modification; you may not use this file except in
|
||||
// compliance with the Apache License and the following modification to it:
|
||||
// Section 6. Trademarks. is deleted and replaced with:
|
||||
//
|
||||
// 6. Trademarks. This License does not grant permission to use the trade
|
||||
// names, trademarks, service marks, or product names of the Licensor
|
||||
// and its affiliates, except as required to comply with Section 4(c) of
|
||||
// the License and to reproduce the content of the NOTICE file.
|
||||
//
|
||||
// You may obtain a copy of the Apache License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the Apache License with the above modification is
|
||||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the Apache License for the specific
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
#ifndef USDLUX_GENERATED_VOLUMELIGHTAPI_H
|
||||
#define USDLUX_GENERATED_VOLUMELIGHTAPI_H
|
||||
|
||||
/// \file usdLux/volumeLightAPI.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdLux/api.h"
|
||||
#include "pxr/usd/usd/apiSchemaBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdLux/tokens.h"
|
||||
|
||||
#include "pxr/base/vt/value.h"
|
||||
|
||||
#include "pxr/base/gf/vec3d.h"
|
||||
#include "pxr/base/gf/vec3f.h"
|
||||
#include "pxr/base/gf/matrix4d.h"
|
||||
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
class SdfAssetPath;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// VOLUMELIGHTAPI //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdLuxVolumeLightAPI
|
||||
///
|
||||
/// This is the preferred API schema to apply to
|
||||
/// \ref UsdVolVolume "Volume" type prims when adding light behaviors to a
|
||||
/// volume. At its base, this API schema has the built-in behavior of applying
|
||||
/// LightAPI to the volume and overriding the default materialSyncMode to allow
|
||||
/// the emission/glow of the bound material to affect the color of the light.
|
||||
/// But, it additionally serves as a hook for plugins to attach additional
|
||||
/// properties to "volume lights" through the creation of API schemas which are
|
||||
/// authored to auto-apply to VolumeLightAPI.
|
||||
/// \see \ref Usd_AutoAppliedAPISchemas
|
||||
///
|
||||
///
|
||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
|
||||
/// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdLuxVolumeLightAPI : public UsdAPISchemaBase
|
||||
{
|
||||
public:
|
||||
/// Compile time constant representing what kind of schema this class is.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
|
||||
|
||||
/// Construct a UsdLuxVolumeLightAPI on UsdPrim \p prim .
|
||||
/// Equivalent to UsdLuxVolumeLightAPI::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdLuxVolumeLightAPI(const UsdPrim& prim=UsdPrim())
|
||||
: UsdAPISchemaBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdLuxVolumeLightAPI on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdLuxVolumeLightAPI(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdLuxVolumeLightAPI(const UsdSchemaBase& schemaObj)
|
||||
: UsdAPISchemaBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDLUX_API
|
||||
virtual ~UsdLuxVolumeLightAPI();
|
||||
|
||||
/// Return a vector of names of all pre-declared attributes for this schema
|
||||
/// class and all its ancestor classes. Does not include attributes that
|
||||
/// may be authored by custom/extended methods of the schemas involved.
|
||||
USDLUX_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdLuxVolumeLightAPI holding the prim adhering to this
|
||||
/// schema at \p path on \p stage. If no prim exists at \p path on
|
||||
/// \p stage, or if the prim at that path does not adhere to this schema,
|
||||
/// return an invalid schema object. This is shorthand for the following:
|
||||
///
|
||||
/// \code
|
||||
/// UsdLuxVolumeLightAPI(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxVolumeLightAPI
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
/// Returns true if this <b>single-apply</b> API schema can be applied to
|
||||
/// the given \p prim. If this schema can not be a applied to the prim,
|
||||
/// this returns false and, if provided, populates \p whyNot with the
|
||||
/// reason it can not be applied.
|
||||
///
|
||||
/// Note that if CanApply returns false, that does not necessarily imply
|
||||
/// that calling Apply will fail. Callers are expected to call CanApply
|
||||
/// before calling Apply if they want to ensure that it is valid to
|
||||
/// apply a schema.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static bool
|
||||
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
|
||||
|
||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||
/// This information is stored by adding "VolumeLightAPI" to the
|
||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||
///
|
||||
/// \return A valid UsdLuxVolumeLightAPI object is returned upon success.
|
||||
/// An invalid (or empty) UsdLuxVolumeLightAPI object is returned upon
|
||||
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
|
||||
/// resulting in failure.
|
||||
///
|
||||
/// \sa UsdPrim::GetAppliedSchemas()
|
||||
/// \sa UsdPrim::HasAPI()
|
||||
/// \sa UsdPrim::CanApplyAPI()
|
||||
/// \sa UsdPrim::ApplyAPI()
|
||||
/// \sa UsdPrim::RemoveAPI()
|
||||
///
|
||||
USDLUX_API
|
||||
static UsdLuxVolumeLightAPI
|
||||
Apply(const UsdPrim &prim);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDLUX_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDLUX_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDLUX_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line, it will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to:
|
||||
// - Close the class declaration with };
|
||||
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
|
||||
// - Close the include guard with #endif
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user