HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bindingSchema.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_BINDING_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_BINDING_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_BINDING_SCHEMA_TOKENS \
36  (skelBinding) \
37  (animationSource) \
38  (skeleton) \
39  (joints) \
40  (blendShapes) \
41  (blendShapeTargets) \
42  (hasSkelRoot) \
43  ((skinningMethodPrimvar, "skel:skinningMethod")) \
44  ((geomBindTransformPrimvar, "skel:geomBindTransform")) \
45  ((jointIndicesPrimvar, "skel:jointIndices")) \
46  ((jointWeightsPrimvar, "skel:jointWeights")) \
47 
48 TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingBindingSchemaTokens, USDSKELIMAGING_API,
50 
51 //-----------------------------------------------------------------------------
52 
53 
54 /// \class UsdSkelImagingBindingSchema
55 ///
56 /// Corresponds to UsdSkelBindingAPI.
57 ///
59 {
60 public:
61  /// \name Schema retrieval
62  /// @{
63 
64  UsdSkelImagingBindingSchema(HdContainerDataSourceHandle container)
65  : HdSchema(container) {}
66 
67  /// Retrieves a container data source with the schema's default name token
68  /// "skelBinding" from the parent container and constructs a
69  /// UsdSkelImagingBindingSchema instance.
70  /// Because the requested container data source may not exist, the result
71  /// should be checked with IsDefined() or a bool comparison before use.
74  const HdContainerDataSourceHandle &fromParentContainer);
75 
76  /// @}
77 
78 // --(BEGIN CUSTOM CODE: Schema Methods)--
79 // --(END CUSTOM CODE: Schema Methods)--
80 
81  /// \name Member accessor
82  /// @{
83 
84  /// Note that in UsdSkel, the animation comes from the animationSource on
85  /// the Skeleton (which also carries the topology of the skeleton as
86  /// joints). This animationSource is either authored on the Skeleton
87  /// directly (and UsdSkelBindingAPI is applied) or inherited from an
88  /// ancestor of Skeleton (that has UsdSkelBindingAPI applied).
91 
94 
97 
98  /// This is not inherited according to the UsdSkel spec.
101 
102  /// This is not inherited according to the UsdSkel spec.
105 
106  /// Is this prim a descendant of a SkelRoot? Does not correspond to Usd
107  /// attribute and is actually populated by the SkelRoot and not the
108  /// SkelBinding.
111 
112  /// @}
113 
114  /// \name Schema location
115  /// @{
116 
117  /// Returns a token where the container representing this schema is found in
118  /// a container by default.
120  static const TfToken &GetSchemaToken();
121 
122  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
123  /// where the container representing this schema is found by default.
125  static const HdDataSourceLocator &GetDefaultLocator();
126 
127  /// @}
128 
129  /// \name Data source locators for members
130  ///
131  /// The following methods return an HdDataSourceLocator (relative to the
132  /// prim-level data source) where the data source for a member can be found.
133  ///
134  /// This is often useful for checking intersection against the
135  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
136  /// @{
137 
138  /// Prim-level relative data source locator to locate animationSource.
141 
142  /// Prim-level relative data source locator to locate skeleton.
144  static const HdDataSourceLocator &GetSkeletonLocator();
145 
146  /// Prim-level relative data source locator to locate joints.
148  static const HdDataSourceLocator &GetJointsLocator();
149 
150  /// Prim-level relative data source locator to locate blendShapes.
153 
154  /// Prim-level relative data source locator to locate blendShapeTargets.
157 
158  /// Prim-level relative data source locator to locate hasSkelRoot.
161  /// @}
162 
163  /// \name Schema construction
164  /// @{
165 
166  /// \deprecated Use Builder instead.
167  ///
168  /// Builds a container data source which includes the provided child data
169  /// sources. Parameters with nullptr values are excluded. This is a
170  /// low-level interface. For cases in which it's desired to define
171  /// the container with a sparse set of child fields, the Builder class
172  /// is often more convenient and readable.
174  static HdContainerDataSourceHandle
176  const HdPathDataSourceHandle &animationSource,
177  const HdPathDataSourceHandle &skeleton,
178  const HdTokenArrayDataSourceHandle &joints,
179  const HdTokenArrayDataSourceHandle &blendShapes,
180  const HdPathArrayDataSourceHandle &blendShapeTargets,
181  const HdBoolDataSourceHandle &hasSkelRoot
182  );
183 
184  /// \class UsdSkelImagingBindingSchema::Builder
185  ///
186  /// Utility class for setting sparse sets of child data source fields to be
187  /// filled as arguments into BuildRetained. Because all setter methods
188  /// return a reference to the instance, this can be used in the "builder
189  /// pattern" form.
190  class Builder
191  {
192  public:
195  const HdPathDataSourceHandle &animationSource);
198  const HdPathDataSourceHandle &skeleton);
201  const HdTokenArrayDataSourceHandle &joints);
204  const HdTokenArrayDataSourceHandle &blendShapes);
207  const HdPathArrayDataSourceHandle &blendShapeTargets);
210  const HdBoolDataSourceHandle &hasSkelRoot);
211 
212  /// Returns a container data source containing the members set thus far.
214  HdContainerDataSourceHandle Build();
215 
216  private:
217  HdPathDataSourceHandle _animationSource;
218  HdPathDataSourceHandle _skeleton;
220  HdTokenArrayDataSourceHandle _blendShapes;
221  HdPathArrayDataSourceHandle _blendShapeTargets;
222  HdBoolDataSourceHandle _hasSkelRoot;
223 
224  };
225 
226  /// @}
227 };
228 
230 
231 #endif
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetJoints() const
USDSKELIMAGING_API HdPathDataSourceHandle GetAnimationSource() const
USDSKELIMAGING_API Builder & SetSkeleton(const HdPathDataSourceHandle &skeleton)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HdPathArrayDataSource::Handle HdPathArrayDataSourceHandle
USDSKELIMAGING_API Builder & SetBlendShapes(const HdTokenArrayDataSourceHandle &blendShapes)
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetBlendShapes() const
This is not inherited according to the UsdSkel spec.
static USDSKELIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &animationSource, const HdPathDataSourceHandle &skeleton, const HdTokenArrayDataSourceHandle &joints, const HdTokenArrayDataSourceHandle &blendShapes, const HdPathArrayDataSourceHandle &blendShapeTargets, const HdBoolDataSourceHandle &hasSkelRoot)
UsdSkelImagingBindingSchema(HdContainerDataSourceHandle container)
Definition: bindingSchema.h:64
USDSKELIMAGING_API Builder & SetJoints(const HdTokenArrayDataSourceHandle &joints)
USDSKELIMAGING_API Builder & SetAnimationSource(const HdPathDataSourceHandle &animationSource)
static USDSKELIMAGING_API const TfToken & GetSchemaToken()
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingBindingSchemaTokens, USDSKELIMAGING_API, USD_SKEL_IMAGING_BINDING_SCHEMA_TOKENS)
USDSKELIMAGING_API Builder & SetHasSkelRoot(const HdBoolDataSourceHandle &hasSkelRoot)
HdBoolDataSource::Handle HdBoolDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetAnimationSourceLocator()
Prim-level relative data source locator to locate animationSource.
USDSKELIMAGING_API Builder & SetBlendShapeTargets(const HdPathArrayDataSourceHandle &blendShapeTargets)
USDSKELIMAGING_API HdBoolDataSourceHandle GetHasSkelRoot() const
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapesLocator()
Prim-level relative data source locator to locate blendShapes.
#define USD_SKEL_IMAGING_BINDING_SCHEMA_TOKENS
Definition: bindingSchema.h:35
#define USDSKELIMAGING_API
Definition: api.h:23
USDSKELIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static USDSKELIMAGING_API const HdDataSourceLocator & GetHasSkelRootLocator()
Prim-level relative data source locator to locate hasSkelRoot.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static USDSKELIMAGING_API const HdDataSourceLocator & GetJointsLocator()
Prim-level relative data source locator to locate joints.
static USDSKELIMAGING_API const HdDataSourceLocator & GetSkeletonLocator()
Prim-level relative data source locator to locate skeleton.
static USDSKELIMAGING_API UsdSkelImagingBindingSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDSKELIMAGING_API HdPathDataSourceHandle GetSkeleton() const
USDSKELIMAGING_API HdPathArrayDataSourceHandle GetBlendShapeTargets() const
This is not inherited according to the UsdSkel spec.
HdPathDataSource::Handle HdPathDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
static USDSKELIMAGING_API const HdDataSourceLocator & GetBlendShapeTargetsLocator()
Prim-level relative data source locator to locate blendShapeTargets.