Fix assert about CachedDensityFromPhysicsMaterialInGCm3 when saving an empty geometry collection

- make sure the cache data is computed before saving of the asset happens

#rb Jimmy.Andrews
#jira UE-194284

[CL 35718317 by cedric caillaud in ue5-main branch]
This commit is contained in:
cedric caillaud
2024-08-21 16:22:11 -04:00
parent 93f0fade9c
commit e03dad4378
@@ -1927,7 +1927,10 @@ void UGeometryCollection::PreSave(FObjectPreSaveContext SaveContext)
{
#if WITH_EDITOR
constexpr bool bInitResources = false;
EnsureRenderDataIsCooked(bInitResources);
constexpr bool bIsTransacting = false;
constexpr bool bIsPersistant = false; // note that this has no effect on the call below
constexpr bool bAllowCopyFromDDC = false;
EnsureDataIsCooked(bInitResources, bIsTransacting, bIsPersistant, bAllowCopyFromDDC);
#endif
Super::PreSave(SaveContext);