Loading...
Searching...
No Matches
animation.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_ANIMATION_H
8#define USDSKEL_GENERATED_ANIMATION_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/vt/value.h"
20
21#include "pxr/base/gf/vec3d.h"
22#include "pxr/base/gf/vec3f.h"
24
25#include "pxr/base/tf/token.h"
26#include "pxr/base/tf/type.h"
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class SdfAssetPath;
31
32// -------------------------------------------------------------------------- //
33// SKELANIMATION //
34// -------------------------------------------------------------------------- //
35
46{
47public:
51 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
52
57 explicit UsdSkelAnimation(const UsdPrim& prim=UsdPrim())
58 : UsdTyped(prim)
59 {
60 }
61
65 explicit UsdSkelAnimation(const UsdSchemaBase& schemaObj)
66 : UsdTyped(schemaObj)
67 {
68 }
69
71 USDSKEL_API
73
77 USDSKEL_API
78 static const TfTokenVector &
79 GetSchemaAttributeNames(bool includeInherited=true);
80
90 USDSKEL_API
91 static UsdSkelAnimation
92 Get(const UsdStagePtr &stage, const SdfPath &path);
93
116 USDSKEL_API
117 static UsdSkelAnimation
118 Define(const UsdStagePtr &stage, const SdfPath &path);
119
120protected:
124 USDSKEL_API
126
127private:
128 // needs to invoke _GetStaticTfType.
129 friend class UsdSchemaRegistry;
130 USDSKEL_API
131 static const TfType &_GetStaticTfType();
132
133 static bool _IsTypedSchema();
134
135 // override SchemaBase virtuals.
136 USDSKEL_API
137 const TfType &_GetTfType() const override;
138
139public:
140 // --------------------------------------------------------------------- //
141 // JOINTS
142 // --------------------------------------------------------------------- //
154 USDSKEL_API
156
162 USDSKEL_API
163 UsdAttribute CreateJointsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
164
165public:
166 // --------------------------------------------------------------------- //
167 // TRANSLATIONS
168 // --------------------------------------------------------------------- //
177 USDSKEL_API
179
185 USDSKEL_API
186 UsdAttribute CreateTranslationsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
187
188public:
189 // --------------------------------------------------------------------- //
190 // ROTATIONS
191 // --------------------------------------------------------------------- //
201 USDSKEL_API
203
209 USDSKEL_API
210 UsdAttribute CreateRotationsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
211
212public:
213 // --------------------------------------------------------------------- //
214 // SCALES
215 // --------------------------------------------------------------------- //
225 USDSKEL_API
227
233 USDSKEL_API
234 UsdAttribute CreateScalesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
235
236public:
237 // --------------------------------------------------------------------- //
238 // BLENDSHAPES
239 // --------------------------------------------------------------------- //
252 USDSKEL_API
254
260 USDSKEL_API
261 UsdAttribute CreateBlendShapesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
262
263public:
264 // --------------------------------------------------------------------- //
265 // BLENDSHAPEWEIGHTS
266 // --------------------------------------------------------------------- //
277 USDSKEL_API
279
285 USDSKEL_API
286 UsdAttribute CreateBlendShapeWeightsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
287
288public:
289 // ===================================================================== //
290 // Feel free to add custom code below this line, it will be preserved by
291 // the code generator.
292 //
293 // Just remember to:
294 // - Close the class declaration with };
295 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
296 // - Close the include guard with #endif
297 // ===================================================================== //
298 // --(BEGIN CUSTOM CODE)--
299
303 USDSKEL_API
304 bool GetTransforms(VtMatrix4dArray* xforms,
305 UsdTimeCode time=UsdTimeCode::Default()) const;
306
309 USDSKEL_API
310 bool SetTransforms(const VtMatrix4dArray& xforms,
311 UsdTimeCode time=UsdTimeCode::Default()) const;
312};
313
314PXR_NAMESPACE_CLOSE_SCOPE
315
316#endif
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
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:183
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 skel animation, where joint animation is stored in a vectorized form.
Definition: animation.h:46
UsdSkelAnimation(const UsdSchemaBase &schemaObj)
Construct a UsdSkelAnimation on the prim held by schemaObj .
Definition: animation.h:65
USDSKEL_API bool SetTransforms(const VtMatrix4dArray &xforms, UsdTimeCode time=UsdTimeCode::Default()) const
Convenience method for setting an array of transforms.
USDSKEL_API UsdAttribute CreateRotationsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetRotationsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute GetBlendShapeWeightsAttr() const
Array of weight values for each blend shape.
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...
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: animation.h:51
USDSKEL_API bool GetTransforms(VtMatrix4dArray *xforms, UsdTimeCode time=UsdTimeCode::Default()) const
Convenience method for querying resolved transforms at time.
USDSKEL_API UsdAttribute CreateTranslationsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetTranslationsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute GetBlendShapesAttr() const
Array of tokens identifying which blend shapes this animation's data applies to.
USDSKEL_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDSKEL_API UsdSkelAnimation Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
USDSKEL_API UsdAttribute CreateScalesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetScalesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute CreateJointsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetJointsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
UsdSkelAnimation(const UsdPrim &prim=UsdPrim())
Construct a UsdSkelAnimation on UsdPrim prim .
Definition: animation.h:57
USDSKEL_API UsdAttribute CreateBlendShapeWeightsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetBlendShapeWeightsAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDSKEL_API UsdAttribute GetJointsAttr() const
Array of tokens identifying which joints this animation's data applies to.
virtual USDSKEL_API ~UsdSkelAnimation()
Destructor.
static USDSKEL_API UsdSkelAnimation Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdSkelAnimation holding the prim adhering to this schema at path on stage.
USDSKEL_API UsdAttribute GetTranslationsAttr() const
Joint-local translations of all affected joints.
USDSKEL_API UsdAttribute CreateBlendShapesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetBlendShapesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute GetRotationsAttr() const
Joint-local unit quaternion rotations of all affected joints, in 32-bit precision.
USDSKEL_API UsdAttribute GetScalesAttr() const
Joint-local scales of all affected joints, in 16 bit precision.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:72
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:113
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:152
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