Commit Graph

135 Commits

Author SHA1 Message Date
ryan schmidt
133a5dd650 ModelingTools: Add support for selection of UV layer and Polygroup layer in MeshSelectionTool. Switch to using MeshElementVisualizer for wireframe/borders, and add a UMeshStatisticsProperties. Improve button text/tooltips. Switch EditMeshMaterialsTool active-material to use a dynamic dropdown list with material names, instead of material index. Change default UV calculation to Conformal in ComputeUVs tool.
GeometryProcessing: make PolygroupSet take a const mesh, and require caller to provide writable mesh when calling SetGroup()

#rb none
#rnx
#jira none
#preflight 60d4ed571a88600001270256

#ROBOMERGE-SOURCE: CL 16781671 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16781675 by ryan schmidt in ue5-release-engine-test branch]
2021-06-25 01:41:35 -04:00
ryan schmidt
c7a7b6b2f9 GeometryFramework: move UDynamicMesh and DynamicMeshComponent to new Runtime/Experimental/GeometryFramework module
#rb none
#rnx
#jira none
#preflight 60d16e6ca81904000135e6d4


#ROBOMERGE-SOURCE: CL 16744295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16744313 by ryan schmidt in ue5-release-engine-test branch]
2021-06-22 12:11:21 -04:00
ryan schmidt
b364eb0465 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

#ROBOMERGE-SOURCE: CL 16724375 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16724383 by ryan schmidt in ue5-release-engine-test branch]
2021-06-20 17:01:49 -04:00
ryan schmidt
7a54a5b023 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

#ROBOMERGE-SOURCE: CL 16679472 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16679476 by ryan schmidt in ue5-release-engine-test branch]
2021-06-15 17:05:40 -04:00
ryan schmidt
001b7d5e63 GeometryProcessing: remove forwarding headers used in GeometryCore transition, and update all affected includes.
#rb none
#rnx
#jira none
#preflight 60c52c5db9446100014da02d

#ROBOMERGE-SOURCE: CL 16653115 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16653121 by ryan schmidt in ue5-release-engine-test branch]
2021-06-13 00:36:02 -04:00
ryan schmidt
f8093923a4 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

#ROBOMERGE-SOURCE: CL 16652350 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16652352 by ryan schmidt in ue5-release-engine-test branch]
2021-06-12 15:46:24 -04:00
ryan schmidt
3a59b1a97b Rename USimpleDynamicMeshComponent to UDynamicMeshComponent. Move ModelingComponents Components and SceneProxys to /Components subdirectory.
#rb none
#rnx
#jira none
#preflight 60c4451f5c10070001ae0537

#ROBOMERGE-SOURCE: CL 16652187 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16652193 by ryan schmidt in ue5-release-engine-test branch]
2021-06-12 14:30:22 -04:00
ryan schmidt
55100a87c5 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

#ROBOMERGE-SOURCE: CL 16650666 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16650707 by ryan schmidt in ue5-release-engine-test branch]
2021-06-11 22:42:32 -04:00
Ryan Schmidt
c3c459d75d ModelingComponents: Move SubdividePoly to ModelingComponentsEditorOnly. Need this to be able to apply SubD in other contexts.
#rb tyson.brochu
#rnx
#jira none
#preflight 60be56c8883e7f00015ed9ad

[CL 16577012 by Ryan Schmidt in ue5-main branch]
2021-06-07 16:29:48 -04:00
Ryan Schmidt
75a21c9bb9 ModelingTools: add support for creating Volumes directly from DrawPolygon, DrawRevolve, DrawPolyPath, and AddPrimitive, CombineMeshes, CutMeshWithMesh, PlaneCut, BaseCreateFromSelected Tools. Improve support for Editing volumes, eg handling mesh/volume interactions, and add configurable auto-simplification for volumes to avoid painful Editor hangs.
- Move ToolTarget implementations, DynamicMeshToVolume to ModelingComponentsEditorOnly module
- move VolumeToDynamicMesh, DynamicMeshProvider/Commiter interfaces to ModelingComponents module
- Add UCreateMeshObjectTypeProperties property set to expose mesh/volume options
- Add FCreateMeshObjectParams::TypeHintClass to allow AVolume type (or other UClass hints) to be passed to creation APIs
- Add UE::ToolTarget::ConfigureCreateMeshObjectParams() util function in ModelingToolTargetUtil, tries to determine output type in a FCreateMeshObjectParams based on input ToolTarget
- Add UEditorModelingObjectsCreationAPI::CreateVolume() implementation
- Add UEditorModelingObjectsCreationAPI::FilterMaterials() that strips out any internal materials and replaces with WorldGridMaterial. This occurs when (eg) subtracting a Volume from a StaticMesh, because the temporary volume mesh gets assigned internal materials, but the Tools don't know this. Use in EditorModelingObjectsCreationAPI when creating new objects. UStaticMeshComponentToolTarget also does this filtering in ::CommitMaterialSetUpdate().
- Add ::ComponentTypeSupportsCollision() function to ComponentCollisionUtil, use to avoid checks/ensures for Volume targets
- Add support for automatic mesh simplification in DynamicMeshToVolume. Add CVar to VolumeDynamicMeshToolTarget.h to control max triangle count (default 500). Apply auto-simplify when creating or updating an AVolume. This prevents the Editor from blocking for long periods on meshes that are too high-res for volumes (even 500 is quite high).
- DynamicMeshToVolume now emits polygroup-faces that contain holes (ie multiple boundary loops) as a set of triangles, rather than emitting separate overlapping faces for each boundary loop

#rb none
#rnx
#jira none
#preflight 60ba50632c42ea0001cb54c5

[CL 16561742 by Ryan Schmidt in ue5-main branch]
2021-06-04 16:04:03 -04:00
Ryan Schmidt
7b214c4a33 MeshModeling: add ModelingObjectsCreationAPI, replaces existing usage of IToolsContextAssetAPI in Modeling Tools/Mode
- add new UModelingObjectsCreationAPI and associated data structures, provides abstract API for creating mesh and texture objects from Tools that is not specifically tied to StaticMesh Actors/Assets
- new helper functions in UE::Modeling:: namespace to simplify usage of an implementation of this API registered in a ContextObjectStore
- add new UEditorModelingObjectsCreationAPI implementation of above, supports hooks for higher level to provide custom paths
- add ModelingModeAssetUtils.h, provides several functions in UE::Modeling:: namespace to be used to implement those hooks (various existing path-determination code is moved here)
- ModelingToolsEditorMode now registers an instance of UEditorModelingObjectsCreationAPI in ContextObjectStore and connects up callbacks to these path functions
- AssetGenerationUtil functions and ModelingModeAssetAPI deleted
- All Tools that previously used IToolsContextAssetAPI updated to use this new system

#rb jimmy.andrews
#rnx
#jira none
#preflight 60b7c2ddae46a1000162729b

[CL 16538450 by Ryan Schmidt in ue5-main branch]
2021-06-02 15:58:00 -04:00
Ryan Schmidt
fdb2bab149 GeometryProcessing: Move MeshConversion module from GeometryProcessing plugin to Runtime. Transfer necessary additional files from DynamicMesh to GeometryCore. Move functions from MeshIndexUtil and MeshAdapterUtil namespaces to UE::Geometry namespace.
#rb none
#rnx
#jira none
#preflight 60a7e75e7d6b060001c61f47

[CL 16428413 by Ryan Schmidt in ue5-main branch]
2021-05-22 01:32:46 -04:00
Jimmy Andrews
cdfcfc3f26 always disable normal recomputation when modeling tools commit a static mesh, as we don't in general want normals re-computed coming out of our modeling tools
#rb ryan.schmidt
#rnx
#preflight 60a82b883df6e30001141e18

[CL 16427674 by Jimmy Andrews in ue5-main branch]
2021-05-21 21:22:54 -04:00
Ryan Schmidt
623e4f96fe GeometryCore: create new GeometryCore Module. Move GeometricObjects code from GeometryProcessing plugin to this new module, as well as core FDynamicMesh3 classes (attributes, aabbtree/octree, change tracking). Update module Build.cs files that reference GeometricObjects.
#rb none
#rnx
#jira none
#preflight 60a713700569f300014a064a

[CL 16415082 by Ryan Schmidt in ue5-main branch]
2021-05-21 01:04:38 -04:00
aurel cordonnier
4c1f424cec no unity fixes
#rb jeanfrancois.dube

[CL 16389788 by aurel cordonnier in ue5-main branch]
2021-05-19 14:05:12 -04:00
halfdan ingvarsson
29194fb8e6 Do fallback on model data also if the bulk data is empty, not just if it's missing.
Always clear the cached mesh descriptor for now. If we do undo after the commit, the cached descriptor is out-of-date w.r.t the actual skelmesh. Deal with it better once skelmeshes actually store their data as mesh descripors.

#trivial
#rnx

[CL 16329029 by halfdan ingvarsson in ue5-main branch]
2021-05-14 09:36:58 -04:00
semion piskarev
b999806285 MeshModelingTools: Add DynamicMesh provider/committer interfaces and update existing targets to support them. Move interface target files.
#rb Lonnie.Li
#rnx
#jira none

[CL 16315070 by semion piskarev in ue5-main branch]
2021-05-13 13:22:55 -04:00
Ryan Schmidt
3019b90219 GeometryProcessing: Add option to do explicit geometric tolerance/deviation checking in TMeshSimplification. Checks edge midpoints and face centroids against a fixed tolerance.
MeshModelingToolset: expose new option in SimplifyMeshOp and SimplifyMeshTool
#rb david.hill
#rnx
#jira none
#preflight 6099fb752032ee00016bee43

[CL 16274273 by Ryan Schmidt in ue5-main branch]
2021-05-11 13:17:19 -04:00
David Hill
b5ed51388c GeometryTools: Simplify Mesh Tool. Don't recompute simplification when toggling display of UV seams (it was recomputing the simplification when you toggled this display option).
Change color of UV seams to match the color used in the mesh inspector.
                 Also update the option name to "Show UV Seams" from "Show Constraints"

#jira none
#rb jimmy.andrews
#preflight 609414f2dfc63600019b3e05

[CL 16223526 by David Hill in ue5-main branch]
2021-05-06 13:48:08 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
halfdan ingvarsson
b170b32087 Add support for converting mesh description with skin weights to/from dynamic mesh and topological editing of dynamic meshes, with skin weights that properly handle weight distribution under split/collapse.
#jira UE-93689
#rb jimmy.andrews, david.hill
#preflight 6092079559592e00013e4aed
#rnx

[CL 16202781 by halfdan ingvarsson in ue5-main branch]
2021-05-04 23:49:23 -04:00
Charles deRousiers
54f08b8634 Remove FHairStrandsData from serialized data
#rb none
#jira FROST-1292

[CL 16112828 by Charles deRousiers in ue5-main branch]
2021-04-26 07:11:49 -04:00
Charles deRousiers
59b65e5e8e Remove data from cards groom asset. Only cards bulk data are left.
#rb none
#jira none

[CL 16112238 by Charles deRousiers in ue5-main branch]
2021-04-26 03:00:23 -04:00
semion piskarev
97050f450a MeshModelingTools: Various fixes to make volumes work better with our tools. Specifically:
- Changed triangulation of volume polygons to Delaunay to avoid degenerate tris when possible.
- Added ability to set degenerate tri normals to neighbor normal to avoid creating nonplanar volume polygons if degenerate tris do appear.
- Created a path to use FPolys instead of bsp nodes to convert from volumes, as nodes get broken up arbitrarily.
- Gave volume conversion the ability to preserve group boundary edges.
- Changed PlanarFlipsOptimization to correctly deal with degenerate tris, and to respect group boundaries.
- Added legacy cleanup code that Ryan ported to make volume faces convex.
- Changed our version of the convexity code to avoid arbitrary precision cutoff, and to remove one of the places we were arbitrarily throwing away colinear verts.
- Changed on-the-fly conversion options to not try to fill cracks, as this seems to worsen any problems further.

#rb Jimmy.Andrews, Ryan.Schmidt
#lockdown simon.tourangeau
#rnx
#jira UE-107140

#ROBOMERGE-OWNER: semion.piskarev
#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 15953732 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15971476 by semion piskarev in ue5-main branch]
2021-04-10 10:00:12 -04:00
halfdan ingvarsson
5cf1ea9c9f Fixed a shadowing variable error with clang on Windows.
#fyi ryan.schmidt
#trivial
#rnx

[CL 15888681 by halfdan ingvarsson in ue5-main branch]
2021-04-01 09:38:37 -04:00