add usd-21-05-win64_py37

This commit is contained in:
Sébastien Albert committed 2021-12-07 17:16:25 +01:00
1 parent 41d23e71ba
commit 66bc054336
15675 files changed
+3061008

No files matched your search

+47
View File
@@ -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 USDRENDER_API_H
#define USDRENDER_API_H
#include "pxr/base/arch/export.h"
#if defined(PXR_STATIC)
# define USDRENDER_API
# define USDRENDER_API_TEMPLATE_CLASS(...)
# define USDRENDER_API_TEMPLATE_STRUCT(...)
# define USDRENDER_LOCAL
#else
# if defined(USDRENDER_EXPORTS)
# define USDRENDER_API ARCH_EXPORT
# define USDRENDER_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define USDRENDER_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define USDRENDER_API ARCH_IMPORT
# define USDRENDER_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define USDRENDER_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define USDRENDER_LOCAL ARCH_HIDDEN
#endif
#endif
+263
View File
@@ -0,0 +1,263 @@
//
// 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 USDRENDER_GENERATED_PRODUCT_H
#define USDRENDER_GENERATED_PRODUCT_H
/// \file usdRender/product.h
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/usd/usdRender/settingsBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdRender/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;
// -------------------------------------------------------------------------- //
// RENDERPRODUCT //
// -------------------------------------------------------------------------- //
/// \class UsdRenderProduct
///
/// A UsdRenderProduct describes an image or other
/// file-like artifact produced by a render. A RenderProduct
/// combines one or more RenderVars into a file or interactive
/// buffer. It also provides all the controls established in
/// UsdRenderSettingsBase as optional overrides to whatever the
/// owning UsdRenderSettings prim dictates.
///
/// Specific renderers may support additional settings, such
/// as a way to configure compression settings, filetype metadata,
/// and so forth. Such settings can be encoded using
/// renderer-specific API schemas applied to the product prim.
///
///
/// 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 UsdRenderTokens.
/// So to set an attribute to the value "rightHanded", use UsdRenderTokens->rightHanded
/// as the value.
///
class UsdRenderProduct : public UsdRenderSettingsBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// \deprecated
/// Same as schemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
static const UsdSchemaKind schemaType = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdRenderProduct on UsdPrim \p prim .
/// Equivalent to UsdRenderProduct::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdRenderProduct(const UsdPrim& prim=UsdPrim())
: UsdRenderSettingsBase(prim)
{
}
/// Construct a UsdRenderProduct on the prim held by \p schemaObj .
/// Should be preferred over UsdRenderProduct(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdRenderProduct(const UsdSchemaBase& schemaObj)
: UsdRenderSettingsBase(schemaObj)
{
}
/// Destructor.
USDRENDER_API
virtual ~UsdRenderProduct();
/// 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.
USDRENDER_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdRenderProduct 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
/// UsdRenderProduct(stage->GetPrimAtPath(path));
/// \endcode
///
USDRENDER_API
static UsdRenderProduct
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.
///
USDRENDER_API
static UsdRenderProduct
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDRENDER_API
UsdSchemaKind _GetSchemaKind() const override;
/// \deprecated
/// Same as _GetSchemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
USDRENDER_API
UsdSchemaKind _GetSchemaType() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDRENDER_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDRENDER_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// PRODUCTTYPE
// --------------------------------------------------------------------- //
/// The type of output to produce.
/// The default, "raster", indicates a 2D image.
///
///
/// ote In the future, UsdRender may define additional product
/// types.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token productType = "raster"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetProductTypeAttr() const;
/// See GetProductTypeAttr(), 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.
USDRENDER_API
UsdAttribute CreateProductTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PRODUCTNAME
// --------------------------------------------------------------------- //
/// Specifies the name that the output/display driver
/// should give the product. This is provided as-authored to the
/// driver, whose responsibility it is to situate the product on a
/// filesystem or other storage, in the desired location.
///
/// | ||
/// | -- | -- |
/// | Declaration | `token productName = ""` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
USDRENDER_API
UsdAttribute GetProductNameAttr() const;
/// See GetProductNameAttr(), 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.
USDRENDER_API
UsdAttribute CreateProductNameAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ORDEREDVARS
// --------------------------------------------------------------------- //
/// Specifies the RenderVars that should be consumed and
/// combined into the final product. If ordering is relevant to the
/// output driver, then the ordering of targets in this relationship
/// provides the order to use.
///
USDRENDER_API
UsdRelationship GetOrderedVarsRel() const;
/// See GetOrderedVarsRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDRENDER_API
UsdRelationship CreateOrderedVarsRel() 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
+261
View File
@@ -0,0 +1,261 @@
//
// 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 USDRENDER_GENERATED_SETTINGS_H
#define USDRENDER_GENERATED_SETTINGS_H
/// \file usdRender/settings.h
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/usd/usdRender/settingsBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdRender/tokens.h"
#include "pxr/base/gf/frustum.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;
// -------------------------------------------------------------------------- //
// RENDERSETTINGS //
// -------------------------------------------------------------------------- //
/// \class UsdRenderSettings
///
/// A UsdRenderSettings prim specifies global settings for
/// a render process, including an enumeration of the RenderProducts
/// that should result, and the UsdGeomImageable purposes that should
/// be rendered. \ref UsdRenderHowSettingsAffectRendering
///
class UsdRenderSettings : public UsdRenderSettingsBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// \deprecated
/// Same as schemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
static const UsdSchemaKind schemaType = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdRenderSettings on UsdPrim \p prim .
/// Equivalent to UsdRenderSettings::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdRenderSettings(const UsdPrim& prim=UsdPrim())
: UsdRenderSettingsBase(prim)
{
}
/// Construct a UsdRenderSettings on the prim held by \p schemaObj .
/// Should be preferred over UsdRenderSettings(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdRenderSettings(const UsdSchemaBase& schemaObj)
: UsdRenderSettingsBase(schemaObj)
{
}
/// Destructor.
USDRENDER_API
virtual ~UsdRenderSettings();
/// 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.
USDRENDER_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdRenderSettings 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
/// UsdRenderSettings(stage->GetPrimAtPath(path));
/// \endcode
///
USDRENDER_API
static UsdRenderSettings
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.
///
USDRENDER_API
static UsdRenderSettings
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDRENDER_API
UsdSchemaKind _GetSchemaKind() const override;
/// \deprecated
/// Same as _GetSchemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
USDRENDER_API
UsdSchemaKind _GetSchemaType() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDRENDER_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDRENDER_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// INCLUDEDPURPOSES
// --------------------------------------------------------------------- //
/// The list of UsdGeomImageable _purpose_ values that
/// should be included in the render. Note this cannot be
/// specified per-RenderProduct because it is a statement of
/// which geometry is present.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token[] includedPurposes = ["default", "render"]` |
/// | C++ Type | VtArray<TfToken> |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->TokenArray |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetIncludedPurposesAttr() const;
/// See GetIncludedPurposesAttr(), 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.
USDRENDER_API
UsdAttribute CreateIncludedPurposesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MATERIALBINDINGPURPOSES
// --------------------------------------------------------------------- //
/// Ordered list of material purposes to consider when
/// resolving material bindings in the scene. The empty string
/// indicates the "allPurpose" binding.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token[] materialBindingPurposes = ["full", ""]` |
/// | C++ Type | VtArray<TfToken> |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->TokenArray |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdRenderTokens "Allowed Values" | full, preview, "" |
USDRENDER_API
UsdAttribute GetMaterialBindingPurposesAttr() const;
/// See GetMaterialBindingPurposesAttr(), 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.
USDRENDER_API
UsdAttribute CreateMaterialBindingPurposesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PRODUCTS
// --------------------------------------------------------------------- //
/// The set of RenderProducts the render should produce.
/// This relationship should target UsdRenderProduct prims.
/// If no _products_ are specified, an application should produce
/// an rgb image according to the RenderSettings configuration,
/// to a default display or image name.
///
USDRENDER_API
UsdRelationship GetProductsRel() const;
/// See GetProductsRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDRENDER_API
UsdRelationship CreateProductsRel() 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)--
/// Fetch and return \p stage 's render settings, as indicated by root
/// layer metadata. If unauthored, or the metadata does not refer to
/// a valid UsdRenderSettings prim, this will return an invalid
/// UsdRenderSettings prim.
USDRENDER_API
static UsdRenderSettings
GetStageRenderSettings(const UsdStageWeakPtr &stage);
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+170
View File
@@ -0,0 +1,170 @@
//
// 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 USDRENDER_GENERATED_SETTINGSAPI_H
#define USDRENDER_GENERATED_SETTINGSAPI_H
/// \file usdRender/settingsAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.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;
// -------------------------------------------------------------------------- //
// RENDERSETTINGSAPI //
// -------------------------------------------------------------------------- //
/// \class UsdRenderSettingsAPI
///
/// UsdRenderSettingsAPI is a base class for API schemas
/// to encode renderer-specific settings.
///
class UsdRenderSettingsAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// \deprecated
/// Same as schemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
static const UsdSchemaKind schemaType = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdRenderSettingsAPI on UsdPrim \p prim .
/// Equivalent to UsdRenderSettingsAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdRenderSettingsAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdRenderSettingsAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdRenderSettingsAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdRenderSettingsAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDRENDER_API
virtual ~UsdRenderSettingsAPI();
/// 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.
USDRENDER_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdRenderSettingsAPI 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
/// UsdRenderSettingsAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDRENDER_API
static UsdRenderSettingsAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "RenderSettingsAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdRenderSettingsAPI object is returned upon success.
/// An invalid (or empty) UsdRenderSettingsAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDRENDER_API
static UsdRenderSettingsAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDRENDER_API
UsdSchemaKind _GetSchemaKind() const override;
/// \deprecated
/// Same as _GetSchemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
USDRENDER_API
UsdSchemaKind _GetSchemaType() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDRENDER_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDRENDER_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
+347
View File
@@ -0,0 +1,347 @@
//
// 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 USDRENDER_GENERATED_SETTINGSBASE_H
#define USDRENDER_GENERATED_SETTINGSBASE_H
/// \file usdRender/settingsBase.h
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdRender/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;
// -------------------------------------------------------------------------- //
// RENDERSETTINGSBASE //
// -------------------------------------------------------------------------- //
/// \class UsdRenderSettingsBase
///
/// Abstract base class that defines render settings that
/// can be specified on either a RenderSettings prim or a RenderProduct
/// prim.
///
/// 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 UsdRenderTokens.
/// So to set an attribute to the value "rightHanded", use UsdRenderTokens->rightHanded
/// as the value.
///
class UsdRenderSettingsBase : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
/// \deprecated
/// Same as schemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
static const UsdSchemaKind schemaType = UsdSchemaKind::AbstractTyped;
/// Construct a UsdRenderSettingsBase on UsdPrim \p prim .
/// Equivalent to UsdRenderSettingsBase::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdRenderSettingsBase(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a UsdRenderSettingsBase on the prim held by \p schemaObj .
/// Should be preferred over UsdRenderSettingsBase(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdRenderSettingsBase(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
USDRENDER_API
virtual ~UsdRenderSettingsBase();
/// 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.
USDRENDER_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdRenderSettingsBase 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
/// UsdRenderSettingsBase(stage->GetPrimAtPath(path));
/// \endcode
///
USDRENDER_API
static UsdRenderSettingsBase
Get(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDRENDER_API
UsdSchemaKind _GetSchemaKind() const override;
/// \deprecated
/// Same as _GetSchemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
USDRENDER_API
UsdSchemaKind _GetSchemaType() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDRENDER_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDRENDER_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// RESOLUTION
// --------------------------------------------------------------------- //
/// The image pixel resolution, corresponding to the
/// camera's screen window.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform int2 resolution = (2048, 1080)` |
/// | C++ Type | GfVec2i |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int2 |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetResolutionAttr() const;
/// See GetResolutionAttr(), 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.
USDRENDER_API
UsdAttribute CreateResolutionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PIXELASPECTRATIO
// --------------------------------------------------------------------- //
/// The aspect ratio (width/height) of image pixels..
/// The default ratio 1.0 indicates square pixels.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform float pixelAspectRatio = 1` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetPixelAspectRatioAttr() const;
/// See GetPixelAspectRatioAttr(), 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.
USDRENDER_API
UsdAttribute CreatePixelAspectRatioAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ASPECTRATIOCONFORMPOLICY
// --------------------------------------------------------------------- //
/// Indicates the policy to use to resolve an aspect
/// ratio mismatch between the camera aperture and image settings.
///
/// This policy allows a standard render setting to do something
/// reasonable given varying camera inputs.
///
/// The camera aperture aspect ratio is determined by the
/// aperture atributes on the UsdGeomCamera.
///
/// The image aspect ratio is determined by the resolution and
/// pixelAspectRatio attributes in the render settings.
///
/// - "expandAperture": if necessary, expand the aperture to
/// fit the image, exposing additional scene content
/// - "cropAperture": if necessary, crop the aperture to fit
/// the image, cropping scene content
/// - "adjustApertureWidth": if necessary, adjust aperture width
/// to make its aspect ratio match the image
/// - "adjustApertureHeight": if necessary, adjust aperture height
/// to make its aspect ratio match the image
/// - "adjustPixelAspectRatio": compute pixelAspectRatio to
/// make the image exactly cover the aperture; disregards
/// existing attribute value of pixelAspectRatio
///
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token aspectRatioConformPolicy = "expandAperture"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdRenderTokens "Allowed Values" | expandAperture, cropAperture, adjustApertureWidth, adjustApertureHeight, adjustPixelAspectRatio |
USDRENDER_API
UsdAttribute GetAspectRatioConformPolicyAttr() const;
/// See GetAspectRatioConformPolicyAttr(), 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.
USDRENDER_API
UsdAttribute CreateAspectRatioConformPolicyAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DATAWINDOWNDC
// --------------------------------------------------------------------- //
/// dataWindowNDC specifies the axis-aligned rectangular
/// region in the adjusted aperture window within which the renderer
/// should produce data.
///
/// It is specified as (xmin, ymin, xmax, ymax) in normalized
/// device coordinates, where the range 0 to 1 corresponds to the
/// aperture. (0,0) corresponds to the bottom-left
/// corner and (1,1) corresponds to the upper-right corner.
///
/// Specifying a window outside the unit square will produce
/// overscan data. Specifying a window that does not cover the unit
/// square will produce a cropped render.
///
/// A pixel is included in the rendered result if the pixel
/// center is contained by the data window. This is consistent
/// with standard rules used by polygon rasterization engines.
/// \ref UsdRenderRasterization
///
/// The data window is expressed in NDC so that cropping and
/// overscan may be resolution independent. In interactive
/// workflows, incremental cropping and resolution adjustment
/// may be intermixed to isolate and examine parts of the scene.
/// In compositing workflows, overscan may be used to support
/// image post-processing kernels, and reduced-resolution proxy
/// renders may be used for faster iteration.
///
/// The dataWindow:ndc coordinate system references the
/// aperture after any adjustments required by
/// aspectRatioConformPolicy.
///
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform float4 dataWindowNDC = (0, 0, 1, 1)` |
/// | C++ Type | GfVec4f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float4 |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetDataWindowNDCAttr() const;
/// See GetDataWindowNDCAttr(), 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.
USDRENDER_API
UsdAttribute CreateDataWindowNDCAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// INSTANTANEOUSSHUTTER
// --------------------------------------------------------------------- //
/// Override the targeted _camera_'s _shutterClose_ to be
/// equal to the value of its _shutterOpen_, to produce a zero-width
/// shutter interval. This gives us a convenient way to disable
/// motion blur.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform bool instantaneousShutter = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetInstantaneousShutterAttr() const;
/// See GetInstantaneousShutterAttr(), 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.
USDRENDER_API
UsdAttribute CreateInstantaneousShutterAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CAMERA
// --------------------------------------------------------------------- //
/// The _camera_ relationship specifies the primary
/// camera to use in a render. It must target a UsdGeomCamera.
///
USDRENDER_API
UsdRelationship GetCameraRel() const;
/// See GetCameraRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDRENDER_API
UsdRelationship CreateCameraRel() 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
+128
View File
@@ -0,0 +1,128 @@
//
// 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_RENDER_SPEC_H
#define PXR_USD_USD_RENDER_SPEC_H
/// \file usdRender/spec.h
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/usd/usdRender/settingsBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdRender/tokens.h"
#include "pxr/base/gf/frustum.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 UsdRenderSettings;
/// A self-contained specification of render settings.
/// \note This is preliminary API and is likely to change.
struct UsdRenderSpec {
/// Specification of a product. See UsdRenderProduct.
struct Product {
/// The type of product, ex: "raster".
TfToken type;
/// The name of the product, which uniquely identifies it.
TfToken name;
/// Path to the primary UsdGeomCamera camera to use for this product.
SdfPath cameraPath;
/// If set to true, disables motion blur.
bool instantaneousShutter;
/// The pixel resolution of the product.
GfVec2i resolution;
/// The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
float pixelAspectRatio;
/// The policy that was applied to conform aspect ratio
/// mismatches between the aperture and image.
TfToken aspectRatioConformPolicy;
/// The camera aperture size as adjusted by aspectRatioConformPolicy.
GfVec2f apertureSize;
/// The data window, in NDC terms relative to the aperture.
/// (0,0) corresponds to bottom-left and (1,1) corresponds to
/// top-right. Note that the data window can partially cover
/// or extend beyond the unit range, for representing overscan
/// or cropped renders.
GfRange2f dataWindowNDC;
/// The render vars used by this product, as indices into the
/// top-level renderVars array.
std::vector<size_t> renderVarIndices;
/// Any extra settings values discovered in requested namespaces.
VtDictionary extraSettings;
};
/// Specification of a render variable (aka AOV). See UsdRenderVar.
struct RenderVar {
/// The path of this render var, which uniquely identifies it.
SdfPath renderVarPath;
/// The value data type of the variable, as a USD type name.
TfToken dataType;
std::string sourceName;
TfToken sourceType;
/// Any extra settings values discovered in requested namespaces.
VtDictionary extraSettings;
};
/// The full list of products requested by this render.
std::vector<Product> products;
/// The full list of render vars requested by products in this render.
std::vector<RenderVar> renderVars;
/// List of purposes to use to filter scene contents.
VtArray<TfToken> includedPurposes;
/// List of material binding purposes.
VtArray<TfToken> materialBindingPurposes;
/// Any extra settings values discovered in requested namespaces.
VtDictionary extraSettings;
};
/// Computes the specification of the render settings.
/// For each product, applies the aspectRatioConformPolicy
/// and computes a final screenWindow and pixelAspectRatio.
///
/// Any other attributes encountered are returned in extraSettings.
/// If a non-empty list of namespaces is provided, only attributes
/// within those namespaces are returned.
/// If an empty list of namespaces is provided, all custom
/// (non-schema) attributes are returned.
/// The same list of namespaces is used for finding extraSettings
/// in all UsdRender prim types.
USDRENDER_API
UsdRenderSpec
UsdRenderComputeSpec(UsdRenderSettings const& settings,
UsdTimeCode time,
std::vector<std::string> const& namespaces);
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+193
View File
@@ -0,0 +1,193 @@
//
// 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 USDRENDER_TOKENS_H
#define USDRENDER_TOKENS_H
/// \file usdRender/tokens.h
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//
// This is an automatically generated file (by usdGenSchema.py).
// Do not hand-edit!
//
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/base/tf/staticData.h"
#include "pxr/base/tf/token.h"
#include <vector>
PXR_NAMESPACE_OPEN_SCOPE
/// \class UsdRenderTokensType
///
/// \link UsdRenderTokens \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.
///
/// UsdRenderTokens also contains all of the \em allowedTokens values
/// declared for schema builtin attributes of 'token' scene description type.
/// Use UsdRenderTokens like so:
///
/// \code
/// gprim.GetMyTokenValuedAttr().Set(UsdRenderTokens->adjustApertureHeight);
/// \endcode
struct UsdRenderTokensType {
USDRENDER_API UsdRenderTokensType();
/// \brief "adjustApertureHeight"
///
/// Possible value for UsdRenderSettingsBase::GetAspectRatioConformPolicyAttr()
const TfToken adjustApertureHeight;
/// \brief "adjustApertureWidth"
///
/// Possible value for UsdRenderSettingsBase::GetAspectRatioConformPolicyAttr()
const TfToken adjustApertureWidth;
/// \brief "adjustPixelAspectRatio"
///
/// Possible value for UsdRenderSettingsBase::GetAspectRatioConformPolicyAttr()
const TfToken adjustPixelAspectRatio;
/// \brief "aspectRatioConformPolicy"
///
/// UsdRenderSettingsBase
const TfToken aspectRatioConformPolicy;
/// \brief "camera"
///
/// UsdRenderSettingsBase
const TfToken camera;
/// \brief "color3f"
///
/// Default value for UsdRenderVar::GetDataTypeAttr()
const TfToken color3f;
/// \brief "cropAperture"
///
/// Possible value for UsdRenderSettingsBase::GetAspectRatioConformPolicyAttr()
const TfToken cropAperture;
/// \brief "dataType"
///
/// UsdRenderVar
const TfToken dataType;
/// \brief "dataWindowNDC"
///
/// UsdRenderSettingsBase
const TfToken dataWindowNDC;
/// \brief "expandAperture"
///
/// Possible value for UsdRenderSettingsBase::GetAspectRatioConformPolicyAttr(), Default value for UsdRenderSettingsBase::GetAspectRatioConformPolicyAttr()
const TfToken expandAperture;
/// \brief "full"
///
/// Possible value for UsdRenderSettings::GetMaterialBindingPurposesAttr()
const TfToken full;
/// \brief "includedPurposes"
///
/// UsdRenderSettings
const TfToken includedPurposes;
/// \brief "instantaneousShutter"
///
/// UsdRenderSettingsBase
const TfToken instantaneousShutter;
/// \brief "intrinsic"
///
/// Possible value for UsdRenderVar::GetSourceTypeAttr()
const TfToken intrinsic;
/// \brief "lpe"
///
/// Possible value for UsdRenderVar::GetSourceTypeAttr()
const TfToken lpe;
/// \brief "materialBindingPurposes"
///
/// UsdRenderSettings
const TfToken materialBindingPurposes;
/// \brief "orderedVars"
///
/// UsdRenderProduct
const TfToken orderedVars;
/// \brief "pixelAspectRatio"
///
/// UsdRenderSettingsBase
const TfToken pixelAspectRatio;
/// \brief "preview"
///
/// Possible value for UsdRenderSettings::GetMaterialBindingPurposesAttr()
const TfToken preview;
/// \brief "primvar"
///
/// Possible value for UsdRenderVar::GetSourceTypeAttr()
const TfToken primvar;
/// \brief "productName"
///
/// UsdRenderProduct
const TfToken productName;
/// \brief "products"
///
/// UsdRenderSettings
const TfToken products;
/// \brief "productType"
///
/// UsdRenderProduct
const TfToken productType;
/// \brief "raster"
///
/// RenderProduct productType value that indicates a 2D raster image of pixels., Default value for UsdRenderProduct::GetProductTypeAttr()
const TfToken raster;
/// \brief "raw"
///
/// Possible value for UsdRenderVar::GetSourceTypeAttr(), Default value for UsdRenderVar::GetSourceTypeAttr()
const TfToken raw;
/// \brief "renderSettingsPrimPath"
///
/// Stage-level metadata that encodes the path to UsdRenderSettingsPrim to use for rendering.
const TfToken renderSettingsPrimPath;
/// \brief "resolution"
///
/// UsdRenderSettingsBase
const TfToken resolution;
/// \brief "sourceName"
///
/// UsdRenderVar
const TfToken sourceName;
/// \brief "sourceType"
///
/// UsdRenderVar
const TfToken sourceType;
/// A vector of all of the tokens listed above.
const std::vector<TfToken> allTokens;
};
/// \var UsdRenderTokens
///
/// A global variable with static, efficient \link TfToken TfTokens\endlink
/// for use in all public USD API. \sa UsdRenderTokensType
extern USDRENDER_API TfStaticData<UsdRenderTokensType> UsdRenderTokens;
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+280
View File
@@ -0,0 +1,280 @@
//
// 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 USDRENDER_GENERATED_VAR_H
#define USDRENDER_GENERATED_VAR_H
/// \file usdRender/var.h
#include "pxr/pxr.h"
#include "pxr/usd/usdRender/api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdRender/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;
// -------------------------------------------------------------------------- //
// RENDERVAR //
// -------------------------------------------------------------------------- //
/// \class UsdRenderVar
///
/// A UsdRenderVar describes a custom data variable for
/// a render to produce. The prim describes the source of the data, which
/// can be a shader output or an LPE (Light Path Expression), and also
/// allows encoding of (generally renderer-specific) parameters that
/// configure the renderer for computing the variable.
///
///
/// ote In the future, UsdRender may standardize RenderVar representation
/// for well-known variables under the sourceType `intrinsic`,
/// such as _r_, _g_, _b_, _a_, _z_, or _id_.
///
///
/// 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 UsdRenderTokens.
/// So to set an attribute to the value "rightHanded", use UsdRenderTokens->rightHanded
/// as the value.
///
class UsdRenderVar : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// \deprecated
/// Same as schemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
static const UsdSchemaKind schemaType = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdRenderVar on UsdPrim \p prim .
/// Equivalent to UsdRenderVar::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdRenderVar(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a UsdRenderVar on the prim held by \p schemaObj .
/// Should be preferred over UsdRenderVar(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdRenderVar(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
USDRENDER_API
virtual ~UsdRenderVar();
/// 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.
USDRENDER_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdRenderVar 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
/// UsdRenderVar(stage->GetPrimAtPath(path));
/// \endcode
///
USDRENDER_API
static UsdRenderVar
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.
///
USDRENDER_API
static UsdRenderVar
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDRENDER_API
UsdSchemaKind _GetSchemaKind() const override;
/// \deprecated
/// Same as _GetSchemaKind, provided to maintain temporary backward
/// compatibility with older generated schemas.
USDRENDER_API
UsdSchemaKind _GetSchemaType() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDRENDER_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDRENDER_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// DATATYPE
// --------------------------------------------------------------------- //
/// The type of this channel, as a USD attribute type.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token dataType = "color3f"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetDataTypeAttr() const;
/// See GetDataTypeAttr(), 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.
USDRENDER_API
UsdAttribute CreateDataTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SOURCENAME
// --------------------------------------------------------------------- //
/// The renderer should look for an output of this name
/// as the computed value for the RenderVar.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform string sourceName = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDRENDER_API
UsdAttribute GetSourceNameAttr() const;
/// See GetSourceNameAttr(), 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.
USDRENDER_API
UsdAttribute CreateSourceNameAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SOURCETYPE
// --------------------------------------------------------------------- //
/// Indicates the type of the source.
///
/// - "raw": The name should be passed directly to the
/// renderer. This is the default behavior.
/// - "primvar": This source represents the name of a primvar.
/// Some renderers may use this to ensure that the primvar
/// is provided; other renderers may require that a suitable
/// material network be provided, in which case this is simply
/// an advisory setting.
/// - "lpe": Specifies a Light Path Expression in the
/// [OSL Light Path Expressions language](https://github.com/imageworks/OpenShadingLanguage/wiki/OSL-Light-Path-Expressions) as the source for
/// this RenderVar. Some renderers may use extensions to
/// that syntax, which will necessarily be non-portable.
/// - "intrinsic": This setting is currently unimplemented,
/// but represents a future namespace for UsdRender to provide
/// portable baseline RenderVars, such as camera depth, that
/// may have varying implementations for each renderer.
///
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token sourceType = "raw"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdRenderTokens "Allowed Values" | raw, primvar, lpe, intrinsic |
USDRENDER_API
UsdAttribute GetSourceTypeAttr() const;
/// See GetSourceTypeAttr(), 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.
USDRENDER_API
UsdAttribute CreateSourceTypeAttr(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