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
bindingAPI.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_BINDINGAPI_H
8#define USDSKEL_GENERATED_BINDINGAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdSkel/api.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/usdGeom/primvar.h"
22
23#include "pxr/base/vt/value.h"
24
25#include "pxr/base/gf/vec3d.h"
26#include "pxr/base/gf/vec3f.h"
28
29#include "pxr/base/tf/token.h"
30#include "pxr/base/tf/type.h"
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34class SdfAssetPath;
35
36// -------------------------------------------------------------------------- //
37// SKELBINDINGAPI //
38// -------------------------------------------------------------------------- //
39
56{
57public:
61 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
62
67 explicit UsdSkelBindingAPI(const UsdPrim& prim=UsdPrim())
68 : UsdAPISchemaBase(prim)
69 {
70 }
71
75 explicit UsdSkelBindingAPI(const UsdSchemaBase& schemaObj)
76 : UsdAPISchemaBase(schemaObj)
77 {
78 }
79
81 USDSKEL_API
83
87 USDSKEL_API
88 static const TfTokenVector &
89 GetSchemaAttributeNames(bool includeInherited=true);
90
100 USDSKEL_API
101 static UsdSkelBindingAPI
102 Get(const UsdStagePtr &stage, const SdfPath &path);
103
104
121 USDSKEL_API
122 static bool
123 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
124
140 USDSKEL_API
141 static UsdSkelBindingAPI
142 Apply(const UsdPrim &prim);
143
144protected:
148 USDSKEL_API
150
151private:
152 // needs to invoke _GetStaticTfType.
153 friend class UsdSchemaRegistry;
154 USDSKEL_API
155 static const TfType &_GetStaticTfType();
156
157 static bool _IsTypedSchema();
158
159 // override SchemaBase virtuals.
160 USDSKEL_API
161 const TfType &_GetTfType() const override;
162
163public:
164 // --------------------------------------------------------------------- //
165 // SKINNINGMETHOD
166 // --------------------------------------------------------------------- //
176 USDSKEL_API
178
184 USDSKEL_API
185 UsdAttribute CreateSkinningMethodAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
186
187public:
188 // --------------------------------------------------------------------- //
189 // GEOMBINDTRANSFORM
190 // --------------------------------------------------------------------- //
202 USDSKEL_API
204
210 USDSKEL_API
211 UsdAttribute CreateGeomBindTransformAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
212
213public:
214 // --------------------------------------------------------------------- //
215 // JOINTS
216 // --------------------------------------------------------------------- //
229 USDSKEL_API
231
237 USDSKEL_API
238 UsdAttribute CreateJointsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
239
240public:
241 // --------------------------------------------------------------------- //
242 // JOINTINDICES
243 // --------------------------------------------------------------------- //
258 USDSKEL_API
260
266 USDSKEL_API
267 UsdAttribute CreateJointIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
268
269public:
270 // --------------------------------------------------------------------- //
271 // JOINTWEIGHTS
272 // --------------------------------------------------------------------- //
285 USDSKEL_API
287
293 USDSKEL_API
294 UsdAttribute CreateJointWeightsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
295
296public:
297 // --------------------------------------------------------------------- //
298 // BLENDSHAPES
299 // --------------------------------------------------------------------- //
313 USDSKEL_API
315
321 USDSKEL_API
322 UsdAttribute CreateBlendShapesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
323
324public:
325 // --------------------------------------------------------------------- //
326 // ANIMATIONSOURCE
327 // --------------------------------------------------------------------- //
332 USDSKEL_API
334
337 USDSKEL_API
339
340public:
341 // --------------------------------------------------------------------- //
342 // SKELETON
343 // --------------------------------------------------------------------- //
348 USDSKEL_API
350
353 USDSKEL_API
355
356public:
357 // --------------------------------------------------------------------- //
358 // BLENDSHAPETARGETS
359 // --------------------------------------------------------------------- //
364 USDSKEL_API
366
369 USDSKEL_API
371
372public:
373 // ===================================================================== //
374 // Feel free to add custom code below this line, it will be preserved by
375 // the code generator.
376 //
377 // Just remember to:
378 // - Close the class declaration with };
379 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
380 // - Close the include guard with #endif
381 // ===================================================================== //
382 // --(BEGIN CUSTOM CODE)--
383
387 USDSKEL_API
389
398 USDSKEL_API
400 int elementSize=-1) const;
401
405 USDSKEL_API
407
416 USDSKEL_API
418 int elementSize=-1) const;
419
422 USDSKEL_API
423 bool SetRigidJointInfluence(int jointIndex, float weight=1) const;
424
431 USDSKEL_API
432 bool GetSkeleton(UsdSkelSkeleton* skel) const;
433
440 USDSKEL_API
441 bool GetAnimationSource(UsdPrim* prim) const;
442
444 USDSKEL_API
446
449 USDSKEL_API
451
457 USDSKEL_API
459 size_t numJoints,
460 std::string* reason=nullptr);
461};
462
463PXR_NAMESPACE_CLOSE_SCOPE
464
465#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
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars.
Definition: primvar.h:245
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
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...
Provides API for authoring and extracting all the skinning-related data that lives in the "geometry h...
Definition: bindingAPI.h:56
virtual USDSKEL_API ~UsdSkelBindingAPI()
Destructor.
static USDSKEL_API bool ValidateJointIndices(TfSpan< const int > indices, size_t numJoints, std::string *reason=nullptr)
Validate an array of joint indices.
UsdSkelBindingAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdSkelBindingAPI on UsdPrim prim .
Definition: bindingAPI.h:67
USDSKEL_API UsdRelationship CreateAnimationSourceRel() const
See GetAnimationSourceRel(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDSKEL_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
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 UsdGeomPrimvar GetJointWeightsPrimvar() const
Convenience function to get the jointWeights attribute as a primvar.
USDSKEL_API UsdAttribute GetSkinningMethodAttr() const
The skinningMethod specifies the skinning method for the prim.
USDSKEL_API UsdRelationship CreateSkeletonRel() const
See GetSkeletonRel(), 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: bindingAPI.h:61
USDSKEL_API UsdRelationship GetAnimationSourceRel() const
Animation source to be bound to Skeleton primitives at or beneath the location at which this property...
USDSKEL_API UsdGeomPrimvar CreateJointIndicesPrimvar(bool constant, int elementSize=-1) const
Convenience function to create the jointIndices primvar, optionally specifying elementSize.
USDSKEL_API UsdGeomPrimvar CreateJointWeightsPrimvar(bool constant, int elementSize=-1) const
Convenience function to create the jointWeights primvar, optionally specifying elementSize.
USDSKEL_API UsdRelationship GetSkeletonRel() const
Skeleton to be bound to this prim and its descendents that possess a mapping and weighting to the joi...
USDSKEL_API UsdAttribute GetBlendShapesAttr() const
An array of tokens defining the order onto which blend shape weights from an animation source map ont...
USDSKEL_API UsdAttribute CreateJointWeightsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetJointWeightsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdSkelSkeleton GetInheritedSkeleton() const
Returns the skeleton bound at this prim, or one of its ancestors.
USDSKEL_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDSKEL_API UsdSkelBindingAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
USDSKEL_API UsdAttribute CreateJointIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetJointIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdGeomPrimvar GetJointIndicesPrimvar() const
Convenience function to get the jointIndices attribute as a primvar.
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.
USDSKEL_API bool GetSkeleton(UsdSkelSkeleton *skel) const
Convenience method to query the Skeleton bound on this prim.
USDSKEL_API UsdAttribute GetJointsAttr() const
An (optional) array of tokens defining the list of joints to which jointIndices apply.
USDSKEL_API UsdPrim GetInheritedAnimationSource() const
Returns the animation source bound at this prim, or one of its ancestors.
static USDSKEL_API UsdSkelBindingAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdSkelBindingAPI holding the prim adhering to this schema at path on stage.
USDSKEL_API UsdAttribute CreateSkinningMethodAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSkinningMethodAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute GetGeomBindTransformAttr() const
Encodes the bind-time world space transforms of the prim.
USDSKEL_API UsdAttribute CreateGeomBindTransformAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetGeomBindTransformAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
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 bool GetAnimationSource(UsdPrim *prim) const
Convenience method to query the animation source bound on this prim.
USDSKEL_API UsdAttribute GetJointIndicesAttr() const
Indices into the joints attribute of the closest (in namespace) bound Skeleton that affect each point...
USDSKEL_API UsdAttribute GetJointWeightsAttr() const
Weights for the joints that affect each point of a PointBased gprim.
USDSKEL_API UsdRelationship CreateBlendShapeTargetsRel() const
See GetBlendShapeTargetsRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API bool SetRigidJointInfluence(int jointIndex, float weight=1) const
Convenience method for defining joints influences that make a primitive rigidly deformed by a single ...
USDSKEL_API UsdRelationship GetBlendShapeTargetsRel() const
Ordered list of all target blend shapes.
UsdSkelBindingAPI(const UsdSchemaBase &schemaObj)
Construct a UsdSkelBindingAPI on the prim held by schemaObj .
Definition: bindingAPI.h:75
Describes a skeleton.
Definition: skeleton.h:47
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