Commit Graph

397 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
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
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
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
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
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
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
a8c13b57a9 ModelingComponents: make FMeshDescription returned by IMeshDescriptionProvider const, this pointer should not be modified
#rb none
#rnx
#jira none
#preflight 60c5024af7cffb0001d3fdfa
#fyi semion.piskarev, lonnie.li

[CL 16652350 by Ryan Schmidt in ue5-main branch]
2021-06-12 15:45:49 -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
semion piskarev
5d3c068629 MeshModelingTools: Fix materials not being shown in Warp tool.
#rb David.Hill
#rnx
#jira none

[CL 16643921 by semion piskarev in ue5-main branch]
2021-06-11 13:32:33 -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
lonnie li
450820cda6 ModelingTools: Fix synchronization issues in BakeTexture when modifying bake targets during a background compute.
#rb michael.balzer
#rnx
#jira none
#preflight 60c1280079a7fe0001317aaa

[CL 16614097 by lonnie li in ue5-main branch]
2021-06-09 18:10:23 -04:00
Ryan Schmidt
85e8cae2f4 ModelingTools: delete PositionPlaneGizmo, no longer in use
#rb none
#rnx
#jira none
#preflight 60c005f01264df0001441c8b

[CL 16600498 by Ryan Schmidt in ue5-main branch]
2021-06-08 23:44:23 -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
lonnie li
febb75cece ModelingTools: Fix post op selection for TriEdit: Extrude, Offset, Cut Faces & Duplicate.
#rb michael.balzer
#rnx
#jira UE-114975
#preflight 60baa85f2c42ea0001d65f32

[CL 16562738 by lonnie li in ue5-main branch]
2021-06-04 19:26:45 -04:00