8#ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_DATA_SOURCE_RESOLVED_POINTS_BASED_PRIM_H
9#define PXR_USD_IMAGING_USD_SKEL_IMAGING_DATA_SOURCE_RESOLVED_POINTS_BASED_PRIM_H
11#include "pxr/usdImaging/usdSkelImaging/api.h"
12#include "pxr/usdImaging/usdSkelImaging/dataSourceUtils.h"
14#include "pxr/usdImaging/usdSkelImaging/xformResolver.h"
18#include "pxr/imaging/hd/sceneIndexObserver.h"
22PXR_NAMESPACE_OPEN_SCOPE
41 ,
public std::enable_shared_from_this<
42 UsdSkelImagingDataSourceResolvedPointsBasedPrim>
58 HdSceneIndexBaseRefPtr
const &sceneIndex,
60 HdContainerDataSourceHandle primSource);
69 HdDataSourceBaseHandle
Get(
const TfToken &name)
override;
79 return _blendShapeTargetPaths;
92 const HdPrimvarsSchema &
GetPrimvars()
const {
return _primvars; }
96 return _resolvedSkeletonSchema;
100 HdMatrix4fArrayDataSourceHandle GetSkinningTransforms();
111 HdFloatArrayDataSourceHandle GetBlendShapeWeights();
120 HdSampledDataSourceHandle GetPoints();
123 HdDataSourceBaseHandle GetGeomBindTransform();
126 HdDataSourceBaseHandle GetHasConstantInfluences();
129 HdDataSourceBaseHandle GetNumInfluencesPerComponent();
132 HdDataSourceBaseHandle GetInfluences();
135 HdDataSourceBaseHandle GetBlendShapeOffsets();
138 HdDataSourceBaseHandle GetBlendShapeOffsetRanges();
141 HdDataSourceBaseHandle GetNumBlendShapeOffsetRanges();
144 HdSampledDataSourceHandle GetNormals()
const;
147 HdSampledDataSourceHandle GetFaceVertexIndices();
150 HdDataSourceBaseHandle GetHasFaceVaryingNormals();
162 return _skinningMethod;
194 const TfToken &dirtiedPrimType,
201 HdSceneIndexBaseRefPtr
const &sceneIndex,
203 HdContainerDataSourceHandle primSource,
207 HdContainerDataSourceHandle skeletonPrimSource,
211 _ProcessDirtyLocators(
218 _ProcessDirtySkeletonLocators(
225 _ProcessDirtySkelBlendShapeLocators(
232 _ProcessDirtyInstancerLocators(
238 HdSceneIndexBaseRefPtr
const _sceneIndex;
242 HdContainerDataSourceHandle
const _primSource;
243 const bool _hasSkelRoot;
245 HdPrimvarsSchema
const _primvars;
246 HdMeshSchema
const _mesh;
250 HdContainerDataSourceHandle
const _skeletonPrimSource;
253 class _BlendShapeDataCache
257 _BlendShapeDataCache(
258 HdSceneIndexBaseRefPtr
const &sceneIndex,
261 Handle _Compute()
override;
263 HdSceneIndexBaseRefPtr
const _sceneIndex;
266 _BlendShapeDataCache _blendShapeDataCache;
268 class _JointInfluencesDataCache
272 _JointInfluencesDataCache(
273 HdContainerDataSourceHandle
const &primSource,
274 HdContainerDataSourceHandle
const &skeletonPrimSource);
276 Handle _Compute()
override;
278 HdContainerDataSourceHandle
const _primSource;
279 HdContainerDataSourceHandle
const _skeletonPrimSource;
281 _JointInfluencesDataCache _jointInfluencesDataCache;
289PXR_NAMESPACE_CLOSE_SCOPE
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Represents a set of data source locators closed under descendancy.
Abstract interface to scene data.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
A prim data source providing resolved data for a points based prim (mesh, basisCurves,...
USDSKELIMAGING_API std::shared_ptr< UsdSkelImagingBlendShapeData > GetBlendShapeData()
Blend shape data computed from primvars, skel bindings and skeleton.
USDSKELIMAGING_API HdMatrix3fArrayDataSourceHandle GetSkinningScaleTransforms()
Only valid if GetSkinningMethod() == UsdSkelTokens->dualQuaternion.
bool HasExtComputations() const
Should the points for this primvar be given by an ext computation or from the primvars schema.
USDSKELIMAGING_API std::shared_ptr< UsdSkelImagingJointInfluencesData > GetJointInfluencesData()
Joint influences data computed from primvars.
const UsdSkelImagingResolvedSkeletonSchema & GetResolvedSkeletonSchema()
Resolved skeleton of prim in the input scene.
static USDSKELIMAGING_API Handle New(HdSceneIndexBaseRefPtr const &sceneIndex, SdfPath primPath, HdContainerDataSourceHandle primSource)
C'tor.
USDSKELIMAGING_API HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
const HdPrimvarsSchema & GetPrimvars() const
Primvars of prim in the input scene.
static USDSKELIMAGING_API const HdDataSourceLocatorSet & GetDependendendOnDataSourceLocators()
Data source locators (on this prim) that this prim depends on.
USDSKELIMAGING_API HdMatrixDataSourceHandle GetCommonSpaceToPrimLocal() const
Transfrom to go from common space (as defined by UsdSkelImagingDataSourceXformResolver) to the local ...
bool HasNormalsExtComputations() const
Should the normals for this primvar be given by an ext computation.
USDSKELIMAGING_API bool ProcessDirtyLocators(const TfToken &dirtiedPrimType, const HdDataSourceLocatorSet &dirtyLocators, HdSceneIndexObserver::DirtiedPrimEntries *entries)
Dirty internal structures in response to dirty locators for the target (resolved) skeleton prim (dirt...
const VtArray< SdfPath > & GetBlendShapeTargetPaths() const
Paths to BlendShape prims.
const SdfPath & GetPrimPath() const
Path of prim in input scene (and for prim this data source is for).
USDSKELIMAGING_API TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
const SdfPath & GetSkeletonPath() const
Path of bound skeleton.
const VtArray< SdfPath > & GetInstancerPaths() const
Paths to instancers instancing this prim - not including ones outside the skel root.
const TfToken & GetSkinningMethod() const
Skinning method computed from corresponding primvar.
USDSKELIMAGING_API HdVec4fArrayDataSourceHandle GetSkinningDualQuats()
Only valid if GetSkinningMethod() == UsdSkelTokens->dualQuaternion.
Resolved data for a skeleton and the targeted skelAnim.
A thunk for shared pointers computing the result only once and using atomic operations to store the c...
Represents an arbitrary dimensional rectangular container class.
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Data for skinned prim to compute the skel ext computation inputs related to blend shapes.
Some of the data feeding into the ext computations to skin a prim.
std::vector< TfToken > TfTokenVector
Convenience types.