Mesh Editor extensibility (phase 5)

- Split Edge, Extend Edge and Extend Vertex have been migrated to a new module
- Added support for extensible mesh commands that drag mesh elements immediately after an action
- Fixed selection undo events added with empty selection sets
- Simplified extensibility API for mesh commands that apply during a drag

#codereview richard.talbotwatkin
#rb none

[CL 3372877 by Mike Fricker in Dev-Geometry branch]
This commit is contained in:
Mike Fricker
2017-03-30 16:00:43 -04:00
parent f7f699b8a8
commit 59b7f4ede5
17 changed files with 498 additions and 454 deletions

View File

@@ -19,7 +19,7 @@ void UInsertEdgeLoopCommand::RegisterUICommand( FBindingContext* BindingContext
}
void UInsertEdgeLoopCommand::ApplyDuringDrag( IMeshEditorModeEditingContract& MeshEditorMode, UViewportInteractor* ViewportInteractor, bool& bOutShouldDeselectAllFirst, TArray<FMeshElement>& OutMeshElementsToSelect )
void UInsertEdgeLoopCommand::ApplyDuringDrag( IMeshEditorModeEditingContract& MeshEditorMode, UViewportInteractor* ViewportInteractor )
{
// Insert edge loop
static TMap< UEditableMesh*, TArray< FMeshElement > > SelectedMeshesAndEdges;
@@ -29,8 +29,10 @@ void UInsertEdgeLoopCommand::ApplyDuringDrag( IMeshEditorModeEditingContract& Me
{
// Deselect the edges first, since they'll be deleted or split up while inserting the edge loop,
// and we want them to be re-selected after undo
MeshEditorMode.DeselectMeshElements( SelectedMeshesAndEdges );
MeshEditorMode.DeselectAllMeshElements();
static TArray<FMeshElement> MeshElementsToSelect;
MeshElementsToSelect.Reset();
for( auto& MeshAndEdges : SelectedMeshesAndEdges )
{
@@ -71,8 +73,6 @@ void UInsertEdgeLoopCommand::ApplyDuringDrag( IMeshEditorModeEditingContract& Me
// Select all of the new edges that were created by inserting the loop
if( NewEdgeIDs.Num() > 0 )
{
bOutShouldDeselectAllFirst = true; // Don't keep the edge selected
for( const FEdgeID NewEdgeID : NewEdgeIDs )
{
FMeshElement MeshElementToSelect;
@@ -84,7 +84,7 @@ void UInsertEdgeLoopCommand::ApplyDuringDrag( IMeshEditorModeEditingContract& Me
}
// Queue selection of this new element. We don't want it to be part of the current action.
OutMeshElementsToSelect.Add( MeshElementToSelect );
MeshElementsToSelect.Add( MeshElementToSelect );
}
}
}
@@ -92,6 +92,8 @@ void UInsertEdgeLoopCommand::ApplyDuringDrag( IMeshEditorModeEditingContract& Me
MeshEditorMode.TrackUndo( EditableMesh, EditableMesh->MakeUndo() );
}
}
MeshEditorMode.SelectMeshElements( MeshElementsToSelect );
}
}