Commit Graph

53 Commits

Author SHA1 Message Date
Richard TalbotWatkin
e74f50df46 Reduce memory usage for importing lots of meshes (56.17GB to 45.75GB -> ~18% for DATASET-0010a)
- Clear MeshDescription once serialized in BulkData after UStaticMesh Build (56.17GB peak to 51.28GB)
  - Clear SourceModels from DatasmithMesh as soon as possible (51.28GB peak to 48.8GB)
  - Remove CommitMeshDescription from FillUStaticMesh since already in PreBuildStaticMesh phase (48.8GB peak to 45.75GB)

From dev-enterprise[at]6953449

#rb jeanmichel.dignard, johan.duparc
#jira UE-63369

[CL 7318511 by Richard TalbotWatkin in Dev-Editor branch]
2019-07-16 04:54:08 -04:00
Max Chen
4561801a81 Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor) @7119039
#rb none

[CL 7120528 by Max Chen in Dev-Editor branch]
2019-06-21 01:21:43 -04:00
Richard TalbotWatkin
1ca56fc5b2 MeshDescription now uses triangles as its primary face representation. They can and should be used in preference to polygons when a mesh is known to be entirely triangulated, as they are quicker, and can be used in exactly the same way.
Creating a triangle will also create a 'shadow' polygon for backward compatibility, although this is omitted when serializing.
As with polygons, any missing edges are created when creating a new triangle, and operations such as adjacency are available to triangles, just as for polygons.
The native serialization format for MeshDescription is now based around triangles.
Polygons of arbitrary number of edges may still be represented, and when created, will automatically generate the appropriate number of triangles.  Polygons of more than three sides automatically generate 'internal edges', which are owned by the polygon, and which will be regenerated if the polygon is retriangulated. Internal edges are otherwise not distinct from other edges, and can be used to determine connected triangles or vertices.
Direct access to public members of mesh element classes (FMeshVertex, etc) is now deprecated. In particular, vertex instances and edges now hold a list of connected triangles, and the ConnectedPolygons member is deprecated and will be removed (as this data can be derived from the ConnectedTriangles list).
Improved the MeshDescription API, providing more operations, and allowing arrays with different allocators to be provided as results containers.
Fixed several MeshEditing operations.
Added MeshDescription unit tests.
#rb none

[CL 7099758 by Richard TalbotWatkin in Dev-Editor branch]
2019-06-20 08:20:20 -04:00
Chris Gagnon
80918bea22 Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 5110714 by Chris Gagnon in Dev-Editor branch]
2019-02-21 13:05:30 -05:00
Ryan Schmidt
4b8d37ff59 Preserve FMeshDescriptionBulkData versioning information when loaded from package, so it can be retrospectively applied to the FBulkDataReader archive when deserializing FMeshDescription.
#jira UE-69412
#rb Richard.TalbotWatkins
#robomerge main

[CL 4879713 by Ryan Schmidt in Dev-Editor branch]
2019-02-02 12:38:10 -05:00
Ryan Schmidt
6673ad5173 revert 4879687 so it can be resubmitted with main-robmerge
#rb none

[CL 4879705 by Ryan Schmidt in Dev-Editor branch]
2019-02-02 12:00:28 -05:00
Richard TalbotWatkin
31df88b78d Preserve FMeshDescriptionBulkData versioning information when loaded from package, so it can be retrospectively applied to the FBulkDataReader archive when deserializing FMeshDescription.
#jira UE-69412
#rb Ryan.Schmidt
#robomerge main

[CL 4879687 by Richard TalbotWatkin in Dev-Editor branch]
2019-02-02 11:27:19 -05:00
Richard TalbotWatkin
f2a3f32edf Change to FMeshDescription API. CreatePolygon[WithID] now takes a simple array of vertex instances instead of FMeshDescription::ContourPoint, hence there is no need to specify corresponding edge IDs. Any edges which do not exist in the mesh description will be automatically created by CreatePolygon, and their IDs returned.
Fixed up all code to use the new method, fixed a few bugs.
#rb Alexis.Matte

[CL 4750082 by Richard TalbotWatkin in Dev-Editor branch]
2019-01-18 06:37:35 -05:00
Ryan Schmidt
ee6addaefc fix serialization error
#rb matt.kuhlenschmidt

[CL 4714908 by Ryan Schmidt in Dev-Editor branch]
2019-01-11 18:47:09 -05:00
Ryan Schmidt
9d7694518c Remove all references to holes-in-polygons from MeshDescription and EditableMesh
#codereview richard.talbotwatkin

[CL 4709054 by Ryan Schmidt in Dev-Editor branch]
2019-01-11 10:08:05 -05:00
Chris Gagnon
8fc25ea18e Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 4676797 by Chris Gagnon in Dev-Editor branch]
2019-01-02 14:54:39 -05:00
Richard TalbotWatkin
2d0a0bd233 Temporary fix for crash when reimporting, pending a robust solution for temporarily unloading bulk data in the editor.
#jira UE-67443
#rb none

[CL 4652255 by Richard TalbotWatkin in Dev-Editor branch]
2018-12-12 07:00:54 -05:00
Richard TalbotWatkin
e1a4109154 Added GUID serialized with MeshDescription bulk data. This is used when generating DDC keys for render data for new assets following RawMesh deprecation.
To do: handle generated LODs.
#codereview Alexis.Matte
#rb none

[CL 4647138 by Richard TalbotWatkin in Dev-Editor branch]
2018-12-10 19:34:09 -05:00
Richard TalbotWatkin
e74a1e7fc4 - Deprecated FRawMesh as source model serialization format for static meshes.
- MeshDescription now held as compressed bulk data and unpacked on demand. This is managed by FMeshDescriptionBulkData.
- Made RawMesh accessors in StaticMesh responsible for performing legacy conversion from MeshDescription if necessary.
- Added FBulkDataReader/FBulkDataWriter for serializing bulk data to/from archives.
- Added FUntypedBulkData::UnloadBulkData() for releasing the bulk data allocation without invalidating it (so it can be reloaded when necessary). Editor only.
- Renamed StaticMesh MeshDescription methods (now GetMeshDescription(), CommitMeshDescription() etc).
- Removed unnecessary mesh description attributes from StaticMesh: those which are used only by Editable Mesh, and transient attributes which are automatically generated when needed for building vertex tangent space.
- Slight change to FAttributesSetBase::RegisterAttribute(): if the attribute specified already exists, it will be amended to adopt the type, passed flags and number of indices. If only the number of indices changes, any existing data will be preserved if possible.
- Added TMeshAttributesRef::Copy() to copy an entire attributes array from one name/index to another.
- Changed implementation of TMeshAttributesRef/TMeshAttributesView to provide a const ref/view if the template type parameter is const. Added TMeshAttributesConstRef/TMeshAttributesConstView as an alias for backwards compatibility.
- Added FMeshDescription::IsEmpty() for determining whether a mesh description has any content or not.
- Removed versioning GUID for mesh description: this should be handled by each mesh description client now.

#rb Alexis.Matte

[CL 4644791 by Richard TalbotWatkin in Dev-Editor branch]
2018-12-10 09:29:08 -05:00
Richard TalbotWatkin
da7a49506e Changed FMeshDescription to a struct from a class.
Added log errors when loading UMeshDescription objects (now deprecated), in preparation to resave any which remain.
Once all serialized UMeshDescriptions are wiped out (they only exist internally), FMeshDescription will become a USTRUCT.
#fyi Tim.Gautier
#rb none

[CL 4266356 by Richard TalbotWatkin in Dev-Editor branch]
2018-08-07 16:07:44 -04:00
Richard TalbotWatkin
24a2a24011 New attribute array API.
Fixed some flaws in the original API, deprecated various methods, and introduced some new features.
- Now attribute arrays are accessed via TAttributesRef or TAttributesView (and corresponding const versions). These value types hold references to attribute arrays, and individual elements can be accessed by their element ID and attribute index. Using a value type is safer than the previous method which required assignment to a const-ref (and not doing so would take a temporary copy of the attribute array).
- The attribute set has been totally flattened, so all attributes of different types are added to the same container. This greatly improves compile times, prevents attributes from being created with the same name but different types, and permits the view feature.
- The class hierarchy has changed to have generic base classes where possible with no particular ElementID type. This reduces the code footprint by no longer generating nearly identical copies of templated methods.
- A TAttributesView allows the user to access an attribute array by the type of their choosing, regardless of its actual type. For example, the Normal attribute may be registered with type FPackedVector, but accessed as if it was an FVector. This allows us to move away from very strong typing, and instead transparently store attributes of a more efficient size, while the user is not affected.
- A transient attribute flag has been added, to denote that a particular attribute should not be saved.
#rb none

[CL 4226081 by Richard TalbotWatkin in Dev-Editor branch]
2018-07-20 18:58:37 -04:00
Matt Kuhlenschmidt
e35d32b300 Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 4170088 by Matt Kuhlenschmidt in Dev-Editor branch]
2018-06-28 11:46:19 -04:00
Matt Kuhlenschmidt
e9f2982e4d Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 4137243 by Matt Kuhlenschmidt in Dev-Editor branch]
2018-06-19 09:08:53 -04:00
Richard TalbotWatkin
1ae0956f2b Undo //UE4/Dev-Editor/Engine/Source/Runtime/... changelist 4096711
This will be superseded soon by changes merged over from 4.20.

#rb none

[CL 4135767 by Richard TalbotWatkin in Dev-Editor branch]
2018-06-18 14:06:38 -04:00
richard talbotwatkin
96d7d9dbfc Copied from Dev-Editor CL 4118758
- Refactor to put UStaticMesh Mesh Descriptions in a separate object which is not loaded by default, but which can be requested when needed. This needs to be kept in sync with the number of SourceModel LODs.
- Various refactors to import/building.
- Changed UMeshDescription to FMeshDescription, and made its preferred semantics pass-by-reference rather than by pointer.
- Deprecated UMeshDescription.
#rb Alexis.Matte
#jira

#ROBOMERGE-SOURCE: CL 4135475 in //UE4/Release-4.20/...
#ROBOMERGE-BOT: RELEASE (Release-4.20 -> Release-Staging-4.20)
#ROBOMERGE-AUTHOR: richard.talbotwatkin

[CL 4135477 by richard talbotwatkin in Staging-4.20 branch]
2018-06-18 12:18:21 -04:00
richard talbotwatkin
7608b854ab Undo //UE4/Release-4.20/Engine/... changelist 4135306
#rb none
#jira

#ROBOMERGE-SOURCE: CL 4135397 in //UE4/Release-4.20/...
#ROBOMERGE-BOT: RELEASE (Release-4.20 -> Release-Staging-4.20)
#ROBOMERGE-AUTHOR: richard.talbotwatkin

[CL 4135398 by richard talbotwatkin in Staging-4.20 branch]
2018-06-18 11:53:46 -04:00
richard talbotwatkin
b4b7fa924c Copied from Dev-Editor CL 4118758
- Refactor to put UStaticMesh Mesh Descriptions in a separate object which is not loaded by default, but which can be requested when needed. This needs to be kept in sync with the number of SourceModel LODs.
- Various refactors to import/building.
- Changed UMeshDescription to FMeshDescription, and made its preferred semantics pass-by-reference rather than by pointer.
- Deprecated UMeshDescription.
#rb Alexis.Matte
#jira

#ROBOMERGE-SOURCE: CL 4135306 in //UE4/Release-4.20/...
#ROBOMERGE-BOT: RELEASE (Release-4.20 -> Release-Staging-4.20)
#ROBOMERGE-AUTHOR: richard.talbotwatkin

[CL 4135311 by richard talbotwatkin in Staging-4.20 branch]
2018-06-18 11:27:18 -04:00
richard talbotwatkin
63731aaf46 Copied from Dev-Editor CL 4096711
Added versioning code to UMeshDescription mesh elements so that legacy assets which still contain UMeshDescriptions still load OK.
#rb none
#jira

#ROBOMERGE-SOURCE: CL 4134922 in //UE4/Release-4.20/...
#ROBOMERGE-BOT: RELEASE (Release-4.20 -> Release-Staging-4.20)
#ROBOMERGE-AUTHOR: richard.talbotwatkin

[CL 4134925 by richard talbotwatkin in Staging-4.20 branch]
2018-06-18 08:47:01 -04:00
richard talbotwatkin
34f36e56d8 Copied from Dev-Editor CL 4096445
New serialization layout for UMeshDescription.
- Only the bare minimum is serialized: any internal values which can be inferred from others in the Mesh Description are omitted.
- Triangles are no longer serialized: a triangulation step is performed per polygon when serialized.
- Attribute arrays of simple types are now serialized with BulkSerialize for speed; only FName requires element-by-element serialization.
#rb none
#jira

#ROBOMERGE-SOURCE: CL 4134879 in //UE4/Release-4.20/...
#ROBOMERGE-BOT: RELEASE (Release-4.20 -> Release-Staging-4.20)
#ROBOMERGE-AUTHOR: richard.talbotwatkin

[CL 4134880 by richard talbotwatkin in Staging-4.20 branch]
2018-06-18 07:23:58 -04:00
jerome delattre
9dcdc6c566 #ROBOMERGE-AUTHOR: jerome.delattre
Copying //Tasks/UE4/Release-4.20-EnterpriseLateFeatures to Release-4.20 (//UE4/Release-4.20)
#rb simon.tourangeau
#jira UE-59798, UE-58919, UE-59480

#ROBOMERGE-SOURCE: CL 4119095 in //UE4/Release-4.20/...
#ROBOMERGE-BOT: RELEASE (Release-4.20 -> Release-Staging-4.20)

[CL 4119100 by jerome delattre in Staging-4.20 branch]
2018-06-07 18:49:50 -04:00