Skip to content

Commit

Permalink
Fix an issue where UsdSkelImagingSkeletonAdapter::_RemovePrim() failed
Browse files Browse the repository at this point in the history
to remove skeletons that did not have any bindings to skinned prims.

This could lead to crashes later on from accessing expired prims.

UsdSkelImagingSkeletonAdapter::_RemovePrim() checks _skelBindingMap to
determine whether the provided path is the skeleton prim. This was
inconsistent with UsdSkelImagingSkeletonAdapter::ProcessPrimResync(),
which checks _skelDataCache via _GetSkelData(). If there aren't any
bindings, the skeleton is in _skelDataCache but not _skelBindingMap.

Fixes: PixarAnimationStudios#1228, PixarAnimationStudios#1248
  • Loading branch information
cameronwhite committed Nov 19, 2020
1 parent 58b40b1 commit 33c5093
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pxr/usdImaging/usdSkelImaging/skeletonAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,7 @@ UsdSkelImagingSkeletonAdapter::_RemovePrim(const SdfPath& cachePath,

// Alternative way of finding whether this is a callback for the skeleton/
// bone mesh.
bool isSkelPath = _skelBindingMap.find(cachePath) != _skelBindingMap.end();
if (isSkelPath) {
if (_GetSkelData(cachePath)) {

TF_DEBUG(USDIMAGING_CHANGES).Msg(
"[SkeletonAdapter::_RemovePrim] Remove skeleton"
Expand Down

0 comments on commit 33c5093

Please sign in to comment.