Commit Graph

227 Commits

Author SHA1 Message Date
Ryan Schmidt
b02f4829db ModelingTools: DynamicMeshActor support Tools and Settings.
- Move UCreateMeshObjectTypeProperties to ModelingComponents and update all include sites
- Added Editor Modeling Mode settings to Enable/Disable showing DynamicMeshActor creation options, and select default mesh object type. Removed CVarEnableDynamicMeshActors.
- Added optional 'Auto' output mesh type to UCreateMeshObjectTypeProperties. This can be used in Tools that have input objects and want to allow optional conversion, but default to 'just use input mesh object type'.
- Added ConvertMeshesTool, this does in-place conversion between Mesh Object types for a set of selected objects (Duplicate tool can also do this, but only for a single object, and functionality is expected to further diverge)
- Added SplitMeshesTool, decomposes a mesh into parts and creates a new output object for each part
- CombineMeshesTool now supports variable output object type. Cleaned up internals.

#rb none
#rnx
#jira none
#preflight 60d3bc76b4bb42000195eccf

[CL 16768010 by Ryan Schmidt in ue5-main branch]
2021-06-23 22:13:32 -04:00
Michael Noland
ed64a12074 ModelingTools: Initialized some uninitialized struct members to fix a startup warning (soon to be an error)
#fyi Ryan.Schmidt

[CL 16752148 by Michael Noland in ue5-main branch]
2021-06-22 20:31:45 -04:00
Ryan Schmidt
34e50c3aa1 GeometryFramework: move UDynamicMesh and DynamicMeshComponent to new Runtime/Experimental/GeometryFramework module
#rb none
#rnx
#jira none
#preflight 60d16e6ca81904000135e6d4

[CL 16744295 by Ryan Schmidt in ue5-main branch]
2021-06-22 12:10:24 -04:00
Ryan Schmidt
6497a53181 ModelingComponents: Add DynamicMeshActor
- ADynamicMeshActor type has a UDynamicMeshComponent subobject (similar to StaticMeshActor)
- Add IPersistentDynamicMeshSource, a ToolTarget Interface for accessing a UDynamicMesh
- Add UDynamicMeshComponentToolTarget, a UToolTarget implementing the above as well as various standard interfaces, to allow Tools to operate on an external DynamicMeshComponent
- Update UE::ToolTarget:: helper functions that get/commit via DynamicMesh to handle IPersistentDynamicMeshSource directly, instead of going via existing MeshDescription/DynamicMesh interfaces. Add UE::ToolTarget::SetSourceObjectVisible() helper function.
- Add support for creating DynamicMeshActors in UCreateMeshObjectTypeProperties and UEditorModelingObjectsCreationAPI
- register UDynamicMeshComponentToolTargetFactory in ModelingToolsEditorMode
- Rename existing internal ADynamicMeshActor to AOldDynamicMeshActor. Does not appear to be in use and will be removed in a future CL.

#rb lonnie.li
#rnx
#jira none
#preflight 60d0effc367e6700014c2e89

[CL 16735093 by Ryan Schmidt in ue5-main branch]
2021-06-21 18:08:56 -04:00
sebastien lussier
aaf2762f1f Approximate Actors
Exclude from the mesh generation all mesh sections that are using materials for which the material domain isn't "Surface" (ex: decals)
Those will still be rendered properly in the material baking phase.
Prevent black patches in places where decals aren't resting on surfaces
#rb ryan.schmidt


#ROBOMERGE-SOURCE: CL 16733154
#ROBOMERGE-BOT: (v835-16672529)

[CL 16733173 by sebastien lussier in ue5-main branch]
2021-06-21 16:32:50 -04:00
Ryan Schmidt
5d58a012cd ModelingComponents: add support for a UBodySetup and Complex Collision to DynamicMeshComponent
#rb none
#rnx
#jira none
#preflight 60cfb14471002f0001696afa

[CL 16724446 by Ryan Schmidt in ue5-main branch]
2021-06-20 18:09:19 -04:00
Ryan Schmidt
da254f4c8b ModelingComponents: Add UBaseDynamicmeshComponent::SetShadowsEnabled() and UPreviewMesh::SetShadowsEnabled() wrapper, and update Tools that are directly modifying the bCastDynamicShadow variable on Components. That doesn't work as it doesn't update the SceneProxy, and is currently causing crashes. ::SetShadowsEnabled() forces a full immediate rebuild of the SceneProxy, which is very heavy but seems to be required.
#rb david.hill
#rnx
#jira UE-118344
#preflight 60cb7d3a9f12370001350352

[CL 16715096 by Ryan Schmidt in ue5-main branch]
2021-06-17 19:18:23 -04:00
Ryan Schmidt
d3c25b3b3a ModelingComponents: handle meshes without materialID attribute in MeshRenderDecomposition
#rb none
#rnx
#jira none
#fyi nathan.mitchell

[CL 16694640 by Ryan Schmidt in ue5-main branch]
2021-06-16 15:35:30 -04:00
Ryan Schmidt
1a178fa774 ModelingTools: clean up old PDI-based mesh edge rendering in Weld, Generate Polygroups, Remesh, Simplify. Replace with usage of UMeshElementsVisualizer and/or UPreviewGeometry. Also clean up includes and port to UE::ToolTarget:: APIs.
UMeshElementsVisualizer::SetMeshAccessFunction() now takes a TFunction with a TFunctionRef argument, instead of with a FDynamicMesh3* argument. This allows the UMeshElementsVisualizer to access the target mesh via the ProcessMesh()-style call on a UPreviewMesh, UDynamicMesh, etc, rather than receiving direct pointer access. See UWeldMeshEdgesTool::Setup() for example usage.

Add UMeshOpPreviewWithBackgroundCompute::ProcessCurrentMesh(), which forwards to the embedded UPreviewMesh::ProcessMesh()  (which can be used with the above)

Add UE::ToolTarget::GetMeshDescriptionCopy() to ModelingToolTargetUtil, similar to existing DynamicMesh variant that will auto-compute tangents if necessary.

#rb none
#rnx
#jira none
#preflight 60c8def586ce760001d8de51
#fyi semion.piskarev

[CL 16679472 by Ryan Schmidt in ue5-main branch]
2021-06-15 17:05:25 -04:00
ryan schmidt
dd142ab4b2 ModelingComponents: improve handling of thin objects in FMeshSceneAdapter. Add Weld step before connected components. Per-Instance transforms are now extracted outside of Component-level processing, and 'thin' detection is now tested under this transform set, for each connected component. This improves handling of (eg) extreme scaling applied to create thin instances. Check AABB dimensions in IsThinPlanarSubMesh() before using normals, this handles many thin parts that are not "box-like" (will still not work if part is rotated). Seed points now generated on offset surfaces, if required, to avoid failures in surface rootfinding. Add support for filtering tiny objects (enabled in ApproximateActorsImpl, for 10% of voxel dimension)
#rb none
#rnx
#preflight 60c844582da78400011f4ef7


#ROBOMERGE-SOURCE: CL 16670139
#ROBOMERGE-BOT: (v834-16658389)

[CL 16670142 by ryan schmidt in ue5-main branch]
2021-06-15 02:47:13 -04:00
Ryan Schmidt
ca511a93bd ModelingComponents: static analysis fix
#rb none
#rnx
#jira none
#preflight 60c666a65c10070001e632a4

[CL 16654965 by Ryan Schmidt in ue5-main branch]
2021-06-13 20:52:23 -04:00
Ryan Schmidt
e196c256e4 GeometryProcessing: remove forwarding headers used in GeometryCore transition, and update all affected includes.
#rb none
#rnx
#jira none
#preflight 60c52c5db9446100014da02d

[CL 16653115 by Ryan Schmidt in ue5-main branch]
2021-06-13 00:35:22 -04:00
Ryan Schmidt
46a8836354 ModelingComponents: handle case in FMeshRenderDecomposition where input mesh has no materials
#rb none
#rnx
#jira none
#preflight 60c52b0ab9446100014d9aad

[CL 16653089 by Ryan Schmidt in ue5-main branch]
2021-06-13 00:31:44 -04:00
Ryan Schmidt
f45388ffbe Rename USimpleDynamicMeshComponent to UDynamicMeshComponent. Move ModelingComponents Components and SceneProxys to /Components subdirectory.
#rb none
#rnx
#jira none
#preflight 60c4451f5c10070001ae0537

[CL 16652187 by Ryan Schmidt in ue5-main branch]
2021-06-12 14:28:52 -04:00
Ryan Schmidt
fdf11b67d2 ModelingComponents: Clean up DynamicMeshComponent API. Update Component and Proxy handling of Tangents to use Attribute Overlay if available. Update affected Tools and also convert most of the affected Tools to use UE::ToolTarget helper functions.
- Add UE::ToolTarget::CommitMaterialSetUpdate() and ::CommitDynamicMeshUpdate(). ::GetDynamicMeshCopy() can now return tangents if requested.
- Add IMeshDescriptionProvider::CalculateAutoGeneratedAttributes(). Default implementation does nothing, UStaticMeshComponentToolTarget implementation initializes auto-generated MeshDescription attributes. Used in ::GetDynamicMeshCopy() to get tangents (but requires a MeshDescription copy).
- Clean up handling of Tangents in Simple/OctreeDynamicMeshComponent. Add local MakeTangentsFunc() to generate the Tangents lambda, handle different cases and no-tangents fallbacks consistently.
- UDynamicMesh: add optional info arguments to EditMesh() and ChangeInfo struct. Add support for deferring change events from Edit funcs.
- Remove UBaseDynamicMeshComponent::InitializeMesh(), ::Bake() APIs, and add ::SetMesh(). Implement in Simple/Octree implementations, update all Tools that used those APIs.
- Add USimpleDynamicMeshComponent::ProcessMesh(), EditMesh(). These are now the preferred ways to read/write mesh.
- Update USimpleDynamicMeshComponent tangents handling. Externally-computed tangents are now taken directly from the FDynamicMesh3 attribute set. Autogenerated tangents are still computed and stored in an internal FMeshTangentsf, but this is no longer exposed for external updates.
- Remove UPreviewMesh pass-through functions for Tangents access, InitializeMesh() and Bake(). Add ProcessMesh()
- Update all affected Tools. In most cases these Tools have also been converted to use ModelingToolTargetUtil functions, instead of direct ToolTarget interface casting.

#rb none
#rnx
#jira none
#preflight 60c3e71d3e1b3c00015668af

[CL 16650666 by Ryan Schmidt in ue5-main branch]
2021-06-11 22:39:18 -04:00
nathan mitchell
76430ea10f UVEditor: Adding multiple selection to MeshSelectionMechanic
#rb michael.balzer
#rnx
#jira UETOOL-3692

[CL 16645760 by nathan mitchell in ue5-main branch]
2021-06-11 15:36:05 -04:00
Zousar Shaker
b6f7dafdb1 Fixing callsites for new raw pointer to TObjectPtr upgrade pass on Engine + ShooterGame.
#rb none

[CL 16640949 by Zousar Shaker in ue5-main branch]
2021-06-11 10:09:47 -04:00
Ryan Schmidt
b62db3ed4d ModelingComponents: Add UDynamicMesh class, wraps FDynamicMesh3 in a UObject. Use as mesh storage inside SimpleDynamicMeshComponent and OctreeDynamicMeshComponent. Clean up SimpleDynamicMeshComponent and BaseDynamicMeshComponent API and headers.
#rb david.hill
#rnx
#jira none
#preflight 60c15e9cc612640001ac7350

[CL 16632323 by Ryan Schmidt in ue5-main branch]
2021-06-10 18:37:34 -04:00
semion piskarev
657650fe05 UVEditor: Added live preview to UV editor. To support this, did major refactoring in the way that the UV editor supplies its tools with input. Also added scaling of islands and tweaked the used material to make gizmo more visible.
#rb Brooke.Hubert, Lonnie.Li, Michael.Balzer
#rnx
#jira UETOOL-3111, UETOOL-3574

[CL 16618600 by semion piskarev in ue5-main branch]
2021-06-09 23:53:59 -04:00
semion piskarev
3cb0babc20 MeshModelingTools: Added tool targets that operate on static and skeletal mesh assets without an underlying component, and refactored to use the same code. Also changed the dynamic mesh shared pointers in the tool targets to be thread safe ones.
#rb Ryan.Schmidt
#jira none
#rnx

[CL 16615477 by semion piskarev in ue5-main branch]
2021-06-09 19:21:27 -04:00
semion piskarev
b58ce73afc MeshModelingTools: Tweaking UMeshOpPreviewWithBackgroundCompute to allow calculations to be cancelled without shutting down the preview entirely, and to allow the op generator to be swapped out. This will be useful when sharing a preview object between tools or tool mechanics.
#rb Tyson.Brochu
#rnx
#jira none

[CL 16606486 by semion piskarev in ue5-main branch]
2021-06-09 11:53:46 -04:00
semion piskarev
cf40dc417f MeshModelingTools: Tweaked tool target requirements object storage default and added a convenience function to add requirements. Also added several comments in places.
#rb Lonnie.Li, Tyson.Brochu
#rnx
#jira none

[CL 16606399 by semion piskarev in ue5-main branch]
2021-06-09 11:50:54 -04:00
Ryan Schmidt
da355de8a2 ModelingTools: Add basic Transfer Mesh Tool that can copy a mesh from one object to another. Add UE::ToolTarget::CommitMeshDescriptionUpdate() helper function.
#rb none
#rnx
#jira none
#preflight 60bf147e0c76f90001db699e

[CL 16583974 by Ryan Schmidt in ue5-main branch]
2021-06-08 03:51:23 -04:00
ryan schmidt
a8da674d2c ApproximateActors: Implement support for detection of thin-slabs (ie thin planar meshes that are not single-sided) in FMeshSceneAdapter. Add support for sub-mesh instancing, to reduce number of times that repeated meshes are unique'd when used with the same scaling transform. Reorganize computation so that spatial builds are processed in decreasing-mesh-size order, and do other parallel improvements, such that time to process a large assembly (total ~2.2b triangles from 37k instances of 415 unique meshes w/~44m unique triangles) reduces from 58s to 22s (with ~10s of this time being loading source mesh data) on 64-core threadripper.
#rb none
#rnx
[FYI] sebastien.lussier
#preflight 60beff3593a9d300017c2be8


#ROBOMERGE-OWNER: ryan.schmidt
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 16583724
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16583791 by ryan schmidt in ue5-main branch]
2021-06-08 02:55:00 -04:00
tyson brochu
9d2b0fdde3 Move ConvexHull2, ConvexHull3, and exact predicates into GeometryCore/CompGeom. Change them all to use the UE::Geometry namespace. Copy associated TPS files as needed.
#ushell-cherrypick of 16542896 by swarm
#rb ryan.schmidt

[CL 16575323 by tyson brochu in ue5-main branch]
2021-06-07 15:02:12 -04:00