HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xformResolver.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 #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_XFORM_RESOLVER_H
8 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_XFORM_RESOLVER_H
9 
11 
14 
16 
18 
19 /// \class UsdSkelImagingDataSourceXformResolver
20 ///
21 /// Given a prim, computes transform from prim local space to a space common to
22 /// all descendants of a skel root.
23 ///
24 /// Without instancing, the common space is simply world. But if the
25 /// skel root is inside a ni or pi prototype, the common space is that
26 /// of the prototype.
27 ///
28 /// A particular difficulty is presented by the following situation:
29 /// Consider a prim inside a reference which is inside a skel root.
30 /// Now author instancable on the reference. This change the topology
31 /// after the ni prototype propagating scene index and the prim now
32 /// has an instancer and the xform authored on the reference is now
33 /// in the instancer's instanceTransforms primvar.
34 ///
35 /// This class takes these instanceTransforms into account.
36 ///
37 /// Note that it does not consider instancers instancing the skel root.
38 ///
39 /// Also note that it assumes that an instancer has only instance.
40 ///
42 {
43 public:
44  /// Construct from data source of relevant prim.
46  HdSceneIndexBaseRefPtr const &sceneIndex,
47  HdContainerDataSourceHandle const &primSource);
48 
49  /// Data source for the transform.
51 
52  /// Get skel:animationSource instance primvar value from the immediate
53  /// instancer.
55 
56  /// Paths of instancer contributing to the transform. They
57  /// need to be observed for invalidation.
59  return _instancerPaths;
60  }
61 
62  /// If a dirty message for this prim or any instancer includes
63  /// this locator, we need to reconstruct
64  /// UsdSkelImagingDataSourceXformResolver.
66  /// If a dirty message for this prim or any instancer includes
67  /// this locator, we need to refetch the transform data source.
68  static const HdDataSourceLocator &GetXformLocator();
69  /// If a dirty message for any instancer includes this locator,
70  /// we need to refetch the transform data source.
72  /// If a dirty message for any instancer includes this locator,
73  /// we need to refresh XXXXX
75 
76 private:
77  HdSceneIndexBaseRefPtr const _sceneIndex;
78  HdContainerDataSourceHandle const _primSource;
79  const VtArray<SdfPath> _instancerPaths;
80 };
81 
83 
84 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
VtArray< SdfPath > GetInstanceAnimationSource() const
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(HdSceneIndexBase)
HdMatrixDataSourceHandle GetPrimLocalToCommonSpace() const
Data source for the transform.
const VtArray< SdfPath > & GetInstancerPaths() const
Definition: xformResolver.h:58
static const HdDataSourceLocator & GetXformLocator()
static const HdDataSourceLocator & GetInstanceXformLocator()
HdMatrixDataSource::Handle HdMatrixDataSourceHandle
UsdSkelImagingDataSourceXformResolver(HdSceneIndexBaseRefPtr const &sceneIndex, HdContainerDataSourceHandle const &primSource)
Construct from data source of relevant prim.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static const HdDataSourceLocator & GetInstanceAnimationSourceLocator()
static const HdDataSourceLocator & GetInstancedByLocator()