24 #ifndef PXR_USD_IMAGING_USD_SKEL_IMAGING_SKELETON_ADAPTER_H
25 #define PXR_USD_IMAGING_USD_SKEL_IMAGING_SKELETON_ADAPTER_H
39 #include <hboost/unordered_map.hpp>
40 #include <unordered_map>
67 instancerContext=
nullptr)
override;
82 instancerContext =
nullptr)
const override;
91 instancerContext=
nullptr)
const override;
100 const TfToken& propertyName)
override;
187 TfToken const& instanceInheritablePurpose)
204 SdfPath const& cachePath)
const override;
243 size_t maxSampleCount,
245 VtValue *sampleValues)
override;
260 VtIntArray *outIndices)
const override;
273 bool _IsCallbackForSkeleton(
const UsdPrim& prim)
const;
282 float _GetSkeletonDisplayOpacity(
const UsdPrim& prim,
285 void _TrackBoneMeshVariability(
290 instancerContext =
nullptr)
const;
292 void _UpdateBoneMeshForTime(
302 bool _IsAffectedByTimeVaryingSkelAnim(
const SdfPath& skinnedPrimPath)
305 void _RemoveSkinnedPrimAndComputations(
const SdfPath& cachePath,
311 bool _IsSkinningComputationPath(
const SdfPath& cachePath)
const;
314 _IsSkinningInputAggregatorComputationPath(
const SdfPath& cachePath)
const;
316 void _TrackSkinningComputationVariability(
318 const SdfPath& computationPath,
321 instancerContext =
nullptr)
const;
323 VtVec3fArray _GetSkinnedPrimPoints(
const UsdPrim& skinnedPrim,
324 const SdfPath& skinnedPrimCachePath,
327 SdfPath _GetSkinningComputationPath(
const SdfPath& skinnedPrimPath)
const;
329 SdfPath _GetSkinningInputAggregatorComputationPath(
330 const SdfPath& skinnedPrimPath)
const;
345 bool _IsSkinnedPrimPath(
const SdfPath& cachePath)
const;
347 void _TrackSkinnedPrimVariability(
352 instancerContext =
nullptr)
const;
354 void _UpdateSkinnedPrimForTime(
366 _GetExtComputationInputForSkinningComputation(
374 _GetExtComputationInputForInputAggregator(
382 _SampleExtComputationInputForSkinningComputation(
388 size_t maxSampleCount,
393 _SampleExtComputationInputForInputAggregator(
399 size_t maxSampleCount,
424 TfToken ComputePurpose()
const;
429 VtVec3fArray _boneMeshPoints;
430 VtIntArray _boneMeshJointIndices;
434 _SkelData* _GetSkelData(
const SdfPath& cachePath)
const;
438 std::unordered_map<SdfPath, std::shared_ptr<_SkelData>,
SdfPath::Hash>;
439 _SkelDataMap _skelDataCache;
442 struct _SkinnedPrimData {
443 _SkinnedPrimData() =
default;
448 _SkinnedPrimData(
const SdfPath& skelPath,
453 std::shared_ptr<UsdSkelBlendShapeQuery> blendShapeQuery;
456 SdfPath skelPath, skelRootPath;
457 bool hasJointInfluences =
false;
460 const _SkinnedPrimData* _GetSkinnedPrimData(
const SdfPath& cachePath)
const;
462 using _SkinnedPrimDataMap =
463 std::unordered_map<SdfPath, _SkinnedPrimData, SdfPath::Hash>;
464 _SkinnedPrimDataMap _skinnedPrimDataCache;
471 using _SkelBindingMap =
472 std::unordered_map<SdfPath, UsdSkelBinding, SdfPath::Hash>;
473 _SkelBindingMap _skelBindingMap;
479 #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