This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
blendShape.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USDSKEL_GENERATED_BLENDSHAPE_H
8#define USDSKEL_GENERATED_BLENDSHAPE_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdSkel/api.h"
14#include "pxr/usd/usd/typed.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/tf/span.h"
20#include "pxr/usd/usdSkel/inbetweenShape.h"
21
22#include "pxr/base/vt/value.h"
23
24#include "pxr/base/gf/vec3d.h"
25#include "pxr/base/gf/vec3f.h"
27
28#include "pxr/base/tf/token.h"
29#include "pxr/base/tf/type.h"
30
31PXR_NAMESPACE_OPEN_SCOPE
32
33class SdfAssetPath;
34
35// -------------------------------------------------------------------------- //
36// BLENDSHAPE //
37// -------------------------------------------------------------------------- //
38
49{
50public:
54 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
55
60 explicit UsdSkelBlendShape(const UsdPrim& prim=UsdPrim())
61 : UsdTyped(prim)
62 {
63 }
64
68 explicit UsdSkelBlendShape(const UsdSchemaBase& schemaObj)
69 : UsdTyped(schemaObj)
70 {
71 }
72
74 USDSKEL_API
76
80 USDSKEL_API
81 static const TfTokenVector &
82 GetSchemaAttributeNames(bool includeInherited=true);
83
93 USDSKEL_API
95 Get(const UsdStagePtr &stage, const SdfPath &path);
96
119 USDSKEL_API
120 static UsdSkelBlendShape
121 Define(const UsdStagePtr &stage, const SdfPath &path);
122
123protected:
127 USDSKEL_API
129
130private:
131 // needs to invoke _GetStaticTfType.
132 friend class UsdSchemaRegistry;
133 USDSKEL_API
134 static const TfType &_GetStaticTfType();
135
136 static bool _IsTypedSchema();
137
138 // override SchemaBase virtuals.
139 USDSKEL_API
140 const TfType &_GetTfType() const override;
141
142public:
143 // --------------------------------------------------------------------- //
144 // OFFSETS
145 // --------------------------------------------------------------------- //
155 USDSKEL_API
157
163 USDSKEL_API
164 UsdAttribute CreateOffsetsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
165
166public:
167 // --------------------------------------------------------------------- //
168 // NORMALOFFSETS
169 // --------------------------------------------------------------------- //
179 USDSKEL_API
181
187 USDSKEL_API
188 UsdAttribute CreateNormalOffsetsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
189
190public:
191 // --------------------------------------------------------------------- //
192 // POINTINDICES
193 // --------------------------------------------------------------------- //
205 USDSKEL_API
207
213 USDSKEL_API
214 UsdAttribute CreatePointIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
215
216public:
217 // ===================================================================== //
218 // Feel free to add custom code below this line, it will be preserved by
219 // the code generator.
220 //
221 // Just remember to:
222 // - Close the class declaration with };
223 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
224 // - Close the include guard with #endif
225 // ===================================================================== //
226 // --(BEGIN CUSTOM CODE)--
227
242 USDSKEL_API
244
254 USDSKEL_API
256
262 USDSKEL_API
263 bool HasInbetween(const TfToken& name) const;
264
267 USDSKEL_API
268 std::vector<UsdSkelInbetweenShape> GetInbetweens() const;
269
272 USDSKEL_API
273 std::vector<UsdSkelInbetweenShape> GetAuthoredInbetweens() const;
274
280 USDSKEL_API
282 size_t numPoints,
283 std::string* reason=nullptr);
284
285private:
286 std::vector<UsdSkelInbetweenShape>
287 _MakeInbetweens(const std::vector<UsdProperty>& props) const;
288};
289
290PXR_NAMESPACE_CLOSE_SCOPE
291
292#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a range of contiguous elements.
Definition: span.h:71
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
Describes a target blend shape, possibly containing inbetween shapes.
Definition: blendShape.h:49
USDSKEL_API UsdAttribute GetOffsetsAttr() const
Required property.
USDSKEL_API UsdAttribute GetNormalOffsetsAttr() const
Required property.
USDSKEL_API UsdSkelInbetweenShape GetInbetween(const TfToken &name) const
Return the Inbetween corresponding to the attribute named name, which will be valid if an Inbetween a...
static USDSKEL_API UsdSkelBlendShape Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdSkelBlendShape holding the prim adhering to this schema at path on stage.
UsdSkelBlendShape(const UsdPrim &prim=UsdPrim())
Construct a UsdSkelBlendShape on UsdPrim prim .
Definition: blendShape.h:60
static USDSKEL_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDSKEL_API UsdAttribute CreatePointIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetPointIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: blendShape.h:54
USDSKEL_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDSKEL_API UsdAttribute CreateOffsetsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetOffsetsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API std::vector< UsdSkelInbetweenShape > GetInbetweens() const
Return valid UsdSkelInbetweenShape objects for all defined Inbetweens on this prim.
USDSKEL_API std::vector< UsdSkelInbetweenShape > GetAuthoredInbetweens() const
Like GetInbetweens(), but exclude inbetwens that have no authored scene / description.
virtual USDSKEL_API ~UsdSkelBlendShape()
Destructor.
USDSKEL_API UsdAttribute GetPointIndicesAttr() const
Optional property.
USDSKEL_API UsdSkelInbetweenShape CreateInbetween(const TfToken &name) const
Author scene description to create an attribute on this prim that will be recognized as an Inbetween ...
static USDSKEL_API UsdSkelBlendShape Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
static USDSKEL_API bool ValidatePointIndices(TfSpan< const int > indices, size_t numPoints, std::string *reason=nullptr)
Validates a set of point indices for a given point count.
UsdSkelBlendShape(const UsdSchemaBase &schemaObj)
Construct a UsdSkelBlendShape on the prim held by schemaObj .
Definition: blendShape.h:68
USDSKEL_API UsdAttribute CreateNormalOffsetsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetNormalOffsetsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API bool HasInbetween(const TfToken &name) const
Return true if there is a defined Inbetween named name on this prim.
Schema wrapper for UsdAttribute for authoring and introspecting attributes that serve as inbetween sh...
The base class for all typed schemas (those that can impart a typeName to a UsdPrim),...
Definition: typed.h:45
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440