add usd-21-05-win64_py37
This commit is contained in:
1 parent
41d23e71ba
commit
66bc054336
15675 files changed
+3061008
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 USDVOL_API_H
|
||||
#define USDVOL_API_H
|
||||
|
||||
#include "pxr/base/arch/export.h"
|
||||
|
||||
#if defined(PXR_STATIC)
|
||||
# define USDVOL_API
|
||||
# define USDVOL_API_TEMPLATE_CLASS(...)
|
||||
# define USDVOL_API_TEMPLATE_STRUCT(...)
|
||||
# define USDVOL_LOCAL
|
||||
#else
|
||||
# if defined(USDVOL_EXPORTS)
|
||||
# define USDVOL_API ARCH_EXPORT
|
||||
# define USDVOL_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
|
||||
# define USDVOL_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
|
||||
# else
|
||||
# define USDVOL_API ARCH_IMPORT
|
||||
# define USDVOL_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
|
||||
# define USDVOL_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
|
||||
# endif
|
||||
# define USDVOL_LOCAL ARCH_HIDDEN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,234 @@
|
||||
//
|
||||
// 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 USDVOL_GENERATED_FIELD3DASSET_H
|
||||
#define USDVOL_GENERATED_FIELD3DASSET_H
|
||||
|
||||
/// \file usdVol/field3DAsset.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdVol/api.h"
|
||||
#include "pxr/usd/usdVol/fieldAsset.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdVol/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;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// FIELD3DASSET //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdVolField3DAsset
|
||||
///
|
||||
/// Field3D field primitive. The FieldAsset filePath attribute must
|
||||
/// specify a file in the Field3D format on disk.
|
||||
///
|
||||
/// 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 UsdVolTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdVolTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdVolField3DAsset : public UsdVolFieldAsset
|
||||
{
|
||||
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 UsdVolField3DAsset on UsdPrim \p prim .
|
||||
/// Equivalent to UsdVolField3DAsset::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdVolField3DAsset(const UsdPrim& prim=UsdPrim())
|
||||
: UsdVolFieldAsset(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdVolField3DAsset on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdVolField3DAsset(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdVolField3DAsset(const UsdSchemaBase& schemaObj)
|
||||
: UsdVolFieldAsset(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDVOL_API
|
||||
virtual ~UsdVolField3DAsset();
|
||||
|
||||
/// 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.
|
||||
USDVOL_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdVolField3DAsset 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
|
||||
/// UsdVolField3DAsset(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolField3DAsset
|
||||
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.
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolField3DAsset
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
/// \deprecated
|
||||
/// Same as _GetSchemaKind, provided to maintain temporary backward
|
||||
/// compatibility with older generated schemas.
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaType() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDVOL_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDVOL_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDDATATYPE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Token which is used to indicate the data type of an
|
||||
/// individual field. Authors use this to tell consumers more
|
||||
/// about the field without opening the file on disk. The list of
|
||||
/// allowed tokens reflects the available choices for Field3d
|
||||
/// volumes.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token fieldDataType` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref UsdVolTokens "Allowed Values" | half, float, double, half3, float3, double3 |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldDataTypeAttr() const;
|
||||
|
||||
/// See GetFieldDataTypeAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldDataTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDPURPOSE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Optional token which can be used to indicate the purpose or
|
||||
/// grouping of an individual field. Clients which consume Field3D
|
||||
/// files should treat this as the Field3D field \em name.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token fieldPurpose` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldPurposeAttr() const;
|
||||
|
||||
/// See GetFieldPurposeAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldPurposeAttr(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,286 @@
|
||||
//
|
||||
// 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 USDVOL_GENERATED_FIELDASSET_H
|
||||
#define USDVOL_GENERATED_FIELDASSET_H
|
||||
|
||||
/// \file usdVol/fieldAsset.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdVol/api.h"
|
||||
#include "pxr/usd/usdVol/fieldBase.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdVol/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;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// FIELDASSET //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdVolFieldAsset
|
||||
///
|
||||
/// Base class for field primitives defined by an external file.
|
||||
///
|
||||
/// 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 UsdVolTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdVolTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdVolFieldAsset : public UsdVolFieldBase
|
||||
{
|
||||
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 UsdVolFieldAsset on UsdPrim \p prim .
|
||||
/// Equivalent to UsdVolFieldAsset::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdVolFieldAsset(const UsdPrim& prim=UsdPrim())
|
||||
: UsdVolFieldBase(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdVolFieldAsset on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdVolFieldAsset(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdVolFieldAsset(const UsdSchemaBase& schemaObj)
|
||||
: UsdVolFieldBase(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDVOL_API
|
||||
virtual ~UsdVolFieldAsset();
|
||||
|
||||
/// 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.
|
||||
USDVOL_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdVolFieldAsset 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
|
||||
/// UsdVolFieldAsset(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolFieldAsset
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
/// \deprecated
|
||||
/// Same as _GetSchemaKind, provided to maintain temporary backward
|
||||
/// compatibility with older generated schemas.
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaType() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDVOL_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDVOL_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FILEPATH
|
||||
// --------------------------------------------------------------------- //
|
||||
/// An asset path attribute that points to a file on disk.
|
||||
/// For each supported file format, a separate FieldAsset
|
||||
/// subclass is required.
|
||||
///
|
||||
/// This attribute's value can be animated over time, as most
|
||||
/// volume asset formats represent just a single timeSample of
|
||||
/// a volume. However, it does not, at this time, support
|
||||
/// any pattern substitutions like "$F".
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `asset filePath` |
|
||||
/// | C++ Type | SdfAssetPath |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFilePathAttr() const;
|
||||
|
||||
/// See GetFilePathAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFilePathAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDNAME
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Name of an individual field within the file specified by
|
||||
/// the filePath attribute.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token fieldName` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldNameAttr() const;
|
||||
|
||||
/// See GetFieldNameAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldNameAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDINDEX
|
||||
// --------------------------------------------------------------------- //
|
||||
/// A file can contain multiple fields with the same
|
||||
/// name. This optional attribute is an index used to
|
||||
/// disambiguate between these multiple fields with the same
|
||||
/// name.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `int fieldIndex` |
|
||||
/// | C++ Type | int |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldIndexAttr() const;
|
||||
|
||||
/// See GetFieldIndexAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldIndexAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDDATATYPE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Token which is used to indicate the data type of an
|
||||
/// individual field. Authors use this to tell consumers more
|
||||
/// about the field without opening the file on disk. The list of
|
||||
/// allowed tokens is specified with the specific asset type.
|
||||
/// A missing value is considered an error.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token fieldDataType` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldDataTypeAttr() const;
|
||||
|
||||
/// See GetFieldDataTypeAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldDataTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// VECTORDATAROLEHINT
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Optional token which is used to indicate the role of a vector
|
||||
/// valued field. This can drive the data type in which fields
|
||||
/// are made available in a renderer or whether the vector values
|
||||
/// are to be transformed.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token vectorDataRoleHint = "None"` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref UsdVolTokens "Allowed Values" | None, Point, Normal, Vector, Color |
|
||||
USDVOL_API
|
||||
UsdAttribute GetVectorDataRoleHintAttr() const;
|
||||
|
||||
/// See GetVectorDataRoleHintAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateVectorDataRoleHintAttr(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,151 @@
|
||||
//
|
||||
// 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 USDVOL_GENERATED_FIELDBASE_H
|
||||
#define USDVOL_GENERATED_FIELDBASE_H
|
||||
|
||||
/// \file usdVol/fieldBase.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdVol/api.h"
|
||||
#include "pxr/usd/usdGeom/boundable.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;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// FIELDBASE //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdVolFieldBase
|
||||
///
|
||||
/// Base class for field primitives.
|
||||
///
|
||||
class UsdVolFieldBase : public UsdGeomBoundable
|
||||
{
|
||||
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 UsdVolFieldBase on UsdPrim \p prim .
|
||||
/// Equivalent to UsdVolFieldBase::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdVolFieldBase(const UsdPrim& prim=UsdPrim())
|
||||
: UsdGeomBoundable(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdVolFieldBase on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdVolFieldBase(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdVolFieldBase(const UsdSchemaBase& schemaObj)
|
||||
: UsdGeomBoundable(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDVOL_API
|
||||
virtual ~UsdVolFieldBase();
|
||||
|
||||
/// 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.
|
||||
USDVOL_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdVolFieldBase 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
|
||||
/// UsdVolFieldBase(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolFieldBase
|
||||
Get(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
/// \deprecated
|
||||
/// Same as _GetSchemaKind, provided to maintain temporary backward
|
||||
/// compatibility with older generated schemas.
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaType() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDVOL_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDVOL_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,236 @@
|
||||
//
|
||||
// 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 USDVOL_GENERATED_OPENVDBASSET_H
|
||||
#define USDVOL_GENERATED_OPENVDBASSET_H
|
||||
|
||||
/// \file usdVol/openVDBAsset.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdVol/api.h"
|
||||
#include "pxr/usd/usdVol/fieldAsset.h"
|
||||
#include "pxr/usd/usd/prim.h"
|
||||
#include "pxr/usd/usd/stage.h"
|
||||
#include "pxr/usd/usdVol/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;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// OPENVDBASSET //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdVolOpenVDBAsset
|
||||
///
|
||||
/// OpenVDB field primitive. The FieldAsset filePath attribute must
|
||||
/// specify a file in the OpenVDB format on disk.
|
||||
///
|
||||
/// 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 UsdVolTokens.
|
||||
/// So to set an attribute to the value "rightHanded", use UsdVolTokens->rightHanded
|
||||
/// as the value.
|
||||
///
|
||||
class UsdVolOpenVDBAsset : public UsdVolFieldAsset
|
||||
{
|
||||
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 UsdVolOpenVDBAsset on UsdPrim \p prim .
|
||||
/// Equivalent to UsdVolOpenVDBAsset::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdVolOpenVDBAsset(const UsdPrim& prim=UsdPrim())
|
||||
: UsdVolFieldAsset(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdVolOpenVDBAsset on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdVolOpenVDBAsset(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdVolOpenVDBAsset(const UsdSchemaBase& schemaObj)
|
||||
: UsdVolFieldAsset(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDVOL_API
|
||||
virtual ~UsdVolOpenVDBAsset();
|
||||
|
||||
/// 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.
|
||||
USDVOL_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdVolOpenVDBAsset 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
|
||||
/// UsdVolOpenVDBAsset(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolOpenVDBAsset
|
||||
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.
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolOpenVDBAsset
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
/// \deprecated
|
||||
/// Same as _GetSchemaKind, provided to maintain temporary backward
|
||||
/// compatibility with older generated schemas.
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaType() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDVOL_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDVOL_API
|
||||
const TfType &_GetTfType() const override;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDDATATYPE
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Token which is used to indicate the data type of an
|
||||
/// individual field. Authors use this to tell consumers more
|
||||
/// about the field without opening the file on disk. The list of
|
||||
/// allowed tokens reflects the available choices for OpenVDB
|
||||
/// volumes.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token fieldDataType` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref UsdVolTokens "Allowed Values" | half, float, double, int, uint, int64, half2, float2, double2, int2, half3, float3, double3, int3, matrix3d, matrix4d, quatd, bool, mask, string |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldDataTypeAttr() const;
|
||||
|
||||
/// See GetFieldDataTypeAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldDataTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
|
||||
|
||||
public:
|
||||
// --------------------------------------------------------------------- //
|
||||
// FIELDCLASS
|
||||
// --------------------------------------------------------------------- //
|
||||
/// Optional token which can be used to indicate the class of
|
||||
/// an individual grid. This is a mapping to openvdb::GridClass
|
||||
/// where the values are GRID_LEVEL_SET, GRID_FOG_VOLUME,
|
||||
/// GRID_STAGGERED, and GRID_UNKNOWN.
|
||||
///
|
||||
/// | ||
|
||||
/// | -- | -- |
|
||||
/// | Declaration | `token fieldClass` |
|
||||
/// | C++ Type | TfToken |
|
||||
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
|
||||
/// | \ref UsdVolTokens "Allowed Values" | levelSet, fogVolume, staggered, unknown |
|
||||
USDVOL_API
|
||||
UsdAttribute GetFieldClassAttr() const;
|
||||
|
||||
/// See GetFieldClassAttr(), 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.
|
||||
USDVOL_API
|
||||
UsdAttribute CreateFieldClassAttr(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,225 @@
|
||||
//
|
||||
// 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 USDVOL_TOKENS_H
|
||||
#define USDVOL_TOKENS_H
|
||||
|
||||
/// \file usdVol/tokens.h
|
||||
|
||||
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
//
|
||||
// This is an automatically generated file (by usdGenSchema.py).
|
||||
// Do not hand-edit!
|
||||
//
|
||||
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdVol/api.h"
|
||||
#include "pxr/base/tf/staticData.h"
|
||||
#include "pxr/base/tf/token.h"
|
||||
#include <vector>
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
|
||||
/// \class UsdVolTokensType
|
||||
///
|
||||
/// \link UsdVolTokens \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.
|
||||
///
|
||||
/// UsdVolTokens also contains all of the \em allowedTokens values
|
||||
/// declared for schema builtin attributes of 'token' scene description type.
|
||||
/// Use UsdVolTokens like so:
|
||||
///
|
||||
/// \code
|
||||
/// gprim.GetMyTokenValuedAttr().Set(UsdVolTokens->bool_);
|
||||
/// \endcode
|
||||
struct UsdVolTokensType {
|
||||
USDVOL_API UsdVolTokensType();
|
||||
/// \brief "bool"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken bool_;
|
||||
/// \brief "Color"
|
||||
///
|
||||
/// Possible value for UsdVolFieldAsset::GetVectorDataRoleHintAttr()
|
||||
const TfToken color;
|
||||
/// \brief "double2"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken double2;
|
||||
/// \brief "double3"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr(), Possible value for UsdVolField3DAsset::GetFieldDataTypeAttr()
|
||||
const TfToken double3;
|
||||
/// \brief "double"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr(), Possible value for UsdVolField3DAsset::GetFieldDataTypeAttr()
|
||||
const TfToken double_;
|
||||
/// \brief "field"
|
||||
///
|
||||
/// This is the namespace prefix used to specify the fields that make up a volume primitive.
|
||||
const TfToken field;
|
||||
/// \brief "fieldClass"
|
||||
///
|
||||
/// UsdVolOpenVDBAsset
|
||||
const TfToken fieldClass;
|
||||
/// \brief "fieldDataType"
|
||||
///
|
||||
/// UsdVolOpenVDBAsset, UsdVolField3DAsset, UsdVolFieldAsset
|
||||
const TfToken fieldDataType;
|
||||
/// \brief "fieldIndex"
|
||||
///
|
||||
/// UsdVolFieldAsset
|
||||
const TfToken fieldIndex;
|
||||
/// \brief "fieldName"
|
||||
///
|
||||
/// UsdVolFieldAsset
|
||||
const TfToken fieldName;
|
||||
/// \brief "fieldPurpose"
|
||||
///
|
||||
/// UsdVolField3DAsset
|
||||
const TfToken fieldPurpose;
|
||||
/// \brief "filePath"
|
||||
///
|
||||
/// UsdVolFieldAsset
|
||||
const TfToken filePath;
|
||||
/// \brief "float2"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken float2;
|
||||
/// \brief "float3"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr(), Possible value for UsdVolField3DAsset::GetFieldDataTypeAttr()
|
||||
const TfToken float3;
|
||||
/// \brief "float"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr(), Possible value for UsdVolField3DAsset::GetFieldDataTypeAttr()
|
||||
const TfToken float_;
|
||||
/// \brief "fogVolume"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldClassAttr()
|
||||
const TfToken fogVolume;
|
||||
/// \brief "half"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr(), Possible value for UsdVolField3DAsset::GetFieldDataTypeAttr()
|
||||
const TfToken half;
|
||||
/// \brief "half2"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken half2;
|
||||
/// \brief "half3"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr(), Possible value for UsdVolField3DAsset::GetFieldDataTypeAttr()
|
||||
const TfToken half3;
|
||||
/// \brief "int2"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken int2;
|
||||
/// \brief "int3"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken int3;
|
||||
/// \brief "int64"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken int64;
|
||||
/// \brief "int"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken int_;
|
||||
/// \brief "levelSet"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldClassAttr()
|
||||
const TfToken levelSet;
|
||||
/// \brief "mask"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken mask;
|
||||
/// \brief "matrix3d"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken matrix3d;
|
||||
/// \brief "matrix4d"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken matrix4d;
|
||||
/// \brief "None"
|
||||
///
|
||||
/// Possible value for UsdVolFieldAsset::GetVectorDataRoleHintAttr(), Default value for UsdVolFieldAsset::GetVectorDataRoleHintAttr()
|
||||
const TfToken none;
|
||||
/// \brief "Normal"
|
||||
///
|
||||
/// Possible value for UsdVolFieldAsset::GetVectorDataRoleHintAttr()
|
||||
const TfToken normal;
|
||||
/// \brief "Point"
|
||||
///
|
||||
/// Possible value for UsdVolFieldAsset::GetVectorDataRoleHintAttr()
|
||||
const TfToken point;
|
||||
/// \brief "quatd"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken quatd;
|
||||
/// \brief "staggered"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldClassAttr()
|
||||
const TfToken staggered;
|
||||
/// \brief "string"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken string;
|
||||
/// \brief "uint"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldDataTypeAttr()
|
||||
const TfToken uint;
|
||||
/// \brief "unknown"
|
||||
///
|
||||
/// Possible value for UsdVolOpenVDBAsset::GetFieldClassAttr()
|
||||
const TfToken unknown;
|
||||
/// \brief "Vector"
|
||||
///
|
||||
/// Possible value for UsdVolFieldAsset::GetVectorDataRoleHintAttr()
|
||||
const TfToken vector;
|
||||
/// \brief "vectorDataRoleHint"
|
||||
///
|
||||
/// UsdVolFieldAsset
|
||||
const TfToken vectorDataRoleHint;
|
||||
/// A vector of all of the tokens listed above.
|
||||
const std::vector<TfToken> allTokens;
|
||||
};
|
||||
|
||||
/// \var UsdVolTokens
|
||||
///
|
||||
/// A global variable with static, efficient \link TfToken TfTokens\endlink
|
||||
/// for use in all public USD API. \sa UsdVolTokensType
|
||||
extern USDVOL_API TfStaticData<UsdVolTokensType> UsdVolTokens;
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,266 @@
|
||||
//
|
||||
// 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 USDVOL_GENERATED_VOLUME_H
|
||||
#define USDVOL_GENERATED_VOLUME_H
|
||||
|
||||
/// \file usdVol/volume.h
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/usd/usdVol/api.h"
|
||||
#include "pxr/usd/usdGeom/gprim.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;
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// VOLUME //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
/// \class UsdVolVolume
|
||||
///
|
||||
/// A renderable volume primitive. A volume is made up of any number
|
||||
/// of FieldBase primitives bound together in this volume. Each
|
||||
/// FieldBase primitive is specified as a relationship with a
|
||||
/// namespace prefix of "field".
|
||||
///
|
||||
/// The relationship name is used by the renderer to associate
|
||||
/// individual fields with the named input parameters on the volume
|
||||
/// shader. Using this indirect approach to connecting fields to
|
||||
/// shader parameters (rather than using the field prim's name)
|
||||
/// allows a single field to be reused for different shader inputs, or
|
||||
/// to be used as different shader parameters when rendering different
|
||||
/// Volumes. This means that the name of the field prim is not
|
||||
/// relevant to its contribution to the volume prims which refer to
|
||||
/// it. Nor does the field prim's location in the scene graph have
|
||||
/// any relevance, and Volumes may refer to fields anywhere in the
|
||||
/// scene graph. **However**, unless Field prims need to be shared
|
||||
/// by multiple Volumes, a Volume's Field prims should be located
|
||||
/// under the Volume in namespace, for enhanced organization.
|
||||
///
|
||||
class UsdVolVolume : public UsdGeomGprim
|
||||
{
|
||||
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 UsdVolVolume on UsdPrim \p prim .
|
||||
/// Equivalent to UsdVolVolume::Get(prim.GetStage(), prim.GetPath())
|
||||
/// for a \em valid \p prim, but will not immediately throw an error for
|
||||
/// an invalid \p prim
|
||||
explicit UsdVolVolume(const UsdPrim& prim=UsdPrim())
|
||||
: UsdGeomGprim(prim)
|
||||
{
|
||||
}
|
||||
|
||||
/// Construct a UsdVolVolume on the prim held by \p schemaObj .
|
||||
/// Should be preferred over UsdVolVolume(schemaObj.GetPrim()),
|
||||
/// as it preserves SchemaBase state.
|
||||
explicit UsdVolVolume(const UsdSchemaBase& schemaObj)
|
||||
: UsdGeomGprim(schemaObj)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructor.
|
||||
USDVOL_API
|
||||
virtual ~UsdVolVolume();
|
||||
|
||||
/// 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.
|
||||
USDVOL_API
|
||||
static const TfTokenVector &
|
||||
GetSchemaAttributeNames(bool includeInherited=true);
|
||||
|
||||
/// Return a UsdVolVolume 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
|
||||
/// UsdVolVolume(stage->GetPrimAtPath(path));
|
||||
/// \endcode
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolVolume
|
||||
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.
|
||||
///
|
||||
USDVOL_API
|
||||
static UsdVolVolume
|
||||
Define(const UsdStagePtr &stage, const SdfPath &path);
|
||||
|
||||
protected:
|
||||
/// Returns the kind of schema this class belongs to.
|
||||
///
|
||||
/// \sa UsdSchemaKind
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaKind() const override;
|
||||
|
||||
/// \deprecated
|
||||
/// Same as _GetSchemaKind, provided to maintain temporary backward
|
||||
/// compatibility with older generated schemas.
|
||||
USDVOL_API
|
||||
UsdSchemaKind _GetSchemaType() const override;
|
||||
|
||||
private:
|
||||
// needs to invoke _GetStaticTfType.
|
||||
friend class UsdSchemaRegistry;
|
||||
USDVOL_API
|
||||
static const TfType &_GetStaticTfType();
|
||||
|
||||
static bool _IsTypedSchema();
|
||||
|
||||
// override SchemaBase virtuals.
|
||||
USDVOL_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 Field Attachment and Inspection
|
||||
/// @{
|
||||
// --------------------------------------------------------------------- //
|
||||
|
||||
typedef std::map<TfToken, SdfPath> FieldMap;
|
||||
|
||||
/// Return a map of field relationship names to the fields themselves,
|
||||
/// represented as prim paths. This map provides all the information
|
||||
/// that should be needed to tie fields to shader parameters and render
|
||||
/// this volume.
|
||||
///
|
||||
/// The field relationship names that server as the map keys will have
|
||||
/// the field namespace stripped from them.
|
||||
USDVOL_API
|
||||
FieldMap GetFieldPaths() const;
|
||||
|
||||
/// Checks if there is an existing field relationship with a given name.
|
||||
/// This query will return \c true even for a field relationship that
|
||||
/// has been blocked and therefore will not contribute to the map
|
||||
/// returned by GetFieldRelationships()
|
||||
///
|
||||
/// The name lookup automatically applies the field relationship
|
||||
/// namespacing, if it isn't specified in the name token.
|
||||
USDVOL_API
|
||||
bool HasFieldRelationship(const TfToken &name) const;
|
||||
|
||||
/// Checks if there is an existing field relationship with a given name,
|
||||
/// and if so, returns the path to the Field prim it targets, or else
|
||||
/// the empty path.
|
||||
///
|
||||
/// The name lookup automatically applies the field relationship
|
||||
/// namespacing, if it isn't specified in the name token.
|
||||
USDVOL_API
|
||||
SdfPath GetFieldPath(const TfToken &name) const;
|
||||
|
||||
/// Creates a relationship on this volume that targets the specified field.
|
||||
/// If an existing relationship exists with the same name, it is replaced
|
||||
/// (since only one target is allowed for each named relationship).
|
||||
///
|
||||
/// Returns \c true if the relationship was successfully created and set -
|
||||
/// it is legal to call this method for a field relationship that already
|
||||
/// "exists", i.e. already posesses scene description, as this is the
|
||||
/// only method we provide for setting a field relatioonship's value, to help
|
||||
/// enforce that field relationships can have only a single (or no) target.
|
||||
///
|
||||
/// \param fieldPath - can be a prim path, or the path of another
|
||||
/// relationship, to effect \ref usd_relationship_forwarding
|
||||
///
|
||||
/// The name lookup automatically applies the field relationship
|
||||
/// namespacing, if it isn't specified in the name token.
|
||||
USDVOL_API
|
||||
bool CreateFieldRelationship(const TfToken &name,
|
||||
const SdfPath &fieldPath) const;
|
||||
|
||||
/// Blocks an existing field relationship on this volume, ensuring it
|
||||
/// will not be enumerated by GetFieldPaths().
|
||||
///
|
||||
/// Returns true if the relationship existed, false if it did not. In other
|
||||
/// words the return value indicates whether the volume prim was changed.
|
||||
///
|
||||
/// The name lookup automatically applies the field relationship
|
||||
/// namespacing, if it isn't specified in the name token.
|
||||
USDVOL_API
|
||||
bool BlockFieldRelationship(const TfToken &name) const;
|
||||
|
||||
private:
|
||||
/// Return \p name prepended with the field namespace, if it isn't
|
||||
/// already prefixed.
|
||||
///
|
||||
/// Does not validate name as a legal relationship identifier.
|
||||
static TfToken _MakeNamespaced(const TfToken& name);
|
||||
};
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user