Any project using WITH_RUNTIME_PHYSICS_COOKING and creating collision for a component will cause physics log spam in packaged builds when creating the collision due to the following section in BodySetup.cpp:
(This also applies to the built in procedural mesh component and its Blueprint library)
#if WITH_PHYSX
if (!bContainedData)
{
if (FPlatformProperties::RequiresCookedData())
{
UE_LOG(LogPhysics, Error, TEXT("Attempt to build physics data for %s when we are unable to. This platform requires cooked packages."), *GetPathName());
}
if (AggGeom.ConvexElems.Num() == 0 && (CDP == NULL || CDP->ContainsPhysicsTriMeshData(bMeshCollideAll) == false))
{
return NULL;
}
#if WITH_RUNTIME_PHYSICS_COOKING || WITH_EDITOR
This shouldn’t be the correct behavior, FPlatformProperties::RequiresCookedData() returns True for ALL platforms when its not an editor build, even ones that support WITH_RUNTIME_PHYSICS_COOKING. So platforms that allow runtime cooking will throw the error into the log and then go forward and still cook the collision anyway. For every procedural mesh update the log will show another entry with this error message but will do what the error is saying can’t be done anyway without issue.
Note This doesn’t show up in WITH_EDITOR builds as for windows it declares:
static FORCEINLINE bool RequiresCookedData()
{
return !HAS_EDITOR_DATA;
}
I was unsure about the reasoning here for the message and why it is coupled to FPlatformProperties so I did not make this a pull request.
Either the error shouldn’t be shown when WITH_RUNTIME_PHYSICS_COOKING is declared, the error message should be removed entirely, or RequiresCookedData() is being declared/used incorrectly.