HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
animationSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_ANIMATION_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_ANIMATION_SCHEMA_H
20 
21 /// \file
22 
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define USD_SKEL_IMAGING_ANIMATION_SCHEMA_TOKENS \
36  (skelAnimation) \
37  (joints) \
38  (translations) \
39  (rotations) \
40  (scales) \
41  (blendShapes) \
42  (blendShapeWeights) \
43 
44 TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingAnimationSchemaTokens, USDSKELIMAGING_API,
46 
47 //-----------------------------------------------------------------------------
48 
49 // Corresponds to UsdSkelAnimation.
50 //
51 
53 {
54 public:
55  /// \name Schema retrieval
56  /// @{
57 
58  UsdSkelImagingAnimationSchema(HdContainerDataSourceHandle container)
59  : HdSchema(container) {}
60 
61  /// Retrieves a container data source with the schema's default name token
62  /// "skelAnimation" from the parent container and constructs a
63  /// UsdSkelImagingAnimationSchema instance.
64  /// Because the requested container data source may not exist, the result
65  /// should be checked with IsDefined() or a bool comparison before use.
68  const HdContainerDataSourceHandle &fromParentContainer);
69 
70  /// @}
71 
72 // --(BEGIN CUSTOM CODE: Schema Methods)--
73 // --(END CUSTOM CODE: Schema Methods)--
74 
75  /// \name Member accessor
76  /// @{
77 
80 
83 
86 
89 
92 
95 
96  /// @}
97 
98  /// \name Schema location
99  /// @{
100 
101  /// Returns a token where the container representing this schema is found in
102  /// a container by default.
104  static const TfToken &GetSchemaToken();
105 
106  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
107  /// where the container representing this schema is found by default.
109  static const HdDataSourceLocator &GetDefaultLocator();
110 
111  /// @}
112 
113  /// \name Data source locators for members
114  ///
115  /// The following methods return an HdDataSourceLocator (relative to the
116  /// prim-level data source) where the data source for a member can be found.
117  ///
118  /// This is often useful for checking intersection against the
119  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
120  /// @{
121 
122  /// Prim-level relative data source locator to locate joints.
124  static const HdDataSourceLocator &GetJointsLocator();
125 
126  /// Prim-level relative data source locator to locate translations.
129 
130  /// Prim-level relative data source locator to locate rotations.
133 
134  /// Prim-level relative data source locator to locate scales.
136  static const HdDataSourceLocator &GetScalesLocator();
137 
138  /// Prim-level relative data source locator to locate blendShapes.
141 
142  /// Prim-level relative data source locator to locate blendShapeWeights.
145  /// @}
146 
147  /// \name Schema construction
148  /// @{
149 
150  /// \deprecated Use Builder instead.
151  ///
152  /// Builds a container data source which includes the provided child data
153  /// sources. Parameters with nullptr values are excluded. This is a
154  /// low-level interface. For cases in which it's desired to define
155  /// the container with a sparse set of child fields, the Builder class
156  /// is often more convenient and readable.
158  static HdContainerDataSourceHandle
160  const HdTokenArrayDataSourceHandle &joints,
161  const HdVec3fArrayDataSourceHandle &translations,
162  const HdQuatfArrayDataSourceHandle &rotations,
163  const HdVec3hArrayDataSourceHandle &scales,
164  const HdTokenArrayDataSourceHandle &blendShapes,
165  const HdFloatArrayDataSourceHandle &blendShapeWeights
166  );
167 
168  /// \class UsdSkelImagingAnimationSchema::Builder
169  ///
170  /// Utility class for setting sparse sets of child data source fields to be
171  /// filled as arguments into BuildRetained. Because all setter methods
172  /// return a reference to the instance, this can be used in the "builder
173  /// pattern" form.
174  class Builder
175  {
176  public:
179  const HdTokenArrayDataSourceHandle &joints);
182  const HdVec3fArrayDataSourceHandle &translations);
185  const HdQuatfArrayDataSourceHandle &rotations);
188  const HdVec3hArrayDataSourceHandle &scales);
191  const HdTokenArrayDataSourceHandle &blendShapes);
194  const HdFloatArrayDataSourceHandle &blendShapeWeights);
195 
196  /// Returns a container data source containing the members set thus far.
198  HdContainerDataSourceHandle Build();
199 
200  private:
202  HdVec3fArrayDataSourceHandle _translations;
203  HdQuatfArrayDataSourceHandle _rotations;
205  HdTokenArrayDataSourceHandle _blendShapes;
206  HdFloatArrayDataSourceHandle _blendShapeWeights;
207 
208  };
209 
210  /// @}
211 };
212 
214 
215 #endif
UsdSkelImagingAnimationSchema(HdContainerDataSourceHandle container)
HdVec3hArrayDataSource::Handle HdVec3hArrayDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetTranslationsLocator()
Prim-level relative data source locator to locate translations.
USDSKELIMAGING_API Builder & SetTranslations(const HdVec3fArrayDataSourceHandle &translations)
static USDSKELIMAGING_API const HdDataSourceLocator & GetJointsLocator()
Prim-level relative data source locator to locate joints.
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetBlendShapes() const
USDSKELIMAGING_API Builder & SetBlendShapeWeights(const HdFloatArrayDataSourceHandle &blendShapeWeights)
static USDSKELIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdTokenArrayDataSourceHandle &joints, const HdVec3fArrayDataSourceHandle &translations, const HdQuatfArrayDataSourceHandle &rotations, const HdVec3hArrayDataSourceHandle &scales, const HdTokenArrayDataSourceHandle &blendShapes, const HdFloatArrayDataSourceHandle &blendShapeWeights)
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapesLocator()
Prim-level relative data source locator to locate blendShapes.
static USDSKELIMAGING_API UsdSkelImagingAnimationSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
USDSKELIMAGING_API Builder & SetJoints(const HdTokenArrayDataSourceHandle &joints)
Definition: token.h:70
static USDSKELIMAGING_API const HdDataSourceLocator & GetRotationsLocator()
Prim-level relative data source locator to locate rotations.
USDSKELIMAGING_API Builder & SetScales(const HdVec3hArrayDataSourceHandle &scales)
HdQuatfArrayDataSource::Handle HdQuatfArrayDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapeWeightsLocator()
Prim-level relative data source locator to locate blendShapeWeights.
USDSKELIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
USDSKELIMAGING_API HdQuatfArrayDataSourceHandle GetRotations() const
USDSKELIMAGING_API Builder & SetBlendShapes(const HdTokenArrayDataSourceHandle &blendShapes)
USDSKELIMAGING_API HdFloatArrayDataSourceHandle GetBlendShapeWeights() const
HdVec3fArrayDataSource::Handle HdVec3fArrayDataSourceHandle
HdFloatArrayDataSource::Handle HdFloatArrayDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetScalesLocator()
Prim-level relative data source locator to locate scales.
#define USD_SKEL_IMAGING_ANIMATION_SCHEMA_TOKENS
#define USDSKELIMAGING_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDSKELIMAGING_API Builder & SetRotations(const HdQuatfArrayDataSourceHandle &rotations)
static USDSKELIMAGING_API const TfToken & GetSchemaToken()
USDSKELIMAGING_API HdVec3hArrayDataSourceHandle GetScales() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetJoints() const
static USDSKELIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
USDSKELIMAGING_API HdVec3fArrayDataSourceHandle GetTranslations() const
TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingAnimationSchemaTokens, USDSKELIMAGING_API, USD_SKEL_IMAGING_ANIMATION_SCHEMA_TOKENS)