Commit Graph

16 Commits

Author SHA1 Message Date
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
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
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
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
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
Ryan Schmidt
196be0f6d1 GeometryProcessing: replace UE::Geometry::FVector3d/FVector3f with UE Core versions based on TVector<T>. FVector3<T> is now an extension of TVector<T>. Update all affected call sites.
#rb none
#rnx
#jira none

[CL 15870068 by Ryan Schmidt in ue5-main branch]
2021-03-30 21:25:22 -04:00
lonnie li
e4b41a3d8c ModelingTools: ToolTarget refactor for Sculpt tools
#rb semion.piskarev ryan.schmidt
#jira none
#rnx

[CL 15741814 by lonnie li in ue5-main branch]
2021-03-18 17:20:32 -04:00
Ryan Schmidt
1fbab38b2c GeometryProcessing: refactor FVector2 member functions to UE::Geometry:: namespace functions
#rb none
#rnx
#jira none

[CL 15735468 by Ryan Schmidt in ue5-main branch]
2021-03-18 02:31:40 -04:00
Ryan Schmidt
6db97af132 GeometryProcessing: FVector2/3/4 refactoring. Move various member functions to standalone functions in UE::Geometry:: namespace, to simplify upcoming conversion to core vector types. Update all call sites.
#rb tyson.brochu, semion.piskarev
#rnx
#jira none

[CL 15732208 by Ryan Schmidt in ue5-main branch]
2021-03-17 19:32:44 -04:00
Ryan Schmidt
ffe3b401cd GeometryProcessing: move all public types in GeometryProcessing plugin into UE::Geometry:: namespace, as well as some code in MeshModelingToolset. Fix fallout in Water, Paint Mode, ChaosEditor, DataPrep, Text3D, Unit Tests, internal projects.
#rb jimmy.andrews, semion.piskarev
#jira none

[CL 15661651 by Ryan Schmidt in ue5-main branch]
2021-03-09 19:33:56 -04:00
ryan schmidt
1cf7f428cd ModelingMode: add ability to restrict VertexSculpt brush to a single mesh connected-component, or a single polygroup. Expose backface-hits option in GroupPaintTool.
#rb none
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 15575728 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15575757 by ryan schmidt in ue5-main branch]
2021-03-02 19:23:29 -04:00
ryan schmidt
47311d8f7e ModelingTools UX: change tool names so that label now visible in the main viewport corresponds to icon name. Update accept/cancel/complete tooltips and button styles.
#rb none
#rnx
#jira none

#ROBOMERGE-OWNER: ryan.schmidt
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 15348621 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15360215 by ryan schmidt in ue5-main branch]
2021-02-08 17:02:09 -04:00
Ryan Schmidt
fc84f89842 ModelingTools:
Add support for brush alphas to VertexSculptTool. Replace cycle counter instrumentation with insights tags. Perf optimizations for normals computation, additional async refactoring.
MeshSculptToolBase now allows subclasses to override final commit behavior, added support for variable stamp spacing and flow rate, expose various other internal functions to subclasses. Update various brush implementations for new stamp system.
Add support for custom brush stamp Alpha function to FSculptBrushStamp
Add FMeshSculptBrushOp::::SupportsVariableSpacing(), brush stamp impls use this to indicate that they support custom Alphas. Implement support in various Sculpt brushes.
Add various functions to recompute normals for a triangle region to UE::SculptUtil
FMeshVertexChangeBuilder now supports only updating vertex color.
#rb none
#rnx
#jira none

[CL 15267008 by Ryan Schmidt in ue5-main branch]
2021-01-31 20:16:41 -04:00
Ryan Schmidt
f9b571c8cf ModelingToolset: add PolyLassoMarqueeMechanic, which implements freehand and multi-click 2D polygon drawing interaction. Add this as an optional input modality to UMeshGroupPaintTool. Add support for hiding brush indicator to MeshSculptToolBase and BrushStampIndicator
#rb david.hill
#rnx
#jira none

[CL 14932178 by Ryan Schmidt in ue5-main branch]
2020-12-15 12:58:13 -04:00
Ryan Schmidt
2a8984fe77 MeshModelingToolset
- add support for VertexColor shader mode in EMeshEditingMaterialModes, handle in sculpt tools
- MeshSculptToolBase: add ability to hide view and brushop properties, add ability to show surface or volumetric indicator, add tracking of last-hit triangle ID
- add UPolygroupLayersProperties, standard property set for listing and picking from available Polygroup layers for a mesh
- add MeshGroupPaintTool, uses above extensions to allow for painting per-triangle integer polygroups
#rb none
#rnx
#jira none

[CL 14861461 by Ryan Schmidt in ue5-main branch]
2020-12-04 19:51:25 -04:00