Commit Graph

1005 Commits

Author SHA1 Message Date
Jamie Dale
dd96f734b2 Converted UTypedElementList to no longer be a UObject
Storing typed elements in UObjects can easily lead to reference leaks if the elements aren't cleared prior to the UObject being left pending GC. This actually made UTypedElementList tricky to use, as you had to remember to manually empty it when you'd finished with it to avoid reference leaks, and we've had several cases now where that was done incorrectly.

To address this issue, we've moved element lists back to being a normal C++ class, FTypedElementList. However, unlike the original version of FTypedElementList (which was itself a UStruct), this version is always heap-allocated and referenced via a TSharedPtr/TSharedRef.

This gives us a nice middle-ground of a well defined lifetime (ie, no lingering references prior to GC) while still being efficient to pass around, including for scripting APIs via FTypedElementListProxy (which just wraps the TSharedPtr in a UStruct).

The downside of this approach is that we need to wrap the FTypedElementList functions that we want to expose to the scripting API (see UTypedElementListLibrary), however that is a far more reasonable burden than requring every user of the typed element framework to know and understand that UTypedElementList had to be manually cleared to avoid potentially hard to find reference leaks (especially if via leaked via scripting APIs).

The core of this change is to TypedElementList.h/.cpp, with TypedElementListFwd.h existing to forward declare the pointer types, and TypedElementListProxy.h and TypedElementListLibrary.h existing to declare the proxy type and wrapped functions used for scripting APIs. TypedElementSelectionInterface.h (and its implementations) provide an example of using FTypedElementListProxy within a scripting API, and the rest of the change is mostly just fallout to transform const UTypedElementList* to FTypedElementListConstRef and UTypedElementList* to FTypedElementListRef.

#rb Brooke.Hubert
#preflight 60d2720c634cd100016c804b

[CL 16776547 by Jamie Dale in ue5-main branch]
2021-06-24 14:29:38 -04:00
Jamie Dale
a1a4a2a680 Also deselect child elements when an actor is destroyed during PIE
#fyi Brooke.Hubert

[CL 16771827 by Jamie Dale in ue5-main branch]
2021-06-24 09:08:23 -04:00
aurel cordonnier
d17d20ca36 Merge from Release-Engine-Test @ 16758890 to UE5/Main
This represents UE4/Main @ 16738161 and Dev-PerfTest @ 16737719 (and Release-17.00 @ 16658211)

[CL 16763350 by aurel cordonnier in ue5-main branch]
2021-06-23 17:51:32 -04:00
ben hoffman
ac4f7c652d Also check for the component archetype when updating the tree selection in SActorDetails because it is a viable option for inherited BP components on instanced objects
#jira UE-118278
#rb marc.audy
#rnx

[CL 16749051 by ben hoffman in ue5-main branch]
2021-06-22 16:55:11 -04:00
Matt Hoffman
46641bcb3f Matinee/Editor: Removed more Matinee related functions from various Editor callbacks.
#jira UE-105313
#rb Lauren.Barnes
#preflight 60cb86e195e23200018adcaa

[CL 16708876 by Matt Hoffman in ue5-main branch]
2021-06-17 14:52:13 -04:00
Jamie Dale
2c21b4c695 Provided an interface to query element parent<->child hierarchy information and used it to unify selection normalization
Previously we relied on element implementations to know what their parent or child elements might be, and to deal with them correctly in the following cases:
 1) When "normalising" a selection to be safe for operations like a move or delete, eg) removing elements that are children of other selected elements.
 2) When deleting an element, also ensuring that any implicitly destroyed child elements were deselected, eg) deleting an ISM component that has selected static mesh instances.

This approach hurts the modularity of the elements themselves, as it requires that the element implementations have intrinsic knowledge of any other child (or parent) element types that may exist, and to deal with them accordingly when needed. As a concrete example, an ISM component may have child elements in the form of static mesh instance elements, however the generic component element type does not (and should not) directly know that static mesh instance elements exist.

To address this issue, we've added a new interface, UTypedElementHierarchyInterface, which can be used to provide information about the logical parent<->child hierarchy information of elements. This is implemented as follows for our current element types:
 - Actor:
   - GetParentElement returns an invalid element handle.
   - GetChildElements returns the element handles of any components on the actor.
 - Component:
   - GetParentElement returns its owner actor element handle.
   - GetChildElements returns nothing by default, but UActorComponent::GetComponentChildElements may be overridden to control this behavior.
     - eg) UInstancedStaticMeshComponent overrides it to return its static mesh instance element handles.
 - SMInstance:
   - GetParentElement returns its owner ISM component element handle.
   - GetChildElements returns nothing.

Now the problems listed above can be solved by using this interface instead of relying on the element implementations:
 1) Selection normalization is now handled by UTypedElementSelectionSet, replacing the previous duplicate implementations of UTypedElementCommonActions and UTypedElementViewportInteraction.
 2) UTypedElementSelectionSet will now walk and also update the selection state of child elements, when asked to via the FTypedElementSelectionOptions.

Breaking Changes:
 - UTypedElementCommonActions::GetElementsForAction and UTypedElementViewportInteraction::GetSelectedElementsToMove have been removed, in favor of using the selection normalization functions of UTypedElementSelectionSet.
   - Note: You may still favor using FLevelEditorViewportClient::GetElementsToManipulate, as it will have removed normalized elements that also cannot be moved by a gizmo.
 - UTypedElementCommonActions::DeleteElements and UTypedElementCommonActions::DuplicateElements have been removed, as these functions operated on an unnormalized selection and could be unsafe. UTypedElementCommonActions::DeleteNormalizedElements and UTypedElementCommonActions::DuplicateNormalizedElements should be used instead.
 - AGroupActor::ForEachActorInGroup and AGroupActor::ForEachMovableActorInGroup now take a second AGroupActor* argument in their callback.

#rb Brooke.Hubert
#preflight 60ca33a678c3b00001e8f5df

[CL 16705229 by Jamie Dale in ue5-main branch]
2021-06-17 11:19:23 -04:00
zach rammell
4702b1a507 Add cursor world location to level editor tool menu context
#jira UE-96331
#rb brooke.hubert jamie.dale
#preflight 60ca2609be81e800015eae93

[CL 16692741 by zach rammell in ue5-main branch]
2021-06-16 14:16:49 -04:00
Matt Hoffman
82fa63ba8b Matinee/Styles: Deleted Matinee style entries from SlateEditorStyle and StarshipStyle.
#jira UE-105313
#rb Lauren.Barnes

[CL 16692495 by Matt Hoffman in ue5-main branch]
2021-06-16 14:07:58 -04:00
Matt Hoffman
4b80ff35c9 Matinee/Editor: Renamed usages of the word 'Matinee' to 'Cinematics' where applicable in code comments.
#jira UE-105313
#rb Trivial

[CL 16691805 by Matt Hoffman in ue5-main branch]
2021-06-16 13:43:34 -04:00
ben hoffman
3c2dbac8c6 Fixed actor details not showing the properties of the root componenent if selected.
Updated the logic in SActorDetails::RefreshSubobjectTreeElements to match the logic in  SActorDetails::OnSubobjectEditorTreeViewSelectionChanged when deciding whether a component or actor is selected
#fyi jamie.dale
#jira none
#rb trivial
#preflight 60c2bbb1b1a4a3000131e17a

[CL 16635419 by ben hoffman in ue5-main branch]
2021-06-10 22:31:36 -04:00
matt hoffman
80b6a8fd16 Matinee: Changes required to delete matinee editor module. Removes the Interp edit mode and UnrealEds dependency on the Matinee editor module.
#rb Max.Chen, Ludovic.Chabant
#jira UE-105313
#p4v-preflight-copy 16616138
#preflight 60c1bb5eb68c700001c956d5
#preflight 60c24c03730f8a0001772aca
#preflight 60c2602f79a7fe0001785630

[CL 16629318 by matt hoffman in ue5-main branch]
2021-06-10 16:22:02 -04:00
Phillip Kavan
dfa32e9708 Extends the class viewer module to support multiple custom class filters along with an optional associated view option flag.
Additional changes:
- Deprecates the previous method for specifying a singular custom class viewer filter and updates all existing occurrences of this pattern in engine code.
- Extends the property editor utilities interface to expose custom class filter(s) that can be applied to the class picker widget used for editing class property values.
- Adds an implementation of this interface to SDetailsView such that additional class filter(s) can now be configured to be applied to all underlying class property nodes.

#jira UE-108316
#rb Lauren.Barnes
#preflight 60c2102e8ae8960001110d50

[CL 16623084 by Phillip Kavan in ue5-main branch]
2021-06-10 10:31:37 -04:00
Matt Hoffman
a3de5f99ff Undo //UE5/Main/Engine/Source/... changelist 16613917
#jira None
#rb None

[CL 16615633 by Matt Hoffman in ue5-main branch]
2021-06-09 19:25:26 -04:00
Matt Hoffman
b90dd76823 Matinee: Changes required to delete matinee editor module. Removes the Interp edit mode and UnrealEds dependency on the Matinee editor module.
#rb Max.Chen, Ludovic.Chabant
#jira UE-105313

[CL 16613917 by Matt Hoffman in ue5-main branch]
2021-06-09 18:02:53 -04:00
patrick enfedaque
2f3428df7b Fix non-unity build
#rb trivial


#ROBOMERGE-SOURCE: CL 16602163
#ROBOMERGE-BOT: (v828-16531559)

[CL 16605084 by patrick enfedaque in ue5-main branch]
2021-06-09 10:39:13 -04:00
jamie dale
8e5e147425 Fixed some places leaving lingering element references from selection
#jira UE-116919
#rb Francis.Hurteau, Brooke.Hubert
#lockdown Simon.Tourangeau
#preflight 60c00edab68c70000182639c

#ROBOMERGE-SOURCE: CL 16599146 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v828-16531559)

[CL 16599171 by jamie dale in ue5-main branch]
2021-06-08 21:21:42 -04:00
ben hoffman
86c6dd62fb Correctly aquire the editor component handle from an actor component when the tree selection is updated in the SActorDetails panel
#jira UE-117374
#rb justin.hare
#rnx
#preflight 60bfe225c612640001735e73

[CL 16597031 by ben hoffman in ue5-main branch]
2021-06-08 19:53:07 -04:00
patrick enfedaque
dc80a8c0c2 Add support for Play in new window to the Play From Here actor flow
#rb jeanfrancois.dube
#preflight 60bf856a6c7ab70001086b9f


#ROBOMERGE-SOURCE: CL 16588669
#ROBOMERGE-BOT: (v828-16531559)

[CL 16588685 by patrick enfedaque in ue5-main branch]
2021-06-08 12:38:24 -04:00
Jamie Dale
c088cf85f2 Support for editing foliage instances directly in the level editor via typed elements
Note: This is disabled by default, but can be enabled by setting the "TypedElements.EnableFoliageInstanceElements" CVar to "1" (alongside setting "TypedElements.EnableSMInstanceElements" to "1").

Notable changes:
 - AInstancedFoliageActor now implements ISMInstanceManager, and provides an implementation that works for ISMC foliage instances.
   - ISMActor foliage is not yet supported, but also not currently used.
 - ISMInstanceManager now has functions for NotifySMInstanceMovementX and NotifySMInstanceSelectionChanged, which are called from the SMInstance typed element implementation.
 - USMInstanceElementDetailsProxyObject now calls the NotifySMInstanceMovementX functions for transform edits.
 - FFoliageStaticMesh::Reapply now re-uses existing instances where possible, to avoid invalidating mapped FSMInstanceElementId values.
 - FFoliageInfo now keeps track of all moving instances, rather than if any instances are currently moving.
 - Various FFoliageInfo/FFoliageImpl functions now take their indices via TArrayView rather than TArray.
 - UEngineElementsLibrary now has public functions for ReplaceEditorXElementHandles, which exposes the previously private re-instancing logic used by UEngineElementsLibrary::OnObjectsReplaced.
   - This allows static mesh instance elements to be re-instanced if needed (eg, if moving them to an ISMC in a different world partition).

#rb Brooke.Hubert
#preflight 60b835ef6073fb00015e3cd1

[CL 16552742 by Jamie Dale in ue5-main branch]
2021-06-03 16:42:24 -04:00
patrick enfedaque
15495ca467 PlayFromHere: An actor can now be source of PlayFromHere (Location,Rotation) and get notified (bCanPlayFromHere, OnPlayFromHere)
#rb jeanfrancois.dube
#preflight 60b91e176c445400019a660c


#ROBOMERGE-SOURCE: CL 16550798
#ROBOMERGE-BOT: (v828-16531559)

[CL 16550867 by patrick enfedaque in ue5-main branch]
2021-06-03 15:03:45 -04:00
paul chipchase
6958a4faa7 Add some basic profile data to Mirage to make it easier for people to see when payloads are being pushed to or pulled from the various backends.
#rb Per.Larsson
#rnx

* VirtualizationManager
- Add method ::IsEnabled which allows the caller to poll if content virtualization is enabled or not.
- Add method ::GetPayloadActivityInfo to return profiling data
- Added a new Profiling namespace containing all of the profiling code.
-- The idea is to try and keep all profiling data contained in the virtualization manager and not require the backends to be aware of it.
- The actual pull/push operations have been moved to new private methods ::TryPushDataToBackend and ::PullDataFromBackend, by limiting the scolpe of where the actual operation occur makes it easier to add the profiling code.
- We use the cooking stats system for recording our profiling data. Currently this adds no real value and we could've implemented our own but longer term this code might get hooked into FCookStatsManager:: CookStatsCallbacks to add it to our telemetry systems and this will be easier to do if it is already in the cooking stats formats.

* SVirtualizationStaticIndicator
- The widget is based on SDDCStatusIndicator for the DDC and is placed just before it in the UI.
- The widget will only be shown if the content virtualization system is enabled, so functions as an easy way to check that (maybe in the future it can be on all the time in which case we'd need the widget to reflect when the systems are disabled)
- Currently shows a green down arrow when a payload has been pulled and a green up arrow when a payload has been pushed.
- The tool tip shown on mouse over will show the total data sizes pulled and pushed from the backends.
#preflight 60b87c34ae46a100017d5334

[CL 16544645 by paul chipchase in ue5-main branch]
2021-06-03 04:35:17 -04:00
Jamie Dale
2b4fd7e927 Ensure GizmoManipulationStarted and GizmoManipulationStopped are called in pairs
The editor viewport would previously skip the GizmoManipulationStopped call if nothing had actually moved, but this causes an imbalance in the APIs which call NotifyMovementStarted and NotifyMovementEnded.

GizmoManipulationStopped is now always called, but with an extra argument saying if anything actually moved.

#rb Brooke.Hubert
#preflight 60aeb2de1db8a70001cbe077

[CL 16537833 by Jamie Dale in ue5-main branch]
2021-06-02 15:11:28 -04:00
Jamie Dale
982ac75d6b Fixed the sub-object instance editor toolbar being visible, even when non-actor elements were selected
The button bar of the sub-object instance editor would always be visible, even if there was no valid actor context to operate on. This changes it to only appear for actor contexts (ie, we can't add components to static mesh instance elements).

#fyi Brooke.Hubert, Ben.Hoffman

[CL 16526044 by Jamie Dale in ue5-main branch]
2021-06-01 20:19:16 -04:00
Patrick Boutot
fbf6261906 Slate: Add FSlotArguments as a way to create FSlot in the declarative way, similar to SWidget. It will be used to support TSlateAttribute on FSlot. TAttribute will be in the FSlotArguments and the FSlate will have a TSlateAttribute, similar to SWidget. The previous slot will be deprecated once everything is converted. Convert SOverlay to FSlotArguments.
#jira UE-114425
#rb vincent.gauthier
#preflight 60acf3a86905a60001c2170e

[CL 16447861 by Patrick Boutot in ue5-main branch]
2021-05-25 10:13:56 -04:00
Lauren Barnes
aee8534812 Updates to the in-viewport menu styling, and turning the UI on by default. Adds SWindow::MakeStyledCursorDecorator for custom styling.
#rb Matt.Kuhlenschmidt
#preflight 60abbd6b8194e70001ec9294
#jira UETOOL-3450

[CL 16436496 by Lauren Barnes in ue5-main branch]
2021-05-24 12:18:51 -04:00