I have a Procedural Mesh Component that gets generated everytime the level is loaded. But unfortunately, it seems to be making my .umap file unnecessarily big. Is there a way to flag the component so it doesn’t save the generated mesh data in the .umap file?
I figured out a way to shrink my .umap from 30megs to 91kb (!!!). My Git LFS will be much happier now.
Basically I subclassed the PMC class and inside the Serialize I remove all the mesh data, and then flag the owning actor to rebuild after the save is done.
void UMyProceduralMeshComponent::Serialize( FArchive & a ) {
dlogf( "UMyProceduralMeshComponent::Serialize save=%d load=%d", a.IsSaving(), a.IsLoading() );
dprintfScope();
if ( a.IsSaving() && GetNumSections() > 0 ) {
dlogf( "erase mesh data before serializing, save .umap file size" );
// weird hack, remove all mesh data if saving
ClearAllMeshSections();
ClearCollisionConvexMeshes();
if ( stadium ) {
stadium->Dirty = true;
//stadium->Build();
}
}
Super::Serialize( a );
}