Commit Graph

601 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
7393d0f0f5 ModelingTools: Fix various issues related to Tangents. FDynamicMeshEditor was using hardcoded 0 index instead of loop-variable NormalLayerIndex in several places. FDynamicMeshTangents did not handle invalid overlay triangles. UEditorModelingObjectsCreationAPI::CreateDynamicMeshActor() was not enabling Tangents on new DynamicMeshComponents. UDynamicMeshComponentToolTarget was not transferring tangents between FDynamicMesh3 and FMeshDescription when converting.
#rb none
#rnx
#jira none
preflight 60d25e9678c3b000012438cc

[CL 16751529 by Ryan Schmidt in ue5-main branch]
2021-06-22 19:34:47 -04:00
Ryan Schmidt
942f318adb ModelingTools: fix TObjectPtr static analysis issue
#rb none
#rnx
#jira none

[CL 16747568 by Ryan Schmidt in ue5-main branch]
2021-06-22 15:34:53 -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
dcc90479b6 ModelingTools: remove UAssetBackedTarget requirement from various Tools so that they work on DynamicMeshActor/Components. The GetMapToSharedSourceData() function in UMultiSelectionTool now handles this internally.
#rb none
#rnx
#jira none
#preflight 60d16a58367e6700015e9020

[CL 16744001 by Ryan Schmidt in ue5-main branch]
2021-06-22 11:54:55 -04:00
Ryan Schmidt
d494ac3da8 ModelingTools: add Volume output support to ExtractCollisionGeometryTool. Add support for emitting each collision shape as a separate object, and emitting complex collision. Fix TObjectPtr issue in SetCollisionGeometryTool.
#rb none
#rnx
#jira
#preflight 60d110b1d4d7ac00018d0523

[CL 16738634 by Ryan Schmidt in ue5-main branch]
2021-06-22 00:42:39 -04:00
Ryan Schmidt
674ac8687c ModelingTools: add cvar to enable/disable creation of DynamicMeshActors, disable by default
#rb none
#rnx
#jira none

[CL 16735188 by Ryan Schmidt in ue5-main branch]
2021-06-21 18:14:12 -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
52ab1f5537 ModelingTools: Clean up AutoUV Tools and add support for Polygroup Layers.
- Refactor recompute-UVs-for-groups/islands out of ParameterizeMeshOp/Tool into RecomputeUVsOp/Tool. RecomputeUVsTool supports selection of active PolygroupLayer when applicable. Add support for auto-repacking.
- Clean up ParameterizeMeshOp/Tool, remove functionality related to recomputation that was moved to Recompute tool, add separate property sets for UVAtlas and XAtlas
- Add FDynamicMeshUVEditor::QuickPack() function to compute UV layout
- Add support for Polygroup Layer selection in SetCollisionGeometryTool, if only one source object is in use

#rb none
#rnx
#jira none
#preflight 60ced4b0be81e800012cc135

[CL 16724375 by Ryan Schmidt in ue5-main branch]
2021-06-20 16:57:02 -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
michael balzer
fd81a24cf6 GeometryProcessing: Reset existing UVs before Unwrap
#jira UE-116883
#rb ryan.schimdt
#rnx

[CL 16710839 by michael balzer in ue5-main branch]
2021-06-17 16:27:03 -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
571c91d58f ModelingTools: remove duplicate branch identified by PVS
#rb none
#rnx
#jira none

[CL 16691388 by Ryan Schmidt in ue5-main branch]
2021-06-16 13:26:33 -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
24095e6d33 ToolsFramework: Add UTransformProxy::AddComponentCustom(), allows adding a target Component with custom transform get/set functions. Can be used to (eg) wrap an ISMC instance.
ModelingTools: add support for ISMC instances in EditPivotTool and TransformMeshesTool. In both cases the Tool will operate on the Instances by default, rather than the Component.  Clean up TransformMeshesTool properties panel, add grid and rotation snapping.

#rb none
#rnx
#preflight 60c83c1243ec380001e252cb


#ROBOMERGE-OWNER: ryan.schmidt
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 16670048
#ROBOMERGE-BOT: (v834-16658389)
#ROBOMERGE-CONFLICT from-shelf

[CL 16670125 by ryan schmidt in ue5-main branch]
2021-06-15 02:44:58 -04:00
ryan schmidt
ba69f37e29 ApproxActors: expose hard-normals options. Change UProperty metatags to allow smaller min-dimensions to support smaller objects. Change default nanite proxy percent in CreateStaticMeshUtil to 0 (ie minimal 2000 triangles proxy).
#rb sebastien.lussier
#rnx


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

[CL 16669509 by ryan schmidt in ue5-main branch]
2021-06-15 00:28:54 -04:00
Ryan Schmidt
b71d3f7303 ToolsFramework: support multiple saved versions of a UInteractiveToolPropertySet. Previously only a single global version of a particular UInteractiveToolPropertySet could be saved via ::SaveProperties(), despite the Tool argument. This change adds an internal map keyed on a custom string. This allows different Tools using the same PropertySet to have their own unique saved properties if desired, or share a saved version between a set of Tools. A change to initialization is also made - during the first SaveProperties() call that spawns the new saved property set, the current/initial property values are no longer ovewritten with the default values in ::SaveRestoreProperties(). This allows a Tool to customize the default values before calling Restore().
An unused ::GetPropertyCache() function was also removed.

#rb semion.piskarev
#rnx
#jira none

[CL 16669477 by Ryan Schmidt in ue5-main branch]
2021-06-15 00:27:08 -04:00
Ryan Schmidt
01714fc88e ModelingTools: fix incorrect handling of polygroups on Accept in EditMeshPolygonsTool
#rb semion.piskarev
#rnx
#jira none

[CL 16669469 by Ryan Schmidt in ue5-main branch]
2021-06-15 00:25:58 -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