These existed as an optimization for USelection to quickly know if an object was selected, without having to test its array. UTypedElementList has that optimization embedded, so at this point the selection annotations are just extra state to keep in-sync, and failure to do so has already lead to bugs.
This change removes them in the simplest way possible, by using a function pointer to callback into editor code from core/engine code (as core/engine cannot directly access the global selection state), though longer-term we probably want to remove IsSelected/IsSelectedInEditor from UObject and let specific systems provide that functionality if they need it (eg, AActor/UActorComponent could provide it by getting the selection set from the owner world, rather than the global state).
#rb Brooke.Hubert
#preflight 607de942e7a5ac0001a6b7d6
[CL 16075785 by Jamie Dale in ue5-main branch]
This was to optimize selecting groups, but we've handled this case elsewhere by just skipping the group logic if the group is already in the list of things that we've processed. This applies that approach to getting the elements to move.
#rb Brooke.Hubert
#ROBOMERGE-SOURCE: CL 15890607 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)
[CL 15890762 by jamie dale in ue5-main branch]
This avoids repeatedly processing each actor in a group during a select/deselect operation, as once the group itself has been selected/deselected, we have by proxy processed its grouped actors too. The only caveat to that is if a selection was previously performed with SetAllowGroups set to false (not the default), but that's advanced usage and could be resolved by toggling the group selection again.
#jira UE-110998
#rb Brooke.Hubert
#ROBOMERGE-SOURCE: CL 15813372 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)
[CL 15814438 by jamie dale in ue5-main branch]
- Moved the logic for managing the offset when pasting/duplicating out of the internal Paste/DuplicateActors implementation, and instead pass the desired offset into the duplicate functions.
- Made the function for getting the list of elements to operate on for a common action more generic, and added helper functions to delete and duplicate the current selection set.
- Added a CanDuplicateElements function to UTypedElementWorldInterface.
- Implemented duplication offset for static mesh instances.
#rb Brooke.Hubert
#ROBOMERGE-SOURCE: CL 15750144 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
[CL 15753927 by jamie dale in ue5-main branch]
Adds support for selection, gizmo manipulation, property editing, duplication, deletion, and undo/redo for Static Mesh instances within the main Level Editor, without having to enter an alternative editing mode.
Note: This is currently disabled via UE_ENABLE_SMINSTANCE_ELEMENTS
#rb Brooke.Hubert
#ROBOMERGE-SOURCE: CL 15481362 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15481376 by jamie dale in ue5-main branch]
Each group actor is now only enumerated once at the end, rather than once for each selected actor within a group
#jira UE-108343
#rb Brooke.Hubert
#ROBOMERGE-SOURCE: CL 15475127 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15475131 by jamie dale in ue5-main branch]
This lets UTypedElementSelectionSet (which has minimal dependencies) to be used by the Engine and InteractiveToolsFramework modules
#rb Brooke.Hubert
[CL 15219316 by Jamie Dale in ue5-main branch]
This avoids interfaces needing to know the direct structure of the element data, in case it were to change in the future. It also provides utils for accessing data from arrays of element handles.
#rb none
#rnx
[CL 14818377 by Jamie Dale in ue5-main branch]
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]
They may still be pending kill as the transaction is replayed, and restoring the selection state never used to re-test whether an actor could be selected, so this restores the old behavior.
#jira UE-102334
#rb Rex.Hill
#rnx
[CL 14707360 by Jamie Dale in ue5-main branch]
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]
- 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]
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]