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  (skelLocalToWorld) \
38  (skinningTransforms) \
39  (blendShapes) \
40  (blendShapeWeights) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingResolvedSkeletonSchemaTokens, USDSKELIMAGING_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 // Resolved data for a skeleton and the targeted skelAnim. Populated by the
48 // skeleton resolving scene index.
49 //
50 
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  UsdSkelImagingResolvedSkeletonSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  /// Retrieves a container data source with the schema's default name token
61  /// "resolvedSkeleton" from the parent container and constructs a
62  /// UsdSkelImagingResolvedSkeletonSchema instance.
63  /// Because the requested container data source may not exist, the result
64  /// should be checked with IsDefined() or a bool comparison before use.
67  const HdContainerDataSourceHandle &fromParentContainer);
68 
69  /// @}
70 
71 // --(BEGIN CUSTOM CODE: Schema Methods)--
72 // --(END CUSTOM CODE: Schema Methods)--
73 
74  /// \name Member accessor
75  /// @{
76 
77  /// Xform of skeleton prim.
80 
81  /// Passed to the extComputations. Computed from the following: skeleton's
82  /// joints (determining the topology), and bind and rest (if needed)
83  /// transforms. skelAnim's joints (determining the remapping) and
84  /// translations, rotations and scales.
87 
88  /// Just forwarded from the skelAnim's blendShapes.
91 
92  /// Just forwarded from the skelAnim's blendShapeWeights.
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 skelLocalToWorld.
125 
126  /// Prim-level relative data source locator to locate skinningTransforms.
129 
130  /// Prim-level relative data source locator to locate blendShapes.
133 
134  /// Prim-level relative data source locator to locate blendShapeWeights.
137  /// @}
138 
139  /// \name Schema construction
140  /// @{
141 
142  /// \deprecated Use Builder instead.
143  ///
144  /// Builds a container data source which includes the provided child data
145  /// sources. Parameters with nullptr values are excluded. This is a
146  /// low-level interface. For cases in which it's desired to define
147  /// the container with a sparse set of child fields, the Builder class
148  /// is often more convenient and readable.
150  static HdContainerDataSourceHandle
152  const HdMatrixDataSourceHandle &skelLocalToWorld,
153  const HdMatrix4fArrayDataSourceHandle &skinningTransforms,
154  const HdTokenArrayDataSourceHandle &blendShapes,
155  const HdFloatArrayDataSourceHandle &blendShapeWeights
156  );
157 
158  /// \class UsdSkelImagingResolvedSkeletonSchema::Builder
159  ///
160  /// Utility class for setting sparse sets of child data source fields to be
161  /// filled as arguments into BuildRetained. Because all setter methods
162  /// return a reference to the instance, this can be used in the "builder
163  /// pattern" form.
164  class Builder
165  {
166  public:
169  const HdMatrixDataSourceHandle &skelLocalToWorld);
172  const HdMatrix4fArrayDataSourceHandle &skinningTransforms);
175  const HdTokenArrayDataSourceHandle &blendShapes);
178  const HdFloatArrayDataSourceHandle &blendShapeWeights);
179 
180  /// Returns a container data source containing the members set thus far.
182  HdContainerDataSourceHandle Build();
183 
184  private:
185  HdMatrixDataSourceHandle _skelLocalToWorld;
186  HdMatrix4fArrayDataSourceHandle _skinningTransforms;
187  HdTokenArrayDataSourceHandle _blendShapes;
188  HdFloatArrayDataSourceHandle _blendShapeWeights;
189 
190  };
191 
192  /// @}
193 };
194 
196 
197 #endif
USDSKELIMAGING_API Builder & SetBlendShapeWeights(const HdFloatArrayDataSourceHandle &blendShapeWeights)
USDSKELIMAGING_API HdFloatArrayDataSourceHandle GetBlendShapeWeights() const
Just forwarded from the skelAnim's blendShapeWeights.
USDSKELIMAGING_API Builder & SetSkelLocalToWorld(const HdMatrixDataSourceHandle &skelLocalToWorld)
static USDSKELIMAGING_API const TfToken & GetSchemaToken()
HdMatrix4fArrayDataSource::Handle HdMatrix4fArrayDataSourceHandle
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
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.
static USDSKELIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdMatrixDataSourceHandle &skelLocalToWorld, const HdMatrix4fArrayDataSourceHandle &skinningTransforms, const HdTokenArrayDataSourceHandle &blendShapes, const HdFloatArrayDataSourceHandle &blendShapeWeights)
USDSKELIMAGING_API HdMatrixDataSourceHandle GetSkelLocalToWorld() const
Xform of skeleton prim.
USDSKELIMAGING_API HdMatrix4fArrayDataSourceHandle GetSkinningTransforms() const
static USDSKELIMAGING_API const HdDataSourceLocator & GetSkelLocalToWorldLocator()
Prim-level relative data source locator to locate skelLocalToWorld.
#define USDSKELIMAGING_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
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)