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"
17 #include "pxr/usd/usdSkel/tokens.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"
26 #include "pxr/base/gf/matrix4d.h"
27 
28 #include "pxr/base/tf/token.h"
29 #include "pxr/base/tf/type.h"
30 
31 PXR_NAMESPACE_OPEN_SCOPE
32 
33 class SdfAssetPath;
34 
35 // -------------------------------------------------------------------------- //
36 // BLENDSHAPE //
37 // -------------------------------------------------------------------------- //
38 
49 {
50 public:
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
75  virtual ~UsdSkelBlendShape();
76 
80  USDSKEL_API
81  static const TfTokenVector &
82  GetSchemaAttributeNames(bool includeInherited=true);
83 
93  USDSKEL_API
94  static UsdSkelBlendShape
95  Get(const UsdStagePtr &stage, const SdfPath &path);
96 
119  USDSKEL_API
120  static UsdSkelBlendShape
121  Define(const UsdStagePtr &stage, const SdfPath &path);
122 
123 protected:
127  USDSKEL_API
128  UsdSchemaKind _GetSchemaKind() const override;
129 
130 private:
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 
142 public:
143  // --------------------------------------------------------------------- //
144  // OFFSETS
145  // --------------------------------------------------------------------- //
155  USDSKEL_API
157 
163  USDSKEL_API
164  UsdAttribute CreateOffsetsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
165 
166 public:
167  // --------------------------------------------------------------------- //
168  // NORMALOFFSETS
169  // --------------------------------------------------------------------- //
179  USDSKEL_API
181 
187  USDSKEL_API
188  UsdAttribute CreateNormalOffsetsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
189 
190 public:
191  // --------------------------------------------------------------------- //
192  // POINTINDICES
193  // --------------------------------------------------------------------- //
205  USDSKEL_API
207 
213  USDSKEL_API
214  UsdAttribute CreatePointIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
215 
216 public:
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
243  UsdSkelInbetweenShape CreateInbetween(const TfToken& name) const;
244 
254  USDSKEL_API
255  UsdSkelInbetweenShape GetInbetween(const TfToken& name) const;
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
281  static bool ValidatePointIndices(TfSpan<const int> indices,
282  size_t numPoints,
283  std::string* reason=nullptr);
284 
285 private:
286  std::vector<UsdSkelInbetweenShape>
287  _MakeInbetweens(const std::vector<UsdProperty>& props) const;
288 };
289 
290 PXR_NAMESPACE_CLOSE_SCOPE
291 
292 #endif
USDSKEL_API std::vector< UsdSkelInbetweenShape > GetAuthoredInbetweens() const
Like GetInbetweens(), but exclude inbetwens that have no authored scene / description.
Describes a target blend shape, possibly containing inbetween shapes.
Definition: blendShape.h:48
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 GetNormalOffsetsAttr() const
Required property.
UsdSkelBlendShape(const UsdSchemaBase &schemaObj)
Construct a UsdSkelBlendShape on the prim held by schemaObj .
Definition: blendShape.h:68
UsdSkelBlendShape(const UsdPrim &prim=UsdPrim())
Construct a UsdSkelBlendShape on UsdPrim prim .
Definition: blendShape.h:60
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
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 UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
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...
Represents a range of contiguous elements.
Definition: span.h:70
Represents a concrete typed schema.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:116
The base class for all typed schemas (those that can impart a typeName to a UsdPrim),...
Definition: typed.h:44
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.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
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...
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
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.
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
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 ...
TfType represents a dynamic runtime type.
Definition: type.h:47
Singleton registry that provides access to schema type information and the prim definitions for regis...
USDSKEL_API std::vector< UsdSkelInbetweenShape > GetInbetweens() const
Return valid UsdSkelInbetweenShape objects for all defined Inbetweens on this prim.
virtual USDSKEL_API ~UsdSkelBlendShape()
Destructor.
USDSKEL_API UsdAttribute GetOffsetsAttr() const
Required property.
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Schema wrapper for UsdAttribute for authoring and introspecting attributes that serve as inbetween sh...
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.
USDSKEL_API UsdAttribute GetPointIndicesAttr() const
Optional property.
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.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:89
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: blendShape.h:54
USDSKEL_API bool HasInbetween(const TfToken &name) const
Return true if there is a defined Inbetween named name on this prim.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...