SActorDetails now operates on a given UTypedElementSelectionSet (removing its dependence on the global selection), and also operates based on the list of selected top-level elements rather than the selected actors.
UTypedElementDetailsInterface provides the interface needed for an element to be used with the details panel, with ITypedElementDetailsObject being the underlying glue object.
The ITypedElementDetailsObject instance will exist as long as the details panel is using it, so gives a lifetime to potentially synthesized UObject instances that are created purely for editing (eg, on instances).
This change removes almost all direct use of UpdateFloatingPropertyWindowsFromActorList, with only a single use-case in the reference viewer remaining.
Most code was already using UpdateFloatingPropertyWindows anyway, which now emits an extra OnElementSelectionChanged event in addition to its previous OnActorSelectionChanged event.
UpdateFloatingPropertyWindowsFromActorList now only emits an OnOverridePropertyEditorSelection event and no longer emits an OnActorSelectionChanged event.
SActorDetails is updated from both OnElementSelectionChanged and OnOverridePropertyEditorSelection, with the OnActorSelectionChanged event remaining for backwards compatability with existing code.
#jira
#rb Chris.Gagnon, Brooke.Hubert
[CL 15037524 by Jamie Dale in ue5-main branch]
This is equivalent to calling ClearSelection then SelectElements, but happens in a single batch.
#rb Brooke.Hubert
[CL 14891193 by Jamie Dale in ue5-main branch]
# FActorFactoryAssetProxy uses the placement subsystem first to try to place a new actor.
# Existing UActorFactory implementations added to the subsystem and hooked up to the placement API
#Jira UE-98159
#Jira UE-98161
#review-14836149
#rb chris.gagnon jamie.dale
[CL 14847312 by brooke hubert in ue5-main branch]
This involved splitting and converting several UUnrealEdEngine functions to no longer operate on or manipulate the current selection set:
- edactCopySelected:
- Split into CopyComponents and CopyActors, which take an array of components and actors to copy rather than use the selection state.
- Breaking: If a DestinationData is provided, it is now used *instead of* the clipboard rather than *as well as* the clipboard.
- In practice nothing seemed to rely on this old method, and in fact some places stashed and restored the clipboard data to workaround it!
- edactPasteSelected:
- Split into PasteComponents and PasteActors, which now returns an array of components or actors that were pasted rather than make them the active selection.
- Note: PasteActors does still update the selection via FactoryCreateText, but we restore it again afterwards.
- edactDuplicateSelected:
- Split into DuplicateComponents and DuplicateActors, which take an array of components or actors to duplicate, and also returns an array of components or actors that were created.
The "edact" versions still use and update the selection state when calling into the internal functions, but the typed element layer does not, and handles duplication via UEngineElementsLibrary::DuplicateElements and UTypedElementWorldInterface, with the level editor viewport handling updating the selection state afterwards.
#rb Brooke.Hubert, Chris.Gagnon
[CL 14838341 by Jamie Dale in ue5-main branch]
The following options from the actor viewport menu are now elemenent based:
- Snap/Align (excluding layers)
- Delta Transform
- Mirror X/Y/Z
#rb Brooke.Hubert
[CL 14830849 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]
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]
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 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]
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]
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]