24 #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_SKELETON_ADAPTER_H
25 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_SKELETON_ADAPTER_H
39 #include <unordered_map>
66 instancerContext=
nullptr)
override;
81 instancerContext =
nullptr)
const override;
90 instancerContext=
nullptr)
const override;
99 const TfToken& propertyName)
override;
186 TfToken const& instanceInheritablePurpose)
203 SdfPath const& cachePath)
const override;
242 size_t maxSampleCount,
244 VtValue *sampleValues)
override;
259 VtIntArray *outIndices)
const override;
272 bool _IsCallbackForSkeleton(
const UsdPrim& prim)
const;
281 float _GetSkeletonDisplayOpacity(
const UsdPrim& prim,
284 void _TrackBoneMeshVariability(
289 instancerContext =
nullptr)
const;
291 void _UpdateBoneMeshForTime(
301 bool _IsAffectedByTimeVaryingSkelAnim(
const SdfPath& skinnedPrimPath)
304 void _RemoveSkinnedPrimAndComputations(
const SdfPath& cachePath,
310 bool _IsSkinningComputationPath(
const SdfPath& cachePath)
const;
313 _IsSkinningInputAggregatorComputationPath(
const SdfPath& cachePath)
const;
315 void _TrackSkinningComputationVariability(
317 const SdfPath& computationPath,
320 instancerContext =
nullptr)
const;
322 VtVec3fArray _GetSkinnedPrimPoints(
const UsdPrim& skinnedPrim,
323 const SdfPath& skinnedPrimCachePath,
326 SdfPath _GetSkinningComputationPath(
const SdfPath& skinnedPrimPath)
const;
328 SdfPath _GetSkinningInputAggregatorComputationPath(
329 const SdfPath& skinnedPrimPath)
const;
344 bool _IsSkinnedPrimPath(
const SdfPath& cachePath)
const;
346 void _TrackSkinnedPrimVariability(
351 instancerContext =
nullptr)
const;
353 void _UpdateSkinnedPrimForTime(
365 _GetExtComputationInputForSkinningComputation(
373 _GetExtComputationInputForInputAggregator(
381 _SampleExtComputationInputForSkinningComputation(
387 size_t maxSampleCount,
392 _SampleExtComputationInputForInputAggregator(
398 size_t maxSampleCount,
425 TfToken ComputePurpose()
const;
430 VtVec3fArray _boneMeshPoints;
431 VtIntArray _boneMeshJointIndices;
435 _SkelData* _GetSkelData(
const SdfPath& cachePath)
const;
439 std::unordered_map<SdfPath, std::shared_ptr<_SkelData>,
SdfPath::Hash>;
440 _SkelDataMap _skelDataCache;
443 struct _SkinnedPrimData {
444 _SkinnedPrimData() =
default;
449 _SkinnedPrimData(
const SdfPath& skelPath,
454 std::shared_ptr<UsdSkelBlendShapeQuery> blendShapeQuery;
457 SdfPath skelPath, skelRootPath;
458 bool hasJointInfluences =
false;
461 const _SkinnedPrimData* _GetSkinnedPrimData(
const SdfPath& cachePath)
const;
463 using _SkinnedPrimDataMap =
464 std::unordered_map<SdfPath, _SkinnedPrimData, SdfPath::Hash>;
465 _SkinnedPrimDataMap _skinnedPrimDataCache;
472 using _SkelBindingMap =
473 std::unordered_map<SdfPath, UsdSkelBinding, SdfPath::Hash>;
474 _SkelBindingMap _skelBindingMap;
480 #endif // USDSKELIMAGING_SKELETONADAPTER
USDIMAGING_API std::string GetExtComputationKernel(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
GT_API const UT_StringHolder time
USDSKELIMAGING_API void MarkDirty(const UsdPrim &prim, const SdfPath &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
GLsizei const GLchar *const * string
USDSKELIMAGING_API void TrackVariability(const UsdPrim &prim, const SdfPath &cachePath, HdDirtyBits *timeVaryingBits, const UsdImagingInstancerContext *instancerContext=nullptr) const override
Thread Safe.
HdExtComputationOutputDescriptorVector GetExtComputationOutputs(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
USDIMAGING_API size_t SampleExtComputationInput(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &name, UsdTimeCode time, const UsdImagingInstancerContext *instancerContext, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override
USDSKELIMAGING_API bool IsSupported(const UsdImagingIndexProxy *index) const override
Returns true if the adapter can be populated into the target index.
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvars(UsdPrim const &prim, SdfPath const &cachePath, HdInterpolation interpolation, const UsdImagingInstancerContext *instancerContext) const override
virtual USDSKELIMAGING_API ~UsdSkelImagingSkeletonAdapter()
std::vector< HdExtComputationOutputDescriptor > HdExtComputationOutputDescriptorVector
USDSKELIMAGING_API void ProcessPrimRemoval(SdfPath const &primPath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API void MarkMaterialDirty(const UsdPrim &prim, const SdfPath &cachePath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API SdfPath Populate(const UsdPrim &prim, UsdImagingIndexProxy *index, const UsdImagingInstancerContext *instancerContext=nullptr) override
USDSKELIMAGING_API void MarkRefineLevelDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API VtValue GetTopology(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
USDSKELIMAGING_API GfRange3d GetExtent(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
USDSKELIMAGING_API void InvokeComputation(SdfPath const &cachePath, HdExtComputationContext *context) override
void _RemovePrim(const SdfPath &cachePath, UsdImagingIndexProxy *index) override
std::vector< TfToken > TfTokenVector
Convenience types.
USDIMAGING_API VtValue GetExtComputationInput(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &name, UsdTimeCode time, const UsdImagingInstancerContext *instancerContext) const override
GLuint const GLchar * name
USDSKELIMAGING_API void MarkRenderTagDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API SdfPath GetMaterialId(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
The root transform provided by the delegate.
std::set< class SdfPath > SdfPathSet
A set of SdfPaths.
USDSKELIMAGING_API void MarkVisibilityDirty(const UsdPrim &prim, const SdfPath &cachePath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API HdDirtyBits ProcessPropertyChange(const UsdPrim &prim, const SdfPath &cachePath, const TfToken &propertyName) override
USDSKELIMAGING_API void MarkTransformDirty(const UsdPrim &prim, const SdfPath &cachePath, UsdImagingIndexProxy *index) override
#define USDSKELIMAGING_API
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
USDSKELIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const override
USDSKELIMAGING_API void ProcessPrimResync(SdfPath const &primPath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API HdExtComputationInputDescriptorVector GetExtComputationInputs(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
#define PXR_NAMESPACE_CLOSE_SCOPE
USDSKELIMAGING_API PxOsdSubdivTags GetSubdivTags(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Get the subdiv tags for this prim.
UsdSkelImagingSkeletonAdapter()
USDSKELIMAGING_API void MarkReprDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
USDSKELIMAGING_API bool GetDoubleSided(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Reads double-sided from the given prim. If not authored, returns false.
USDSKELIMAGING_API void RegisterSkelBinding(UsdSkelBinding const &binding)
USDSKELIMAGING_API void UpdateForTime(const UsdPrim &prim, const SdfPath &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, const UsdImagingInstancerContext *instancerContext=nullptr) const override
Thread Safe.
USDSKELIMAGING_API TfToken GetPurpose(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &instanceInheritablePurpose) const override
USDSKELIMAGING_API const TfTokenVector & GetExtComputationSceneInputNames(SdfPath const &cachePath) const override
USDSKELIMAGING_API void MarkCullStyleDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector