HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
skeletonSchema.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_SKELETON_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_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_SKELETON_SCHEMA_TOKENS \
36  (skeleton) \
37  (joints) \
38  (jointNames) \
39  (bindTransforms) \
40  (restTransforms) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingSkeletonSchemaTokens, USDSKELIMAGING_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 
48 /// \class UsdSkelImagingSkeletonSchema
49 ///
50 /// Corresponds to UsdSkelSkeleton.
51 ///
53 {
54 public:
55  /// \name Schema retrieval
56  /// @{
57 
58  UsdSkelImagingSkeletonSchema(HdContainerDataSourceHandle container)
59  : HdSchema(container) {}
60 
61  /// Retrieves a container data source with the schema's default name token
62  /// "skeleton" from the parent container and constructs a
63  /// UsdSkelImagingSkeletonSchema 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 
78  /// Determines topology of skeleton.
81 
82  /// Here for completeness but ignored for posing the geometry. See
83  /// Skeleton.jointNames in usdSkel/schema for uses.
86 
89 
90  /// These are local rest transforms.
93 
94  /// @}
95 
96  /// \name Schema location
97  /// @{
98 
99  /// Returns a token where the container representing this schema is found in
100  /// a container by default.
102  static const TfToken &GetSchemaToken();
103 
104  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
105  /// where the container representing this schema is found by default.
107  static const HdDataSourceLocator &GetDefaultLocator();
108 
109  /// @}
110 
111  /// \name Data source locators for members
112  ///
113  /// The following methods return an HdDataSourceLocator (relative to the
114  /// prim-level data source) where the data source for a member can be found.
115  ///
116  /// This is often useful for checking intersection against the
117  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
118  /// @{
119 
120  /// Prim-level relative data source locator to locate joints.
122  static const HdDataSourceLocator &GetJointsLocator();
123 
124  /// Prim-level relative data source locator to locate jointNames.
127 
128  /// Prim-level relative data source locator to locate bindTransforms.
131 
132  /// Prim-level relative data source locator to locate restTransforms.
135  /// @}
136 
137  /// \name Schema construction
138  /// @{
139 
140  /// \deprecated Use Builder instead.
141  ///
142  /// Builds a container data source which includes the provided child data
143  /// sources. Parameters with nullptr values are excluded. This is a
144  /// low-level interface. For cases in which it's desired to define
145  /// the container with a sparse set of child fields, the Builder class
146  /// is often more convenient and readable.
148  static HdContainerDataSourceHandle
150  const HdTokenArrayDataSourceHandle &joints,
151  const HdTokenArrayDataSourceHandle &jointNames,
152  const HdMatrixArrayDataSourceHandle &bindTransforms,
153  const HdMatrixArrayDataSourceHandle &restTransforms
154  );
155 
156  /// \class UsdSkelImagingSkeletonSchema::Builder
157  ///
158  /// Utility class for setting sparse sets of child data source fields to be
159  /// filled as arguments into BuildRetained. Because all setter methods
160  /// return a reference to the instance, this can be used in the "builder
161  /// pattern" form.
162  class Builder
163  {
164  public:
167  const HdTokenArrayDataSourceHandle &joints);
170  const HdTokenArrayDataSourceHandle &jointNames);
173  const HdMatrixArrayDataSourceHandle &bindTransforms);
176  const HdMatrixArrayDataSourceHandle &restTransforms);
177 
178  /// Returns a container data source containing the members set thus far.
180  HdContainerDataSourceHandle Build();
181 
182  private:
184  HdTokenArrayDataSourceHandle _jointNames;
185  HdMatrixArrayDataSourceHandle _bindTransforms;
186  HdMatrixArrayDataSourceHandle _restTransforms;
187 
188  };
189 
190  /// @}
191 };
192 
194 
195 #endif
UsdSkelImagingSkeletonSchema(HdContainerDataSourceHandle container)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
USDSKELIMAGING_API Builder & SetJointNames(const HdTokenArrayDataSourceHandle &jointNames)
#define USD_SKEL_IMAGING_SKELETON_SCHEMA_TOKENS
static USDSKELIMAGING_API const HdDataSourceLocator & GetJointNamesLocator()
Prim-level relative data source locator to locate jointNames.
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetJoints() const
Determines topology of skeleton.
HdMatrixArrayDataSource::Handle HdMatrixArrayDataSourceHandle
static USDSKELIMAGING_API const HdDataSourceLocator & GetBindTransformsLocator()
Prim-level relative data source locator to locate bindTransforms.
static USDSKELIMAGING_API const HdDataSourceLocator & GetJointsLocator()
Prim-level relative data source locator to locate joints.
USDSKELIMAGING_API HdTokenArrayDataSourceHandle GetJointNames() const
USDSKELIMAGING_API HdMatrixArrayDataSourceHandle GetRestTransforms() const
These are local rest transforms.
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
USDSKELIMAGING_API Builder & SetJoints(const HdTokenArrayDataSourceHandle &joints)
USDSKELIMAGING_API Builder & SetBindTransforms(const HdMatrixArrayDataSourceHandle &bindTransforms)
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(UsdSkelImagingSkeletonSchemaTokens, USDSKELIMAGING_API, USD_SKEL_IMAGING_SKELETON_SCHEMA_TOKENS)
static USDSKELIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdTokenArrayDataSourceHandle &joints, const HdTokenArrayDataSourceHandle &jointNames, const HdMatrixArrayDataSourceHandle &bindTransforms, const HdMatrixArrayDataSourceHandle &restTransforms)
USDSKELIMAGING_API Builder & SetRestTransforms(const HdMatrixArrayDataSourceHandle &restTransforms)
static USDSKELIMAGING_API UsdSkelImagingSkeletonSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDSKELIMAGING_API HdMatrixArrayDataSourceHandle GetBindTransforms() const
Determines topology of skeleton.
static USDSKELIMAGING_API const HdDataSourceLocator & GetRestTransformsLocator()
Prim-level relative data source locator to locate restTransforms.
#define USDSKELIMAGING_API
Definition: api.h:23
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static USDSKELIMAGING_API const TfToken & GetSchemaToken()
USDSKELIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static USDSKELIMAGING_API const HdDataSourceLocator & GetDefaultLocator()