HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
resolvedSkeletonSchema.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_RESOLVED_SKELETON_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_RESOLVED_SKELETON_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_RESOLVED_SKELETON_SCHEMA_TOKENS \
36  (resolvedSkeleton) \
37  (skelLocalToCommonSpace) \
38  (skinningTransforms) \
39  (blendShapes) \
40  (blendShapeWeights) \
41  (blendShapeRanges) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingResolvedSkeletonSchemaTokens, USDSKELIMAGING_API,
45 
46 //-----------------------------------------------------------------------------
47 
48 
49 /// \class UsdSkelImagingResolvedSkeletonSchema
50 ///
51 /// Resolved data for a skeleton and the targeted skelAnim. Populated by the
52 /// skeleton resolving scene index.
53 ///
55 {
56 public:
57  /// \name Schema retrieval
58  /// @{
59 
60  UsdSkelImagingResolvedSkeletonSchema(HdContainerDataSourceHandle container)
61  : HdSchema(container) {}
62 
63  /// Retrieves a container data source with the schema's default name token
64  /// "resolvedSkeleton" from the parent container and constructs a
65  /// UsdSkelImagingResolvedSkeletonSchema instance.
66  /// Because the requested container data source may not exist, the result
67  /// should be checked with IsDefined() or a bool comparison before use.
70  const HdContainerDataSourceHandle &fromParentContainer);
71 
72  /// @}
73 
74 // --(BEGIN CUSTOM CODE: Schema Methods)--
75 // --(END CUSTOM CODE: Schema Methods)--
76 
77  /// \name Member accessor
78  /// @{
79 
80  /// Transform to go from the local space if the skeleton prim to common
81  /// space (as defined by UsdSkelImagingDataSourceXformResolver).
84 
85  /// Passed to the extComputations. Computed from the following: skeleton's
86  /// joints (determining the topology), and bind and rest (if needed)
87  /// transforms. skelAnim's joints (determining the remapping) and
88  /// translations, rotations and scales.
91 
92  /// Just forwarded from the skelAnim's blendShapes.
95 
96  /// Just forwarded from the skelAnim's blendShapeWeights.
99 
100  /// Ranges for concatenated blendShapes/Weights.
103 
104  /// @}
105 
106  /// \name Schema location
107  /// @{
108 
109  /// Returns a token where the container representing this schema is found in
110  /// a container by default.
112  static const TfToken &GetSchemaToken();
113 
114  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
115  /// where the container representing this schema is found by default.
117  static const HdDataSourceLocator &GetDefaultLocator();
118 
119  /// @}
120 
121  /// \name Data source locators for members
122  ///
123  /// The following methods return an HdDataSourceLocator (relative to the
124  /// prim-level data source) where the data source for a member can be found.
125  ///
126  /// This is often useful for checking intersection against the
127  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
128  /// @{
129 
130  /// Prim-level relative data source locator to locate skelLocalToCommonSpace.
133 
134  /// Prim-level relative data source locator to locate skinningTransforms.
137 
138  /// Prim-level relative data source locator to locate blendShapes.
141 
142  /// Prim-level relative data source locator to locate blendShapeWeights.
145 
146  /// Prim-level relative data source locator to locate blendShapeRanges.
149  /// @}
150 
151  /// \name Schema construction
152  /// @{
153 
154  /// \deprecated Use Builder instead.
155  ///
156  /// Builds a container data source which includes the provided child data
157  /// sources. Parameters with nullptr values are excluded. This is a
158  /// low-level interface. For cases in which it's desired to define
159  /// the container with a sparse set of child fields, the Builder class
160  /// is often more convenient and readable.
162  static HdContainerDataSourceHandle
164  const HdMatrixDataSourceHandle &skelLocalToCommonSpace,
165  const HdMatrix4fArrayDataSourceHandle &skinningTransforms,
166  const HdTokenArrayDataSourceHandle &blendShapes,
167  const HdFloatArrayDataSourceHandle &blendShapeWeights,
168  const HdVec2iArrayDataSourceHandle &blendShapeRanges
169  );
170 
171  /// \class UsdSkelImagingResolvedSkeletonSchema::Builder
172  ///
173  /// Utility class for setting sparse sets of child data source fields to be
174  /// filled as arguments into BuildRetained. Because all setter methods
175  /// return a reference to the instance, this can be used in the "builder
176  /// pattern" form.
177  class Builder
178  {
179  public:
182  const HdMatrixDataSourceHandle &skelLocalToCommonSpace);
185  const HdMatrix4fArrayDataSourceHandle &skinningTransforms);
188  const HdTokenArrayDataSourceHandle &blendShapes);
191  const HdFloatArrayDataSourceHandle &blendShapeWeights);
194  const HdVec2iArrayDataSourceHandle &blendShapeRanges);
195 
196  /// Returns a container data source containing the members set thus far.
198  HdContainerDataSourceHandle Build();
199 
200  private:
201  HdMatrixDataSourceHandle _skelLocalToCommonSpace;
202  HdMatrix4fArrayDataSourceHandle _skinningTransforms;
203  HdTokenArrayDataSourceHandle _blendShapes;
204  HdFloatArrayDataSourceHandle _blendShapeWeights;
205  HdVec2iArrayDataSourceHandle _blendShapeRanges;
206 
207  };
208 
209  /// @}
210 };
211 
213 
214 #endif
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapeRangesLocator()
Prim-level relative data source locator to locate blendShapeRanges.
USDSKELIMAGING_API Builder & SetBlendShapeWeights(const HdFloatArrayDataSourceHandle &blendShapeWeights)
USDSKELIMAGING_API HdFloatArrayDataSourceHandle GetBlendShapeWeights() const
Just forwarded from the skelAnim's blendShapeWeights.
USDSKELIMAGING_API HdVec2iArrayDataSourceHandle GetBlendShapeRanges() const
Ranges for concatenated blendShapes/Weights.
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HdVec2iArrayDataSource::Handle HdVec2iArrayDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetSkelLocalToCommonSpaceLocator()
Prim-level relative data source locator to locate skelLocalToCommonSpace.
USDSKELIMAGING_API HdMatrixDataSourceHandle GetSkelLocalToCommonSpace() const
static USDSKELIMAGING_API const TfToken & GetSchemaToken()
HdMatrix4fArrayDataSource::Handle HdMatrix4fArrayDataSourceHandle
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
USDSKELIMAGING_API Builder & SetBlendShapeRanges(const HdVec2iArrayDataSourceHandle &blendShapeRanges)
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingResolvedSkeletonSchemaTokens, USDSKELIMAGING_API, USD_SKEL_IMAGING_RESOLVED_SKELETON_SCHEMA_TOKENS)
#define USD_SKEL_IMAGING_RESOLVED_SKELETON_SCHEMA_TOKENS
UsdSkelImagingResolvedSkeletonSchema(HdContainerDataSourceHandle container)
HdMatrixDataSource::Handle HdMatrixDataSourceHandle
HdFloatArrayDataSource::Handle HdFloatArrayDataSourceHandle
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetBlendShapes() const
Just forwarded from the skelAnim's blendShapes.
USDSKELIMAGING_API Builder & SetSkelLocalToCommonSpace(const HdMatrixDataSourceHandle &skelLocalToCommonSpace)
USDSKELIMAGING_API HdMatrix4fArrayDataSourceHandle GetSkinningTransforms() const
#define USDSKELIMAGING_API
Definition: api.h:23
static USDSKELIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdMatrixDataSourceHandle &skelLocalToCommonSpace, const HdMatrix4fArrayDataSourceHandle &skinningTransforms, const HdTokenArrayDataSourceHandle &blendShapes, const HdFloatArrayDataSourceHandle &blendShapeWeights, const HdVec2iArrayDataSourceHandle &blendShapeRanges)
USDSKELIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static USDSKELIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapeWeightsLocator()
Prim-level relative data source locator to locate blendShapeWeights.
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapesLocator()
Prim-level relative data source locator to locate blendShapes.
USDSKELIMAGING_API Builder & SetBlendShapes(const HdTokenArrayDataSourceHandle &blendShapes)
static USDSKELIMAGING_API const HdDataSourceLocator & GetSkinningTransformsLocator()
Prim-level relative data source locator to locate skinningTransforms.
static USDSKELIMAGING_API UsdSkelImagingResolvedSkeletonSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDSKELIMAGING_API Builder & SetSkinningTransforms(const HdMatrix4fArrayDataSourceHandle &skinningTransforms)