Commit Graph

20 Commits

Author SHA1 Message Date
Jamie Dale
08b036dc97 Remove redundant include
#rb Brooke.Hubert
#rnx

[CL 14828930 by Jamie Dale in ue5-main branch]
2020-12-01 12:46:54 -04:00
Jamie Dale
ca08dfb897 Removed GLevelEditorModeTools use from typed element interface implementations
#rb Brooke.Hubert
#rnx

[CL 14828542 by Jamie Dale in ue5-main branch]
2020-12-01 12:05:35 -04:00
Jamie Dale
5e11829221 Fixed incorrect interface signature
#rb none
#rnx

[CL 14818390 by Jamie Dale in ue5-main branch]
2020-11-28 14:50:45 -04:00
Jamie Dale
d43516f6bc Fixed valid selection changes failing to transact for undo/redo
#rb none
#rnx

[CL 14817263 by Jamie Dale in ue5-main branch]
2020-11-27 10:36:37 -04:00
Jamie Dale
cf9fcc3e71 Implemented initial support for element based viewport interaction
There are two parts to this:
 - UTypedElementWorldInterface, which provides the lower-level access to things like element transforms.
 - UTypedElementViewportInteraction, which provides the higher-level access for things like gizmo manipulation.
   - The default implementation is implemented purely in terms of get/set transform via UTypedElementWorldInterface.
   - The level editor overrides this to continue to go through the current code path for gizmo manipulation.

#rb Brooke.Hubert

[CL 14813510 by Jamie Dale in ue5-main branch]
2020-11-25 14:31:59 -04:00
Jamie Dale
2771f192b1 Added utils for getting the existence/count of the number of elements/objects within a element list and selection set
#rb Lauren.Barnes
#rnx

[CL 14793994 by Jamie Dale in ue5-main branch]
2020-11-19 21:42:20 -04:00
Jamie Dale
fe22bc2cbd Allow the UObject utils for element selection to be used with element lists as well as the wrapper selection set
#rb Brooke.Hubert
#rnx

[CL 14779934 by Jamie Dale in ue5-main branch]
2020-11-18 14:27:25 -04:00
Jamie Dale
bbb6877579 Added functions to enumerate selected objects from the typed element selection set
Moved the typed element list to also use enumeration functions for consistency

#fyi Lauren.Barnes
#rb Chris.Gagnon

[CL 14758753 by Jamie Dale in ue5-main branch]
2020-11-16 17:19:10 -04:00
Jamie Dale
6dc9d4f940 Formalized the process for creating higher-level element interfaces that can be customized by specific asset editors
This takes the framework used for UTypedElementSelectionSet and moves to it a utility base class that other higher-level interfaces can also make use of.

This also changes the interface implementations for these systems to be non-UObject types, as the script exposure is handled by the owner object, and this can solve some cyclic parsing issues with UHT (eg, between UnrealEd and LevelEditor).

#rb Chris.Gagnon, Brooke.Hubert
#rnx

[CL 14704895 by Jamie Dale in ue5-main branch]
2020-11-10 14:12:52 -04:00
Jamie Dale
d2615616d3 Fixed assert when UTypedElementSelectionSet was queried for object references
#jira UE-102138, UE-102094
#rb Lauren.Barnes
#rnx

[CL 14603694 by Jamie Dale in ue5-main branch]
2020-10-28 16:49:35 -04:00
Jamie Dale
ff7d47fbf4 Made typed element includes more consistent
- Moved all the "framework" code under "Elements/Framework".
 - Moved all the "interface" code under "Elements/Interfaces".

This lets the code be split over multiple modules (including the Engine and Editor) while retaining consistent include paths with things like "Elements/Actor", "Elements/Component", etc, as well as letting new interfaces and frameworky things be added outside of the core typed element modules while still maintaining a coherent include scheme.

#fyi Brooke.Hubert
#rb Chris.Gagnon

[CL 14585700 by Jamie Dale in ue5-main branch]
2020-10-27 07:00:04 -04:00
Jamie Dale
db7459f98e Migrated undo/redo support from USelection to UTypedElementSelectionSet
This adds some new functions to UTypedElementSelectionInterface to deal with writing the underlying data needed by an element (WriteTransactedElement) to factory it again later (ReadTransactedElement) when restoring a prior selection state.

#rb Chris.Gagnon

[CL 14585511 by Jamie Dale in ue5-main branch]
2020-10-27 05:49:47 -04:00
Jamie Dale
e3ac0f1b0f Updated USelection to be a legacy shim around a UTypedElementSelectionSet
This change removes the original UObject-array based USelection implementation that was still being used for generic UObject selection, in favor of always using a UTypedElementSelectionSet to back the USelection.

 - Added an "Object" element type, so that generic objects can be stored in a UTypedElementSelectionSet.
 - Added UEngineElementsLibrary to manage the creation and destruction of "Object" elements, as CoreUObject cannot directly use the TypedElementFramework.
   - Also migrated "Actor" and "Component" element creation and destruction to UEngineElementsLibrary for consistency.
 - Fixed a race condition in the AcquireEditorXElementHandle functions due to the TTypedElementOwnerStore lock being released between the find and the add (see TTypedElementOwnerStore::FindOrRegisterElementOwner).
 - Moved the GetObject function onto a new UTypedElementObjectInterface, as that function will likely be needed by legacy code outside of selection.
 - Removed UTypedElementSelectionSet::GetMutableElementList in favor of selectively exposing certain functions from the underlying UTypedElementList, which should avoid potential abuse or misuse of the underlying list.

#rb Brooke.Hubert
#rnx

[CL 14535062 by Jamie Dale in ue5-main branch]
2020-10-21 12:09:05 -04:00
Jamie Dale
64b075c319 First phase of converting Level Editor viewport selection to use typed elements
This phase focuses on the minimum set of changes needed to port the UnrealEd logic for handling the selection of actors and components within the Level Editor viewport to use typed element interfaces. There is still future work to be done to clean this up further.

This change adds a new framework type, UTypedElementSelectionSet, which manages the concept of "selection" for typed elements. Internally this owns its own UTypedElementList, and ensures that mutation of that list goes via the UTypedElementSelectionInterface implementations.

To allow specific asset editors to customize their selection behavior, UTypedElementSelectionSet may have "selection proxies" that implement UTypedElementAssetEditorSelectionProxy registered to it. This is what's used to allow the level editor to implement its type specific rules.

The core Level Editor selection implementation for actors and components now lives inside UActorElementLevelEditorSelectionProxy and UComponentElementLevelEditorSelectionProxy, and the existing UUnrealEdEngine functions that used to deal with this logic now proxy through to those implementations via UTypedElementSelectionSet. This means that the implementation has moved into the LevelEditor module without UnrealEd even knowing.

Future work will focus on:
 - Cleaning up the legacy USelection bridge, so that all USelection instances are just a proxy around a UTypedElementSelectionSet.
   - This will involve making a basic "Object" element type to handle the generic UObject based selection (for assets) that USelection also handles.
   - This should allow GetMutableElementList to be removed from UTypedElementSelectionSet, to avoid potential abuse or misuse.
 - Investigating the best way to integrate element based selection into the editor modes.

#rb Chris.Gagnon, Brooke.Hubert
#rnx

[CL 14470181 by Jamie Dale in ue5-main branch]
2020-10-11 12:40:44 -04:00
brooke hubert
e85ae49f14 The EditorToolsContext is now owned by the mode manager.
Updated Mesh Paint, geometry, arch gen, hair lab, and sample editor modes to reflect changes to the tools context ownership.

#Jira UE-96448
#rb lauren.barnes michael.daum
#fyi ryan.schmidt simon.barsky jack.greasley
#review-14189762
#review-14189796
#review-14189767
#review-14189774
#review-14189785

[CL 14247116 by brooke hubert in ue5-main branch]
2020-09-02 15:43:58 -04:00
jimmy smith
37e87fe289 Fix for nounity errors
#fyi brooke.hubert

[CL 14225929 by jimmy smith in ue5-main branch]
2020-08-31 23:09:18 -04:00
brooke hubert
71fab51246 Remove EditorSubsystem from EditorFramework build dependencies.
#rnx
#Jira UE-96448
#rb louise.rasmussen

[CL 14116568 by brooke hubert in ue5-main branch]
2020-08-14 15:23:25 -04:00
brooke hubert
db1865135e Move Viewport Tab content and Editor Layout to EditorFramework.
#rnx
#Jira UE-96448
#rb chris.gagnon

[CL 14113508 by brooke hubert in ue5-main branch]
2020-08-14 10:43:13 -04:00
brooke hubert
b25777d3f1 Move Toolkit Manager to EditorFramework module.
#rnx
#Jira UE-96448
#rb jamie.dale lauren.barnes

[CL 14095882 by brooke hubert in ue5-main branch]
2020-08-12 17:44:00 -04:00
brooke hubert
9fa4bf0f27 Move FEditorModeInfo and shared mode defines to EditorFramework module.
#rnx
#Jira UE-96448
#review-14071452
#rb jamie.dale lauren.barnes

[CL 14084099 by brooke hubert in ue5-main branch]
2020-08-11 16:46:17 -04:00