do an ensure check instead of silently ignoring the non-existent joint
This commit is contained in:
@@ -319,12 +319,12 @@ FTransform FSGAssetUtils::FImpl::GetHandBoneRefTransform(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const FReferenceSkeleton& ReferenceSkeleton{SkeletalMesh->GetRefSkeleton()};
|
const FReferenceSkeleton& ReferenceSkeleton{SkeletalMesh->GetRefSkeleton()};
|
||||||
const int32 BoneIndex = ReferenceSkeleton.FindBoneIndex(BoneName);
|
|
||||||
|
|
||||||
if (BoneIndex == INDEX_NONE)
|
const int32 BoneIndex = ReferenceSkeleton.FindBoneIndex(BoneName);
|
||||||
|
if (!ensureAlwaysMsgf(BoneIndex != INDEX_NONE,
|
||||||
|
TEXT("Could not find a bone index for the '%s' joint!"), *BoneName.ToString()))
|
||||||
{
|
{
|
||||||
SGLOG_WARNING(FString::Printf(TEXT("Could not find a bone index for the '%s' joint!"),
|
return FTransform::Identity;
|
||||||
*BoneName.ToString()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TArray<FTransform> Transforms{ReferenceSkeleton.GetRefBonePose()};
|
const TArray<FTransform> Transforms{ReferenceSkeleton.GetRefBonePose()};
|
||||||
|
|||||||
Reference in New Issue
Block a user