fix the non-existent default hand-mesh warnings polluting the logs when packaging the game

This commit is contained in:
Mamadou Babaei
2024-09-02 18:53:21 +02:00
parent 7c3b0f4a3c
commit c1a3f7fedf
2 changed files with 23 additions and 10 deletions
@@ -651,17 +651,26 @@ bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
{
const FString DefaultMeshPath{GetDefaultMeshPath()};
USkeletalMesh* DefaultMesh{
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
};
// FIXME
// Disable this warning altogether as it results in polluting the packaging logs, at least until we ship a set of
// virtual hand meshes again.
// const FString DefaultMeshPath{GetDefaultMeshPath()};
// USkeletalMesh* DefaultMesh{
// Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
// };
if (!IsValid(DefaultMesh))
{
SGLOG_WARNING(FString::Printf(TEXT("Failed to load the default skeletal mesh: '%s'"), *DefaultMeshPath));
}
// FIXME
// Disable this warning altogether as it results in polluting the packaging logs, at least until we ship a set of
// virtual hand meshes again.
// if (!IsValid(DefaultMesh))
// {
// SGLOG_WARNING(FString::Printf(TEXT("Failed to load the default skeletal mesh: '%s'"), *DefaultMeshPath));
// }
return DefaultMesh;
// FIXME
//return DefaultMesh;
return nullptr;
}
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
@@ -677,7 +686,10 @@ void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
// Temporary hack to make it work inside the Blueprint Editor.
#if WITH_EDITOR
Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
// FIXME
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
// Instead
Owner->SetSkeletalMesh(nullptr, true);
#endif /* WITH_EDITOR */
}