Commit Graph

27 Commits

Author SHA1 Message Date
Ryan Schmidt
39ea0b82bb Improve WeightMap support in Modeling Mode. Duplicate Tool now preserves WeightMaps, conversion between Dynamic and Static meshes properly preserves weight maps and names.
GeometryCore: Add bClearExisting option to FDynamicMeshAttributeSet::EnableMatchingAttributes(). Default true is old behavior. New behavior, when false, is to preserve existing attribute set counts/values. Also now copying group and weight layer names if not set.
ModelingTools: CombineMeshesTool now uses EnableMatchingAttributes instead of only explicitly matching UV layers, so group and weight layers are copied properly to duplicates
MeshConversion: DynamicMeshToMeshDescription now generates unique names in ConvertPolygroupLayers and ConvertWeightLayers. Previously if multiple attribs had the same name (eg NAME_None), output MeshDescription would only have a single attrib w/ that name
#rb david.hill
#preflight 62a116439a3e81e904dde76f

[CL 20570919 by Ryan Schmidt in ue5-main branch]
2022-06-08 23:37:03 -04:00
michael balzer
e52bc9c2f7 MeshConversion: Resolve static analysis warning
#jira UE-151413
#preflight none
#rb none

[CL 20111529 by michael balzer in ue5-main branch]
2022-05-09 17:28:09 -04:00
sebastien lussier
61269672d9 StaticMeshLODResourcesToDynamicMesh.cpp - build fix
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 19947767 via CL 19948023
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19952530 by sebastien lussier in ue5-main branch]
2022-04-28 02:03:11 -04:00
sebastien lussier
18bb7adcec Support building HLODs meshes using cooked data
* Tested mesh merge/simplify/approximate methods
* Fixed issue in Mesh Approximate where import build scale would be applied twice (as LODRenderData is already scaled)
#rb jeanfrancois.dube
#preflight 62693fdc4c0942024111839b

#ROBOMERGE-OWNER: sebastien.lussier
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 19939143 via CL 19945922 via CL 19946391 via CL 19946484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19952398 by sebastien lussier in ue5-main branch]
2022-04-28 01:59:21 -04:00
ryan schmidt
a779b2746b MeshConversion: add support for Tangents and Vertex Colors to FStaticMeshLODResourcesAdapter. Add new FStaticMeshLODResourcesToDynamicMesh conversion class.
#rb jimmy.andrews, rinat.abdrashitov
#preflight 62630735cf17922036dabe3a

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19920177 via CL 19920217 via CL 19920250
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19923140 by ryan schmidt in ue5-main branch]
2022-04-26 12:51:25 -04:00
tyson brochu
768cfab5db Add scalar weight maps to DynamicMeshAttributeSet
- Allow the Attribute Editor Tool to add/delete weight maps from DynamicMesh targets.
- Enable transferring scalar weight maps back and forth between DynamicMesh and MeshDescription.
- Serialize TDynamicAttributeBase::Name when its subclasses are serialized

#rb nathan.mitchell
#preflight 62439b2ab6084b9832307f6e

[CL 19551734 by tyson brochu in ue5-main branch]
2022-03-29 20:04:24 -04:00
fred kimberley
e7e64e1749 Make FVector conversions explicit.
#preflight 6221270ea00412627d0b7dd3
#jira UE-122078
#lockdown Julien.Marchand
#rb Andrew.Davidson

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 19253774 in //UE5/Release-5.0/... via CL 19257968
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v924-19243027)

[CL 19263535 by fred kimberley in ue5-main branch]
2022-03-04 03:48:53 -05:00
ryan schmidt
b4814d732d ApproximateActors: reduce memory footprint by using compressed or lower-resolution LOD0 meshes
- add FStaticMeshLODResourcesAdapter in MeshConversions module, wrapper that presents StaticMesh LODResources mesh (ie Section buffers) with an API compatible with GeometryCore mesh templates
- add TMeshWrapperAdapterd in GeometryCore, this is a shim for getting any template-API-compatible mesh into a FTriangleMeshAdapterd specifically (required to call some non-template mesh processing functions)

- add support for using StaticMesh LODResources meshes in FMeshSceneAdapter instead of source meshes, controlled by build options flag
- add FMeshSceneAdapter build options flags specifying whether UV/Normal queries are required (default true)
  - when not required, the loaded MeshDescriptions and created DynamicMeshes are packed into FColliderMesh which has a smaller memory footprint, allowing the larger meshes to be freed

- to support above, the SpatialWrappers in MeshSceneAdapter.cpp have been refactored extensively
  - added FCompressedMeshSpatialWrapper which Builds from a temporary FDynamicMesh3 into a FColliderMesh, supports all the same options as FDynamicMeshSpatialWrapper (so a drop-in replacement with less memory usage, but no UV/Normal queries)
  - added FBaseMeshSpatialWrapper, base class for existing FDynamicMeshSpatialWrapper and new FCompressedMeshSpatialWrapper that has shared config settings (can more more here in the future)
  - added FStaticMeshLODResourcesMeshSurfaceAdapter, similar toFMeshDescriptionTriangleMeshSurfaceAdapter, a mesh adapter that filters out any geo that doesn't have a Surface-domain material
  - refactored TStaticMeshSpatialWrapper into TStaticMeshSpatialWrapperBase and subclasses FStaticMeshSourceDataSpatialWrapper and FStaticMeshRenderDataSpatialWrapper, for source mesh vs render mesh
  - added FCompressedStaticMeshSpatialWrapper, variant of FStaticMeshSourceDataSpatialWrapper that stores to a FColliderMesh and releases the source MeshDescription
  - SpatialWrapperFactory() now has logic to build from render mesh vs source mesh vs compressed source mesh
  - moved initial SpatialWrapper construction from AddActors() phase to Build() phase, because now it depends on build settings

- add EMeshDataSourceLODPolicy to IGeometryProcessing::FOptions, with LOD0 Source and LOD0 RenderMesh options
- ApproximateActorsImpl now provides/handles this policy setting, and configures FMeshSceneAdapter to not need UV/Normal queries (not required in this context)
- add bUseRenderLODMeshes option in FMeshApproximationSettings to expose render vs source mesh control at user level

#rb sebastien.lussier, rinat.abdrashitov
#jira UE-141256
#preflight 6206db44054c2e38c473be5d
#rnx

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18963126 in //UE5/Release-5.0/... via CL 18963829 via CL 18964587
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18964607 by ryan schmidt in ue5-main branch]
2022-02-11 18:11:49 -05:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
andrew davidson
8e95b10069 Fix FVector2D variant casts - Runtime
Submitted on behalf of fred.kimberley
#rb andy.davidson
#preflight 61f8729a5a026d2d19bb9ca6
#preflight 61f87a025a026d2d19be76ed

#ROBOMERGE-OWNER: andrew.davidson
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18802361 in //UE5/Release-5.0/... via CL 18802891 via CL 18821557
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18821641 by andrew davidson in ue5-main branch]
2022-02-02 01:47:07 -05:00
halfdan ingvarsson
013a4faa37 Fix an issue with editing skelmeshes without material slot names. All materials would use the first material slot as a fallback after editing was committed. Also fixed a related issue where the default profile skinweights attribute wasn't being registered on the resulting meshdesc conversion from dynmesh.
#jira UE-138885
#rb alexis.matte, semion.piskarev
#preflight 61dfc268ed50181feb3e1895

#ROBOMERGE-AUTHOR: halfdan.ingvarsson
#ROBOMERGE-SOURCE: CL 18597328 in //UE5/Release-5.0/... via CL 18597331 via CL 18597333
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18597338 by halfdan ingvarsson in ue5-main branch]
2022-01-13 10:56:50 -05:00
jimmy andrews
cefda3f309 Split Engine-dependent portion of MeshConversion module out to a separate MeshConversionEngineTypes module, to allow unit tests to use MeshConversion
#rb semion.piskarev
#rnx
#preflight 61d35ebf2e0e436c7258abf1

#ROBOMERGE-AUTHOR: jimmy.andrews
#ROBOMERGE-SOURCE: CL 18505222 in //UE5/Release-5.0/... via CL 18505228
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18505238 by jimmy andrews in ue5-release-engine-test branch]
2022-01-03 21:24:50 -05:00
ryan schmidt
849423b0f5 MeshConversion: move non-perf-critical functions from header to cpp to help w/ debugging
#rb none
#rnx
#preflight 61b8dd74b026ce352ac9cb2d

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18461188 in //UE5/Release-5.0/... via CL 18461197
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v898-18417669)

[CL 18461211 by ryan schmidt in ue5-release-engine-test branch]
2021-12-14 17:54:33 -05:00
lonnie li
33877a12c5 ModelingTools: Update the Texture/MultiTexture UV parameters to use GetOptions UI in BakeTexture/BakeVertex.
Fixed MultiTexture UV channel parameter not propagating to evaluator in BakeTexture.
Fixed crash when using invalid source UV channel for BakeAll.

#rb michael.balzer
#rnx
#jira none
#preflight 619eea61801b361978d47905

#ROBOMERGE-AUTHOR: lonnie.li
#ROBOMERGE-SOURCE: CL 18300009 in //UE5/Release-5.0/... via CL 18300013
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18300019 by lonnie li in ue5-release-engine-test branch]
2021-11-26 09:39:26 -05:00
jimmy andrews
32d22502b1 make to/from static mesh conversion not crash if it winds up with a null meshdescription (but still ensure, because something has gone quite wrong in this case)
#rb lonnie.li
#rnx

#ROBOMERGE-AUTHOR: jimmy.andrews
#ROBOMERGE-SOURCE: CL 18271057 in //UE5/Release-5.0/... via CL 18271086
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18271096 by jimmy andrews in ue5-release-engine-test branch]
2021-11-23 11:37:51 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
michael balzer
b8a1c9b6cf GeometryCore: Remove ExplicitUseGeometryMathTypes.h
#ROBOMERGE-AUTHOR: michael.balzer
#ROBOMERGE-SOURCE: CL 18227685 in //UE5/Release-5.0/... via CL 18229350
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 18231457 by michael balzer in ue5-release-engine-test branch]
2021-11-17 19:02:44 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
nathan mitchell
d2794d42ce DynamicMesh: Fixed issue where new UVChannels would cause a crash when introduced during UpdateAttributes
#rb Jimmy.Andrews
#rnx

#ROBOMERGE-AUTHOR: nathan.mitchell
#ROBOMERGE-SOURCE: CL 17879980 in //UE5/Release-5.0/... via CL 17879990
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v883-17842818)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17879998 by nathan mitchell in ue5-release-engine-test branch]
2021-10-20 20:00:20 -04:00
ryan schmidt
6437ecc4a1 GeometryCore: replace all usage of GeometryCore FVector3<T> with TVector<T>, remove FVector3<T> and GVector4<T>
#rb none
#rnx
#jira none
#preflight 614ce33574f7e70001ea822b

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 17617027 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17617043 by ryan schmidt in ue5-release-engine-test branch]
2021-09-23 19:38:55 -04:00
andrew davidson
57beb335f2 Merging //UE5/Dev-LargeWorldCoordinates [at] 17581892 to //UE5/Main
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 17595295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17595306 by andrew davidson in ue5-release-engine-test branch]
2021-09-22 10:01:48 -04:00
ryan schmidt
5a1ca4e006 MeshConversion: FMeshDescriptionBuilder::AppendPolygonGroup() now initializes Material Slot Names attribute
ModelingComponents: handle situations where MeshDescription has more Sections than Material Slots. See code comments for more details.
#rb david.hill
#rnx
#jira none
#preflight 6142107c4778fa0001279045

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 17522274 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17522294 by ryan schmidt in ue5-release-engine-test branch]
2021-09-15 12:52:56 -04:00
lonnie li
90f5344d22 ModelingTools: Add N-to-1 detail mesh bake tool
- Added new FindNearestHitTriangle overload with bary coords.
- Refactored BakeMeshAttributeMapsTool into common base class with new MultiMesh (N-to-1) variant.
- Extended MeshDescriptionAdapter to support UVs.
- Added new queries on IMeshSpatialWrapper for mesh attributes.

#rb ryan.schmidt
#rnx
#jira UETOOL-3395
#preflight 613fb4c3a70fa0000131ff77

#ROBOMERGE-AUTHOR: lonnie.li
#ROBOMERGE-SOURCE: CL 17497155 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17497176 by lonnie li in ue5-release-engine-test branch]
2021-09-13 17:51:19 -04:00
ryan schmidt
e3183cb1e7 GeometryProcessing: clean up mesh timestamps.
- remove FDynamicMesh3::Timestamp (unused), rename Shape/Topology Timestamps to Shape/TopologyChangeStamp, change to atomic<uint32>
- add FDynamicMesh3::bEnableShapeChangeStamp, default to false, to disable ShapeChange tracking. Add ::SetShapeChangeStampEnabled() and ::HasShapeChangeStampEnabled() to configure.
- replace FDynamicMesh3::UpdateTimestamps() with UpdateChangeStamps()
- add bTrackChange param to FDynamicMesh3::SetVertex(), optionally updates ShapeChangeStamp (if enabled). Default true. Remove SetVertex_NoTimeStampUpdate(), update call sites.
- add FDynamicMesh3::GetChangeStamp(), returns combination of Shape and Topology stamps as uint64
- rename TTriangleMeshAdapter::GetTimestamp() to GetChangeStamp(), update usages
- remove TPointSetAdapter::Timestamp()   (was not used in code)
- update TMeshAABBTree3 to use GetChangeStamp(), update internal checks to call IsValid() instead
- update TFastWindingTree w/ similar changes
- update calls in UVEditor, may require further updates
#rb semion.piskarev
#rnx
#jira none
#preflight 6126904c72e9eb00011434fe

#ROBOMERGE-SOURCE: CL 17310271 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17315112 by ryan schmidt in ue5-release-engine-test branch]
2021-08-26 06:57:55 -04:00
lonnie li
a1819897ba ModelingTools: Pre-transform vertex colors SRGB to Linear in BakeVertex.
#rb jimmy.andrews michael.balzer semion.piskarev
#rnx
#jira UETOOL-3748
#preflight 61140b876c6eb000016e7e5a

#ROBOMERGE-SOURCE: CL 17144701 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17144719 by lonnie li in ue5-release-engine-test branch]
2021-08-11 20:29:24 -04:00