All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bindingAPI.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USDSKEL_GENERATED_BINDINGAPI_H
25 #define USDSKEL_GENERATED_BINDINGAPI_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdSkel/api.h"
31 #include "pxr/usd/usd/apiSchemaBase.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "pxr/usd/usdSkel/tokens.h"
35 
36 #include "pxr/base/tf/span.h"
37 #include "pxr/usd/usdGeom/primvar.h"
38 #include "pxr/usd/usdSkel/skeleton.h"
39 
40 #include "pxr/base/vt/value.h"
41 
42 #include "pxr/base/gf/vec3d.h"
43 #include "pxr/base/gf/vec3f.h"
44 #include "pxr/base/gf/matrix4d.h"
45 
46 #include "pxr/base/tf/token.h"
47 #include "pxr/base/tf/type.h"
48 
49 PXR_NAMESPACE_OPEN_SCOPE
50 
51 class SdfAssetPath;
52 
53 // -------------------------------------------------------------------------- //
54 // SKELBINDINGAPI //
55 // -------------------------------------------------------------------------- //
56 
68 {
69 public:
74 
79  explicit UsdSkelBindingAPI(const UsdPrim& prim=UsdPrim())
80  : UsdAPISchemaBase(prim)
81  {
82  }
83 
87  explicit UsdSkelBindingAPI(const UsdSchemaBase& schemaObj)
88  : UsdAPISchemaBase(schemaObj)
89  {
90  }
91 
93  USDSKEL_API
94  virtual ~UsdSkelBindingAPI();
95 
99  USDSKEL_API
100  static const TfTokenVector &
101  GetSchemaAttributeNames(bool includeInherited=true);
102 
112  USDSKEL_API
113  static UsdSkelBindingAPI
114  Get(const UsdStagePtr &stage, const SdfPath &path);
115 
116 
129  USDSKEL_API
130  static UsdSkelBindingAPI
131  Apply(const UsdPrim &prim);
132 
133 protected:
137  USDSKEL_API
138  UsdSchemaType _GetSchemaType() const override;
139 
140 private:
141  // needs to invoke _GetStaticTfType.
142  friend class UsdSchemaRegistry;
143  USDSKEL_API
144  static const TfType &_GetStaticTfType();
145 
146  static bool _IsTypedSchema();
147 
148  // override SchemaBase virtuals.
149  USDSKEL_API
150  const TfType &_GetTfType() const override;
151 
152 public:
153  // --------------------------------------------------------------------- //
154  // GEOMBINDTRANSFORM
155  // --------------------------------------------------------------------- //
166  USDSKEL_API
168 
174  USDSKEL_API
175  UsdAttribute CreateGeomBindTransformAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
176 
177 public:
178  // --------------------------------------------------------------------- //
179  // JOINTS
180  // --------------------------------------------------------------------- //
191  USDSKEL_API
192  UsdAttribute GetJointsAttr() const;
193 
199  USDSKEL_API
200  UsdAttribute CreateJointsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
201 
202 public:
203  // --------------------------------------------------------------------- //
204  // JOINTINDICES
205  // --------------------------------------------------------------------- //
219  USDSKEL_API
221 
227  USDSKEL_API
228  UsdAttribute CreateJointIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
229 
230 public:
231  // --------------------------------------------------------------------- //
232  // JOINTWEIGHTS
233  // --------------------------------------------------------------------- //
245  USDSKEL_API
247 
253  USDSKEL_API
254  UsdAttribute CreateJointWeightsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
255 
256 public:
257  // --------------------------------------------------------------------- //
258  // BLENDSHAPES
259  // --------------------------------------------------------------------- //
271  USDSKEL_API
273 
279  USDSKEL_API
280  UsdAttribute CreateBlendShapesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
281 
282 public:
283  // --------------------------------------------------------------------- //
284  // ANIMATIONSOURCE
285  // --------------------------------------------------------------------- //
290  USDSKEL_API
292 
295  USDSKEL_API
297 
298 public:
299  // --------------------------------------------------------------------- //
300  // SKELETON
301  // --------------------------------------------------------------------- //
306  USDSKEL_API
308 
311  USDSKEL_API
313 
314 public:
315  // --------------------------------------------------------------------- //
316  // BLENDSHAPETARGETS
317  // --------------------------------------------------------------------- //
322  USDSKEL_API
324 
327  USDSKEL_API
329 
330 public:
331  // ===================================================================== //
332  // Feel free to add custom code below this line, it will be preserved by
333  // the code generator.
334  //
335  // Just remember to:
336  // - Close the class declaration with };
337  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
338  // - Close the include guard with #endif
339  // ===================================================================== //
340  // --(BEGIN CUSTOM CODE)--
341 
345  USDSKEL_API
347 
356  USDSKEL_API
358  int elementSize=-1) const;
359 
363  USDSKEL_API
365 
374  USDSKEL_API
376  int elementSize=-1) const;
377 
380  USDSKEL_API
381  bool SetRigidJointInfluence(int jointIndex, float weight=1) const;
382 
389  USDSKEL_API
390  bool GetSkeleton(UsdSkelSkeleton* skel) const;
391 
398  USDSKEL_API
399  bool GetAnimationSource(UsdPrim* prim) const;
400 
402  USDSKEL_API
404 
407  USDSKEL_API
409 
415  USDSKEL_API
416  static bool ValidateJointIndices(TfSpan<const int> indices,
417  size_t numJoints,
418  std::string* reason=nullptr);
419 };
420 
421 PXR_NAMESPACE_CLOSE_SCOPE
422 
423 #endif
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 UsdSchemaType _GetSchemaType() const override
Returns the type of schema this class belongs to.
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 GetJointsAttr() const
An (optional) array of tokens defining the list of joints to which jointIndices apply.
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 GetSkeleton(UsdSkelSkeleton *skel) const
Convenience method to query the Skeleton bound on this prim.
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...
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
USDSKEL_API UsdGeomPrimvar GetJointIndicesPrimvar() const
Convenience function to get the jointIndices attribute as a primvar.
USDSKEL_API bool GetAnimationSource(UsdPrim *prim) const
Convenience method to query the animation source bound on this prim.
UsdSkelBindingAPI(const UsdSchemaBase &schemaObj)
Construct a UsdSkelBindingAPI on the prim held by schemaObj .
Definition: bindingAPI.h:87
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 GetJointIndicesAttr() const
Indices into the joints attribute of the closest (in namespace) bound Skeleton that affect each point...
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...
static USDSKEL_API UsdSkelBindingAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
Represents a range of contiguous elements.
Definition: span.h:87
UsdSchemaType
An enum representing which type of schema a given schema class belongs to.
Definition: common.h:149
Provides API for authoring and extracting all the skinning-related data that lives in the &quot;geometry h...
Definition: bindingAPI.h:67
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
Single Apply API schema.
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...
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
USDSKEL_API UsdRelationship GetBlendShapeTargetsRel() const
Ordered list of all target blend shapes.
USDSKEL_API UsdPrim GetInheritedAnimationSource() const
Returns the animation source bound at this prim, or one of its ancestors.
Describes a skeleton.
Definition: skeleton.h:63
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128
static const UsdSchemaType schemaType
Compile time constant representing what kind of schema this class is.
Definition: bindingAPI.h:73
USDSKEL_API UsdGeomPrimvar GetJointWeightsPrimvar() const
Convenience function to get the jointWeights attribute as a primvar.
virtual USDSKEL_API ~UsdSkelBindingAPI()
Destructor.
USDSKEL_API UsdAttribute GetGeomBindTransformAttr() const
Encodes the bind-time world space transforms of the prim.
Contains an asset path and an optional resolved path.
Definition: assetPath.h:43
USDSKEL_API UsdRelationship GetSkeletonRel() const
Skeleton to be bound to this prim and its descendents that possess a mapping and weighting to the joi...
static USDSKEL_API bool ValidateJointIndices(TfSpan< const int > indices, size_t numJoints, std::string *reason=nullptr)
Validate an array of joint indices.
USDSKEL_API UsdGeomPrimvar CreateJointIndicesPrimvar(bool constant, int elementSize=-1) const
Convenience function to create the jointIndices primvar, optionally specifying elementSize.
USDSKEL_API UsdSkelSkeleton GetInheritedSkeleton() const
Returns the skeleton bound at this prim, or one of its ancestors.
TfType represents a dynamic runtime type.
Definition: type.h:70
Singleton registry that provides access to prim and property definition information for registered Us...
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 CreateJointWeightsPrimvar(bool constant, int elementSize=-1) const
Convenience function to create the jointWeights primvar, optionally specifying elementSize.
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 CreateSkeletonRel() const
See GetSkeletonRel(), and also Create vs Get Property Methods for when to use Get vs Create...
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars...
Definition: primvar.h:260
The base class for all schema types in Usd.
Definition: schemaBase.h:56
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 UsdRelationship GetAnimationSourceRel() const
Animation source to be bound to Skeleton primitives at or beneath the location at which this property...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
USDSKEL_API UsdRelationship CreateAnimationSourceRel() const
See GetAnimationSourceRel(), and also Create vs Get Property Methods for when to use Get vs Create...
UsdSkelBindingAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdSkelBindingAPI on UsdPrim prim .
Definition: bindingAPI.h:79