156 Commits

Author SHA1 Message Date
Jimmy Andrews
15f97ab5e5 Make the Modeling Tools Rounded Rectangle primitive preserve its Width/Depth by default as the Corner Radius changes. Add an option to enable the old behavior, where the Corner Radius extends beyond the Width/Depth.
#jira UE-191353
#rb rinat.abdrashitov

[CL 26790316 by Jimmy Andrews in 5.3 branch]
2023-08-02 18:16:03 -04:00
matija kecman
77a219bd26 Add a reusable geometry selection visualization system intended to be used in modeling tools with minimal boilerplate
This CL was reviewed here: https://p4-swarm.epicgames.net/reviews/26051575 but needs to be merged into //Fortnite/Release-26.00, not //Fortnite/Main

#jira UE-183457
#rb ryan.schmidt, nathan.mitchell

[CL 26180612 by matija kecman in 5.3 branch]
2023-06-22 09:26:09 -04:00
ryan schmidt
8d4f038af9 ModelingMode: selection system bugfixes & improvements.
Add DynamicMeshSelector::UpdateAfterGeometryEdit API. StaticMeshSelector implementation updates static mesh after an Edit instead of emitting MeshChange on temporary DynamicMesh.
Delete and Retriangulate Commands now use this API instead of directly emitting transaction, so now these commands work properly on Static Meshes.

FStaticMeshComponentSelectorFactory::CanBuildForTarget now only allows UStaticMeshComponent specifically, filtering out subclasses. This is not ideal but I don't know what else we can do for now, there are many subclasses like ISMC, SplineMeshComponent, etc, that will not work w/ the Selection system. Also now filtering out Engine assets and cooked assets.

ModelingToolsEditorMode now listens for blueprint pre-compiles, and when this occurs, clears the active selection and selection targets. This is necessary because if the selection Component was part of a BP, on recompile it is re-instanced and the old pointer goes stale. Possibly can handle this better or at a more granular level, but clearing the selection is safest. This currently results in things not being undoable because the FChange transactions are on the "old" UDynamicMesh that no longer exists.

UModelingToolsEditorMode::UpdateSelectionManagerOnEditorSelectionChange now does a more thorough job of inspecting the current Actor/Component selection to find Components that could work w/ the selection system.

#rb lonnie.li

[CL 26133442 by ryan schmidt in 5.3 branch]
2023-06-20 16:31:27 -04:00
semion piskarev
8f0627147d MeshModelingTools: Subdivide tool improvements dealing with meshes with open boundaries.
- Factor out "extra corner" finding code from PolyEd and add support for it in subdivide tool.
- Add support for rounded corners for mesh boundaries.
- Override subdivision scheme during tool usage rather than just at tool start, to allow extra corners to fix some issues.
- Add some clarifying comments about schemes.

#rb Jimmy.Andrews
#jira UE-185416

[CL 26036654 by semion piskarev in 5.3 branch]
2023-06-16 01:47:18 -04:00
jimmy andrews
91e21c2731 Make a larger UI range for height offset in revolve properties
#rb trivial
#preflight skip

[CL 25433716 by jimmy andrews in ue5-main branch]
2023-05-11 15:27:54 -04:00
semion piskarev
ae954c009b MeshModelingTools: Fix Nan warning in PolyExt.
#rb Jimmy.Andrews
#jira UE-182246
#preflight 644870f309453df548f604b7

[CL 25206921 by semion piskarev in ue5-main branch]
2023-04-26 16:56:54 -04:00
semion piskarev
209ed7fd71 MeshModelingTools: Fix incorrect UVs in Push/Pull activity in PolyEd.
#rb Ryan.Schmidt
#jira UE-182078
#preflight 642da40bc6769c6082eaa379

[CL 24938793 by semion piskarev in ue5-main branch]
2023-04-05 18:48:05 -04:00
jimmy andrews
86467b259c fix compile error from bad merge in UVProjectionTool.h
#rb trivial
#preflight skip

[CL 24508051 by jimmy andrews in ue5-main branch]
2023-03-03 17:10:17 -05:00
jimmy andrews
cebb9b8683 InteractiveToolsFramework: Adds new helper methods to determine count ActorComponents that match TargetRequirements and an additional test predicate for specialized scenarios. Additionally adds a couple of helper methods to test for Volume components and component classes that support UVs. This is to fix the issues surrounding the UV modeling tools that shouldn't be viable for Volume type targets.
#rb Jimmy.Andrews
#preflight 63fe5fa6dd78dd50f61b619a

#tests Local testing with UEFN build 24438442.

#ushell-cherrypick of 23533564 by nathan.mitchell

[CL 24508032 by jimmy andrews in ue5-main branch]
2023-03-03 17:09:53 -05:00
jimmy andrews
f63cdc13af Update FLocalPlanarSimplify to support simplification along straight creases in a mesh, where the sides of the crease may optionally belong to different PolyGroups
Add an edge simplification operation to the PolyEdit tool

#rb semion.piskarev
#preflight 63ee9a0f3c1eb56f055442ac

[CL 24276322 by jimmy andrews in ue5-main branch]
2023-02-16 21:55:32 -05:00
jimmy andrews
0188b696c0 Add a general-use version of the 'simplify along edges' logic from FMeshBoolean, and use it to simplify plane cuts and edge insertions
+ Update the plane cut logic to allow it to use the simplify function

#rb david.hill
#preflight 63e516ea1d3284fefe72c97a

[CL 24107250 by jimmy andrews in ue5-main branch]
2023-02-09 16:49:32 -05:00
ryan schmidt
af5699f133 ModelingTools: improve handling of invalid input selections to PolyEd Tool
Add UGeometrySelectionManager::GetActiveSelectionInfo, returns info about current selection w/o having to copy selection
Override UEditMeshPolygonsActionModeToolBuilder::CanBuildTool, use this new function to do specific per-action filtering to limit to supported input selection types
UEditMeshPolygonsSelectionModeToolBuilder::InitializeNewTool() now filters UI panels for current input selection if available, update Selection-palette PolyEd button to use this builder instead
#jira UE-176168
#preflight 63e2c886c2257e56f413b805
#rb david.hill

[CL 24068438 by ryan schmidt in ue5-main branch]
2023-02-08 01:21:37 -05:00
semion piskarev
6a7be69e26 MeshModelingTools: unbind the "toggle gizmo" action in some tools from a default hotkey to prevent users from accidentally pressing it and thinking that the tools are broken. Users can still set their own hotkey if their workflow benefits from it.
#rb Jimmy.Andrews
#jira UE-176343
#preflight 63e2a16e1020773a3f3e3e56

[CL 24062599 by semion piskarev in ue5-main branch]
2023-02-07 18:29:11 -05:00
rinat abdrashitov
58f927b238 Fixed a bug where the trim tool starts a potentially expensive boolean calculation when only the opacity color alpha changes.
#rb jimmy.andrews
#jira UE-141515
#preflight 63e11f8e5c0ce8f11bb6d667

[CL 24034079 by rinat abdrashitov in ue5-main branch]
2023-02-06 13:30:15 -05:00
tyson brochu
88ddd892f0 Mesh Modeling / UV Projection Tool: allow the user to change the Initialization mode and have it affect the current instance of the tool, as long as they do it before modifying the transform
#jira UE-171332
#rb ryan.schmidt
#lockdown aurel.cordonnier
#preflight 63dd83db14326f9a404790d1

[CL 24009720 by tyson brochu in ue5-main branch]
2023-02-04 00:32:56 -05:00
semion piskarev
be1e6fbac3 Fix capitalization of PolyGroup in some rare user-visible places.
#rb Jimmy.Andrews
#preflight 63dae05e3f006aee11b04b19

[CL 24004176 by semion piskarev in ue5-main branch]
2023-02-03 20:53:04 -05:00
semion piskarev
c0169a8175 MeshModelingTools: Fix ensure being fired when exiting group edge activity with an edge started.
#rb Nathan.Mitchell
#jira UE-174502
#preflight 63d9a9aab73528c8f74e682c

[CL 23984032 by semion piskarev in ue5-main branch]
2023-02-02 18:42:20 -05:00
semion piskarev
cdc790969d MeshModelingTools: Fix crash in Merge tool when mesh uses a material ID that is not in its material list.
#rb Jimmy.Andrews
#jira UE-174927
#preflight 63da82dbd21dbe1d29390f3f

[CL 23961046 by semion piskarev in ue5-main branch]
2023-02-01 19:27:27 -05:00
semion piskarev
3f3dd55c2e MeshModelingTools: Fix undo in PolyEd group edge "continuous insertion" mode.
#rb Jimmy.Andrews
#jira none
#preflight 63d3e829ba4fadeef0014779

[CL 23907566 by semion piskarev in ue5-main branch]
2023-01-30 10:28:33 -05:00
semion piskarev
16b08005f7 MeshModelingTools: Fix PolyEd group edge insertion crashing if an undo transaction is received while waiting for an insertion to complete, and harden some of the state management.
#rb Tyson.Brochu, Jimmy.Andrews
#jira UE-174502
#preflight 63d3e7ba31334253e5c77aab

[CL 23889578 by semion piskarev in ue5-main branch]
2023-01-27 14:53:43 -05:00
semion piskarev
f18d6198cc MeshModelingTools: Add gizmo numerical UI.
- Added FTransformGizmoDataBinder which allows for gizmos to be bound to vectors such that the vectors are updated when the gizmo changes, and the gizmo is updated from vectors when asked. This should make it easy-ish to create displays of gizmos.
- Used the data binder in STransformGizmoNumericalUIOverlay, an overlay containing a draggable numerical UI panel for gizmos. Note that currently all changes, including typing, intentionally go down a gizmo drag path, meaning that they trigger the begin/end transform edit sequence calls, to make the tools treat them as a gizmo drag (in part because some tools might otherwise assume that a gizmo update is from an undo transaction or some other path that is special-cased).
- Added some slate things to ModelingEditorUI to support the numerical UI, in particular a viewport draggable box, and a widget that emits a tick delegate.
- Added some delegates to gizmo context object and combined transform gizmos to allow things to bind/unbind to/from them appropriately.

#rb Ryan.Schmidt
#preflight 63ce97ebf2318350a2f3a6c4

[CL 23815889 by semion piskarev in ue5-main branch]
2023-01-23 12:48:47 -05:00
ryan schmidt
227ac3d087 ModelingTools: Add OffsetMeshSelectionTool and RetriangulateGeometrySelectionCommand
#preflight 63cb1d78574ab9cae448312c
#rb none

[CL 23803436 by ryan schmidt in ue5-main branch]
2023-01-21 13:02:53 -05:00
ryan schmidt
70ac55822d ModelingMode: improve interop with new Selection System and existing Tools
Add support for Tools to provide an "output" selection. Add UGeometrySelectionManager::SetSelectionForComponent() which can set an explicit externally-provided selection. FBaseDynamicMeshSelector::UpdateSelectionFromSelection() now supports selection conversion when available and requested (is used to implement SetSelectionForComponent). New GeometrySelectionUtil functions InitializeSelectionFromTriangles() and ConvertSelection() are used to implement this (note: only Triangles->other conversion is currently supported). Add HaveAvailableGeometrySelection() and SetToolOutputGeometrySelectionForTarget() in StoredMeshSelectionUtil.h, this is the top-level function that Tools can use to set an Output selection.

ExtrudeMeshSelectionTool now emits output selection.

Update EditMeshPolygonsTool to use new Selection system and allow individual operations to be utilized as standalone Tools. Convert EditMeshPolygonsTool to be a USingleTargetWithSelectionTool, use FGeometrySelection to initialize selection. Add bTerminateOnPendingActionComplete flag, which is set when Tool is directly initialized to a specific operation, and forces tool to shut down when operation completes. This allows it to be used to more cleanly implement multiple action buttons in Modeling UI. When in this mode, selection panels are not shown. On Shutdown, now emits an "output" selection which GeometrySelectionManager can use to provide new selection to user. Update UPolygonSelectionMechanic Set/Get selection APIs to use FGeometrySelection instead of UPersistentMeshSelection.

port UVProjectionTool to derive from USingleTargetWithSelectionTool, use FGeometrySelection to initialize target ROI

deprecate UPersistentMeshSelection and related functions in StoredMeshSelectionUtil.h. Deprecate Tool Input Selection APIs in USingleSelectionMeshEditingTool and Builder.

Repurpose old ModelingMode-level PolyModel tab operations for new Selection Tools UI, now support Inset, Outset, Cut Faces, Insert Edge Loop, PushPull, and Bevel.

#rb none
#preflight 63c84fa2b065224750b9831f

[CL 23766643 by ryan schmidt in ue5-main branch]
2023-01-18 17:59:31 -05:00
ryan schmidt
46630c002f ModelingMode: Selection system improvements. Add Disconnect command and various new Selection-Edit Commands
Add UInteractiveCommandResult, UInteractiveCommand::ExecuteCommand() now optionally can return a result subclass
Add UGeometrySelectionEditCommandResult, UGeometrySelectionEditCommand now can optionally return an "output" selection via this type
UGeometrySelectionManager::ExecuteSelectionCommand optionally can restore a selection after a command, via UGeometrySelectionEditCommandResult

Add UDisconnectGeometrySelectionCommand, implements disconnection of selected triangles (ie separates but not into a new mesh)
Add UModifyGeometrySelectionCommand, implements various selection edits (select all, expand to connected, invert, invert connected, expand, contract)
Add IGeometrySelector::InitializeSelectionFromPredicate() and ::UpdateSelectionFromSelection(), implement in UDynamicMeshSelector, used to implement selection edit commands
Add UI to enable new commands in Modeling Mode

#rb none
#preflight 63c047f4305002c64170f6a2

[CL 23667880 by ryan schmidt in ue5-main branch]
2023-01-12 14:52:52 -05:00
Nickolas Drake
33700c92e8 Modeling Mode Tools: Remove exponential behavior from unbounded sliders in various tools.
Added UI/Clamp meta tags where appropriate to implicitly remove the exponential behavior and added Delta/LinearDeltaSensitivity tags when values shouldn't be bounded but don't necessarily depend on the scale of the working mesh.

In the case of values that shouldn't be bounded and do change depending on the mesh scale, the exponential behavior remains.

#jira none
#rb ryan.schmidt
#preflight 639a3cc3776b61ba3bbf0f9f

[CL 23538292 by Nickolas Drake in ue5-main branch]
2022-12-16 11:11:57 -05:00