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

This commit is contained in:
Mamadou Babaei
2024-11-27 10:11:49 +01:00
parent 1b7203ce13
commit 9d98a6cd0a
@@ -319,12 +319,12 @@ FTransform FSGAssetUtils::FImpl::GetHandBoneRefTransform(
}
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!"),
*BoneName.ToString()));
return FTransform::Identity;
}
const TArray<FTransform> Transforms{ReferenceSkeleton.GetRefBonePose()};