I need to use loaded staticmesh in apawn::serialize

I need to extract some info from the mesh (sockets, …) before serializing. It kind of work, but in some conditions, like after loading the level and trying to save it, it lead to a crash (if an instance of the pawn is in the level). In the output it is said that using loadsynchronous in serialize is not a good idea.

The question is: where can i load the mesh to prevent this ? Be able to add ref to a mesh in the editor and process it before serialization.

Ok, solved it.
When saving the level, i bypass the custom processing (not needed in this case).

if (!GIsSavingPackage)
{
  ... custom mesh processing
}

Super::Serialize();

Therefore it is executed when i compile the BP, but not when saving level.

Dirty, but it work (until …)