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]
Selection enable/disable can now be toggled dynamically via mode settings popup, toolbar will hide/show based on current setting state.
GeometrySelectionManager is now always created. New Mode function GetMeshElementSelectionSystemEnabled() indicates whether selection is currently enabled, when disabled active targets will not be tracked.
Selection Toolbar icons now are disabled while in a Tool (as selection system is not active then)
New Static Mesh Assets and Volumes created using Modeling Tools now default to unlocked, via new functions on StaticMeshSelector / Volume Selector.
Unlocked Asset/Volume sets are cleared on level change
Added cvars modeling.Selection.EnableStaticMeshLocking and modeling.Selection.EnableVolumeLocking which can be used to fully disable lock-ability of StaticMesh/Volume (default true)
shortened some names of tool group tabs, as labels are now shown and long names make the bar wider
Added a few toast notifications for when setting state changes require a mode or editor restart.
#rb none
#preflight 64426fabb14f1faacff6921d
[CL 25149511 by ryan schmidt in ue5-main branch]
Add IGeometrySelectionTransformer::PreviewRender() API, for rendering info during selection transforms. Currently being called by UGeometrySelectionManager::DebugRender() for active transforms.
FBasicDynamicMeshSelectionTransformer implements PreviewRender, draws selected mesh edges (tris as edges) and vertices, as well as affected edge ROI.
FDynamicMeshPolygroupTransformer overrides this behavior and draws polygroup edges/verts and edge ROI
FStaticMeshSelector and FVolumeSelector now create FDynamicMeshPolygroupTransformer for polygroup selections
FBasicDynamicMeshSelectionTransformer::bEnableSelectionTransformDrawing flag controls whether this edge drawing is enabled. Disabled on DynamicMeshComponent, enabled on StaticMesh and Volume.
Add Normals recomputation during tri and polygroup transforms in FBasicDynamicMeshSelectionTransformer and FDynamicMeshPolygroupTransformer
Add FGroupTopologyDeformer::EnumerateROIEdges() util function to support above
#rb none
#preflight 641cd27bc44ce895fc62f724
[CL 24780655 by ryan schmidt in ue5-main branch]
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]
Add IGeometrySelector::UpdateSelectionViaShape() API, takes a FConvexHull to use as selection shape. Implement in DynamicMeshSelector.
Add UGeometrySelectionManager::UpdateSelectionViaConvex() API, calls above
ModelingToolsEditorMode now implements ILegacyEdModeSelectInterface, ::FrustumSelect() implementation calls above w/ frustum convex hull
Hide Marquee drag mode option, set default drag mode to "none"
Add save/restore of selection mode, drag mode, and volume/staticmesh toggles via UModelingToolsModeCustomizationSettings
Remove old selection toggle commands that were replaced w/ combined commands
Call DeleteSelectionCommand in UModelingToolsEditorMode::ProcessEditDelete() if there is an active selection
#preflight 63cac131fa66be4cc33661a9
#rb none
[CL 23796046 by ryan schmidt in ue5-main branch]
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]
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]
Refactor most of FDynamicMeshSelector into FDynamicMeshSelectorBase, FDynamicMeshSelector is now a subclass.
Move the DynamicMeshTransformer from cpp to FBasicDynamicMeshSelectionTransformer in header.
Add FVolumeSelector and FStaticMeshSelector which are derived from FBaseDynamicMeshSelector.
Add ability to filter selection queries/edits by TopologyID in FGeometrySelectionEditor. This is necesary for polygroup and polygroup-edge selections as their encoding includes an arbitrary TriangleID paired w/ the TopologyID.
UGeometrySelectionManager now manages this TopologyID filtering on selection editors it creates/updates
Add concept of "Tracked" selection changes to UGeometrySelectionManager, allows a single selection FChange to be constructed incrementally, eg like with a brush. Add a variant of raycast-selection-update that can be run inside a tracked change.
#rb none
#preflight 6388f0cf4b2f03a7d761ccef
[CL 23361634 by ryan schmidt in ue5-main branch]
Introduced FGeometrySelectionHitQueryConfig (GeometrySelection.h), this provides information about the active selection mode. FGeometrySelectionEditor now tracks active FGeometrySelectionHitQueryConfig.
IGeometrySelector hit-testing/processing functions now take a struct FWorldRayQueryInfo that combines a FRay3d with FViewCameraState, to allow for (eg) snapping wrt the active camera/etc
Added FGeometrySelectionPreview, this is a utility subclass of FGeometrySelectionEditor that is used for selection-preview highlighting, relative to a base FGeometrySelectionEditor
Added IGeometrySelector::GetSelectionPreviewForRaycast() which is used to accumulate a preview of what might be selected in a FGeometrySelectionPreview. AccumulateSelectionElements() can also now accumulate 'preview' geometry, and FDynamicMeshSelector uses this to provide the edge-loop of a facegroup for it's preview (as providing all triangles is too expensive for hover highlighting on hires meshes).
Added support for hover-highlighting mechanic in UGeometrySelectionManager and UModelingSelectionInteraction
FDynamicMeshSelector now creates a GroupEdgeSegmentTree for polygroup edges. This allows for better selection interaction, eg no dependency on the edge-adjacent triangles.
Added AreSelectionsIdentical() function in GeometrySelectionUtil.h
#rb none
#preflight 638145b318176c67c2785280
[CL 23300258 by ryan schmidt in ue5-main branch]
ToolsFramework:
add UInteractiveCommand and UInteractiveCommandArguments types, base classes for 'interactive commands' which are intended to be used for atomic actions, ie stateless, no user interaction, etc
ModelingComponents:
add UGeometrySelectionEditCommand/Arguments, this is a UInteractiveCommand that uses a FGeometrySelection as an argument
add UGeometrySelectionManager::CanExecuteSelectionCommand() and ExecuteSelectionCommand()
MeshModelingTools:
add UDeleteGeometrySelectionCommand, deletes selected mesh geometry by converting input selection to list of triangles
ModelingToolsEditorMode:
add Delete command to ModelingMode and UI. ModelingToolsEditorMode currently is keeping active command set alive via new UModelingToolsEditorMode::ModelingModeCommands member.
#rb none
#preflight 62d195b9a66919b6701d89a8
[CL 21113757 by Ryan Schmidt in ue5-main branch]
GeometrySelection.h/cpp: FGeometrySelection, FGeometrySelectionEditor, representation and manipulation of a generic element-level selection, stored as a set of uint64. Editor makes changes to Selection while tracking deltas.
GeometrySelectionUtil.h/cpp: utility and helper functions for editing/processing a mesh+selection
GeometrySelector.h: FGeometryIdentifier type used to identify target objects with element-level selection support. IGeometrySelector interface that defines API for element selection for a type of target object. Factory type for spawing instances. IGeometrySelectionTransformer interface that defines API for element-level transformation
GeometrySelectionManager.h/cpp: UGeometrySelectionManager that maintains set of 'active targets' with associated Selector, Selection, and SelectionEditor, and provides high-level API for creating and querying element selections, 3D transforms of selections, selection undo/redo, and (currently) limited debug rendering
GeometrySelectionChanges.h/cpp: FChange types for element selection changes
DynamicMeshSelector.h/cpp: implementation of IGeometrySelector for UDynamicMesh/Component
#rb jimmy.andrews
#preflight 62bdb9cbb024a2608c38b72d
[CL 20896967 by Ryan Schmidt in ue5-main branch]