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 // Corresponds to UsdSkelSkeleton.
48 //
49 
51 {
52 public:
53  /// \name Schema retrieval
54  /// @{
55 
56  UsdSkelImagingSkeletonSchema(HdContainerDataSourceHandle container)
57  : HdSchema(container) {}
58 
59  /// Retrieves a container data source with the schema's default name token
60  /// "skeleton" from the parent container and constructs a
61  /// UsdSkelImagingSkeletonSchema instance.
62  /// Because the requested container data source may not exist, the result
63  /// should be checked with IsDefined() or a bool comparison before use.
66  const HdContainerDataSourceHandle &fromParentContainer);
67 
68  /// @}
69 
70 // --(BEGIN CUSTOM CODE: Schema Methods)--
71 // --(END CUSTOM CODE: Schema Methods)--
72 
73  /// \name Member accessor
74  /// @{
75 
76  /// Determines topology of skeleton.
79 
80  /// Here for completeness but ignored for posing the geometry. See
81  /// Skeleton.jointNames in usdSkel/schema for uses.
84 
87 
88  /// These are local rest transforms.
91 
92  /// @}
93 
94  /// \name Schema location
95  /// @{
96 
97  /// Returns a token where the container representing this schema is found in
98  /// a container by default.
100  static const TfToken &GetSchemaToken();
101 
102  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
103  /// where the container representing this schema is found by default.
105  static const HdDataSourceLocator &GetDefaultLocator();
106 
107  /// @}
108 
109  /// \name Data source locators for members
110  ///
111  /// The following methods return an HdDataSourceLocator (relative to the
112  /// prim-level data source) where the data source for a member can be found.
113  ///
114  /// This is often useful for checking intersection against the
115  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
116  /// @{
117 
118  /// Prim-level relative data source locator to locate joints.
120  static const HdDataSourceLocator &GetJointsLocator();
121 
122  /// Prim-level relative data source locator to locate jointNames.
125 
126  /// Prim-level relative data source locator to locate bindTransforms.
129 
130  /// Prim-level relative data source locator to locate restTransforms.
133  /// @}
134 
135  /// \name Schema construction
136  /// @{
137 
138  /// \deprecated Use Builder instead.
139  ///
140  /// Builds a container data source which includes the provided child data
141  /// sources. Parameters with nullptr values are excluded. This is a
142  /// low-level interface. For cases in which it's desired to define
143  /// the container with a sparse set of child fields, the Builder class
144  /// is often more convenient and readable.
146  static HdContainerDataSourceHandle
148  const HdTokenArrayDataSourceHandle &joints,
149  const HdTokenArrayDataSourceHandle &jointNames,
150  const HdMatrixArrayDataSourceHandle &bindTransforms,
151  const HdMatrixArrayDataSourceHandle &restTransforms
152  );
153 
154  /// \class UsdSkelImagingSkeletonSchema::Builder
155  ///
156  /// Utility class for setting sparse sets of child data source fields to be
157  /// filled as arguments into BuildRetained. Because all setter methods
158  /// return a reference to the instance, this can be used in the "builder
159  /// pattern" form.
160  class Builder
161  {
162  public:
165  const HdTokenArrayDataSourceHandle &joints);
168  const HdTokenArrayDataSourceHandle &jointNames);
171  const HdMatrixArrayDataSourceHandle &bindTransforms);
174  const HdMatrixArrayDataSourceHandle &restTransforms);
175 
176  /// Returns a container data source containing the members set thus far.
178  HdContainerDataSourceHandle Build();
179 
180  private:
182  HdTokenArrayDataSourceHandle _jointNames;
183  HdMatrixArrayDataSourceHandle _bindTransforms;
184  HdMatrixArrayDataSourceHandle _restTransforms;
185 
186  };
187 
188  /// @}
189 };
190 
192 
193 #endif
UsdSkelImagingSkeletonSchema(HdContainerDataSourceHandle container)
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
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#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()