- Preserve guid during save if static mesh bulkdata content hasn't changed to avoid triggering unnecessary rebuilds
- Make sure the next HLOD generation is going to use the HashAsGuid feature to avoid recompiling staticmesh that are generated if they are exactly the same as before
- 31m10s to 14m15s to cook P_Construct_WP with a warmed-up DDC
#fyi Richard.TalbotWatkin
#rb Matt.Peters, Sebastien.Lussier, Yuriy.ODonnell
[CL 15755322 by danny couture in ue5-main branch]
Always construct a UMeshDescriptionBase as a default subobject of the MeshDescriptionBulkData object, which can be recycled each time a UMeshDescriptionBase is required for that LOD.
Put GC scope guards around NewObject<> allocations to avoid clashes with GC when allocated on a thread.
Also identified other static mesh subobjects which can be potentially created in cooking commandlets when GC is taking place.
#jira UE-109204
#jira UE-109439
[FYI] Danny.Couture
#ROBOMERGE-SOURCE: CL 15534994 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15535009 by richard talbotwatkin in ue5-main branch]
* Added missing write lock in FMeshDescriptionBulkData::SaveMeshDescription( FMeshDescription& MeshDescription )
* Skip serialization of bulk data when archive is a ref collector
#rb danny.couture, richard.talbotwatkin
#ROBOMERGE-SOURCE: CL 15502374 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15503758 by sebastien lussier in ue5-main branch]
StaticMesh hi res source model bulk data is no longer a default subobject; instead it is instanced if it was not present in PostLoad, thus fixing issues with object name differences.
MeshDescriptionBaseBulkData is marked as NeedsLoadForEditorGame, as well as not needing load for client or server, so that it can be loaded correctly.
#jira UE-108938
#ROBOMERGE-SOURCE: CL 15481115 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15481116 by richard talbotwatkin in ue5-main branch]
Made the HiResSourceModel MeshDescriptionBulkData a regular default subobject, so that it is still valid in Editor -game builds.
#jira UE-108938
#rb Robert.Manuszewski
#ROBOMERGE-SOURCE: CL 15471361 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15471367 by richard talbotwatkin in ue5-main branch]
- Moved source models related classes and implementation into separate files.
- Created a new UObject wrapper for holding mesh description bulk data; this is created as a transactable object inside a UStaticMesh.
- The cached mesh description is now an inner object of the bulk data wrapper; this allows transactions on the bulk data to affect the cached mesh.
- The static mesh SourceModels array can no longer be accessed directly: FStaticMeshSourceModel requires extra initialization before it should be used, so new LODs should be added through the static mesh API.
- Undo/redo is now fixed within the geometry tools
- Fixed regression where mesh description was being unpacked unnecessarily during transactions
- MeshDescription bulk data and its cached MeshDescriptions are now emptied prior to removing the UObject reference, in order to immediately free memory instead of needing to wait for garbage collection
- No more deadlocks when clearing or committing mesh descriptions during garbage collection
- Bulk data UObjects are constructed, where possible, at startup, in order to prevent it from happening during critical moments, e.g. during garbage collection or package saving.
#rb Danny.Couture, Alexis.Matte, Ryan.Schmidt
[CL 15420827 by Richard TalbotWatkin in ue5-main branch]
- The MeshDescription for each source model LOD is now wrapped in a UStaticMeshDescription, meaning that it can be transacted separately to the parent static mesh. This improves memory and time performance in static mesh transactions, e.g. when assigning materials.
- FStaticMeshSourceModel now has its own API for managing the mesh description and its bulk data.
- A new optional Hi-res SourceModel member has been added to StaticMesh; this allows the original source data to be stored here, while a reduced LOD0 can be stored as SourceModel LOD0, to allow geometry modelling tools to work efficiently.
- MeshDescription is now serialized using a proxy archive object which ensures that FNames can always be archived as strings.
- UStaticMeshDescription is now serialized.
- UStaticMeshDescription has been reverted to only holding its own mesh description, instead of being able to reference any external mesh description. This previous change was never released.
- RawMesh is now immediately converted to MeshDescription in PostLoad, so that the MeshDescription[BulkData] pointers are always valid, and can be tag serialised automatically during transactions. RawMesh should now not be used in the editor at all, and will soon be deprecated.
This change results in far quicker and memory-efficient transactions in StaticMeshes. e.g. assign material to a static mesh section for a 20000 vertex mesh now takes less than a second (discounting time to rebuild the render proxy) instead of 7+ seconds.
#rb Alexis.Matte, Danny.Couture
[CL 15248935 by Richard TalbotWatkin in ue5-main branch]
- allowed TMeshAttributeRef<TArrayView<T>> to be initialized from *any* attribute type, thus providing a generic way of accessing any type of attribute, be it simple, compound or unbounded array.
ArrayAttribute improvements:
- sped up inserting by not requiring every element of a chunk to be valid if it has not yet been used
- added new API to provide Reserve / Add / AddUnique etc
Indexer improvements:
- fixed issue allowing an attribute with a compound index attribute (e.g. int[3]) to be indexed multiple times
#rb Halfdan.Ingvarsson
[CL 14814025 by Richard TalbotWatkin in ue5-main branch]
Removed attribute views.
Refactored MeshAttributeArray implementation.
Added a new GetArrayView() method for all types of TMeshAttributeRefs which can be used generically.
#rb Alexis.Matte
[CL 14651594 by Richard TalbotWatkin in ue5-main branch]
Also add protection so meshdescription can be read from multiple threads in editor
- Loading Reverb's P_World with empty DDC
- 319GB to 242GB peak private byte
- 166GB to 80GB permanent memory usage after map load
#rb Richard.Talbot-Watkins, Matt.Peters, Paul.Chipchase
[CL 14544739 by danny couture in ue5-main branch]