do an ensure check instead of silently ignoring the non-existent joint

This commit is contained in:
Mamadou Babaei
2024-11-27 10:11:50 +01:00
parent 9687d8c52b
commit 222cefaedc
@@ -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()};