Making ProceduralMesh Async causes crashes

Hi,

I’m trying to execute CreateMeshSection() asynchronously. However, it crashes with the following error:

Assertion failed: !bPostTickComponentUpdate [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/LevelTick.cpp] [Line: 894]

If I get lucky and this check passes, then it fails at the following check:

Assertion failed: Bodies.Num() == 0 [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp] [Line: 1508]

Now, by searching around some more I found out that calculating the tangents and collision takes up almost all of this function’s time. Luckily tangents can be calculated before creating the mesh section. However, I can’t find out how to calculate the collisions after the mesh section is created without collisions initially.

So, does anyone know how you could make the CreateMeshSection() function fully async or how to calculate the collisions async after creating the mesh section in the gamethread?

Thanks!

did you find anything out about this. I have a similar sort of problem ( the same error when generating meshes).

I can’t quite remember but I think I did fix/circumvent it.

I still calculate the the tangents in a background thread:

UKismetProceduralMeshLibrary::CalculateTangentsForMesh(...);

Then, switch over to the game thread and enable async cooking:

AsyncTask(ENamedThreads::GameThread,[this]()
{
		ProceduralMesh->bUseAsyncCooking = true;
		ProceduralMesh->CreateMeshSection(...);
}

This seemed to do the collision cooking asynchronously and made creating mesh sections lag free from what I remember.