Commit Graph

117 Commits

Author SHA1 Message Date
Patrick Enfedaque
33d84d2a72 Fix scaling issues when copy/pasting actor hierarchies:
- Fix ParentActor->IsSelected() not being valid anymore (Use OutPastedActors.Contains instead)
- Avoid Teleport if Offset is Zero

#jira none
#rb jamie.dale
#preflight 6273c93b64121bbd68a874b9

[CL 20056812 by Patrick Enfedaque in ue5-main branch]
2022-05-05 09:24:46 -04:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
julien stjean
51e563b9a0 Fixed the typed element scripting api issues.
Added the FScriptTypedElementHandle. These handles are disarmed when the element they pointing to is destroyed instead of crashing the engine. They do have a performance overhead so using these should be restricted to exposing stuff to blueprint/python.

Reworked the TypedElementList to be a template so that we have both a FTypedElementList and a FScriptTypedElementList from the same source code.

Changed the api of the interfaces so that can now accept and use the scripted version of the handle and list instead of the native ones.

#jira UE-133667
#rb Brooke.Hubert
#preflight 61f89bfaf657e25a5908db48

#ROBOMERGE-AUTHOR: julien.stjean
#ROBOMERGE-SOURCE: CL 18816318 in //UE5/Release-5.0/... via CL 18816336 via CL 18822818
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824371 by julien stjean in ue5-main branch]
2022-02-02 07:40:00 -05:00
brooke hubert
f149e45233 Fixing a bug where creating temporary actors via typed elements would not be able to delete them again in single place tool
#preflight 61b22ba9c674eb9fc9d8ea9a
#Jira None
#rb julien.stjean ryan.schmidt

#ROBOMERGE-AUTHOR: brooke.hubert
#ROBOMERGE-SOURCE: CL 18420733 in //UE5/Release-5.0/... via CL 18422600
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18422868 by brooke hubert in ue5-release-engine-test branch]
2021-12-09 14:51:37 -05:00
patrick enfedaque
b6ec25dbd9 Fix Unhide/Hide all selected commands with Parent actor selection
#jira UE-115563

#rb richard.malo
#preflight 61a62b810f18b154417c0cdb

#ROBOMERGE-AUTHOR: patrick.enfedaque
#ROBOMERGE-SOURCE: CL 18324257 in //UE5/Release-5.0/... via CL 18324277
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18324299 by patrick enfedaque in ue5-release-engine-test branch]
2021-11-30 09:25:48 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
julien stjean
4fd2636e82 Fixed a issue that blocked the duplication of actors that are not from the current level.
#jira UE-127441
#rb JeanMichal.Dignard

#ROBOMERGE-AUTHOR: julien.stjean
#ROBOMERGE-SOURCE: CL 17597857 via CL 17597864 via CL 17597871 via CL 17614795 via CL 17614874
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v871-17566257)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17614964 by julien stjean in ue5-release-engine-test branch]
2021-09-23 18:05:07 -04:00
aurel cordonnier
7f517562d5 Merge from Release-Engine-Staging @ 17438845 to Release-Engine-Test
This represents UE4/Main @17430120 and Dev-PerfTest @17437669

[CL 17439044 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-06 12:23:53 -04:00
richard talbotwatkin
d6e126ccac Moved BSP-related functionality into a Developer module, where it can be used by plugins/modules other than UnrealEd.
#jira UETOOL-3833
#rb Matt.Kuhlenschmidt

#ROBOMERGE-SOURCE: CL 17174912 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17174925 by richard talbotwatkin in ue5-release-engine-test branch]
2021-08-16 07:51:37 -04:00
patrick enfedaque
94334016cf Fix Actor Label refresh on Copy/Paste
#rb jeanfrancois.dube

#ROBOMERGE-SOURCE: CL 16924583 via CL 16926510
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16926789 by patrick enfedaque in ue5-release-engine-test branch]
2021-07-22 13:14:31 -04:00
jamie dale
afa943050c 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

#ROBOMERGE-SOURCE: CL 16776547 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16776582 by jamie dale in ue5-release-engine-test branch]
2021-06-24 14:31:49 -04:00
matt hoffman
e171ab3b14 Matinee/Editor: Removed more Matinee related functions from various Editor callbacks.
#jira UE-105313
#rb Lauren.Barnes
#preflight 60cb86e195e23200018adcaa

#ROBOMERGE-SOURCE: CL 16708876 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16708899 by matt hoffman in ue5-release-engine-test branch]
2021-06-17 14:53:36 -04:00
jamie dale
a2c2b50c07 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

#ROBOMERGE-SOURCE: CL 16705229 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16705233 by jamie dale in ue5-release-engine-test branch]
2021-06-17 11:19:53 -04:00
Cody Albert
209af6fa9e Fixed issue where moving actors from multiple sublevels could result in actors being lost
#rb Jamie.Dale
#jira UE-114052

[CL 16393612 by Cody Albert in ue5-main branch]
2021-05-19 17:59:41 -04:00
jamie dale
bdb2748f10 Implemented common "Duplicate" operation using typed elements
- 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]
2021-03-20 04:30:12 -04:00
Jamie Dale
50cc2a3827 Split edactDeleteSelectedActors to avoid dependency on the global selection
#rb Brooke.Hubert

[CL 15265101 by Jamie Dale in ue5-main branch]
2021-01-31 10:57:09 -04:00
Jamie Dale
2eba45e383 Ported viewport drag-duplication to use typed elements
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]
2020-12-02 16:08:03 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00
ymurata1
054eac85ca PR #7354: Make Alt+Drag identical to Ctrl+W (Contributed by ymurata1)
#ushell-cherrypick of 14383836 by UnrealBot

[CL 14440247 by ymurata1 in ue5-main branch]
2020-10-07 14:54:04 -04:00
Marc Audy
7379fa99c5 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14229157
[CL 14233282 by Marc Audy in ue5-main branch]
2020-09-01 14:07:48 -04:00
Jamie Dale
1ec3c71366 Updated USelection to be optionally driven by an element list
USelection can now operate on two different backends; FObjectSelectionStore (which is the old, object-array implementation), or FElementSelectionStore (which is the newer element list based implementation).

Breaking changes:
 - USelection::MarkBatchDirty is now USelection::ForceBatchDirty.
 - USelection::Initialize is now private. Use one of USelection::CreateObjectSelection, USelection::CreateActorSelection, or USelection::CreateComponentSelection to create your USelection instance instead.
 - USelection::SelectionChangedEvent and USelection::SelectObjectEvent are now events, and should not have their Broadcast called externally (use USelection::NoteSelectionChanged or USelection::NoteUnknownSelectionChanged if you must manually notify).

Note: The element list implementation is currently disabled (via UE_USE_ELEMENT_LIST_SELECTION) until actor and component element support is submitted.

#rb Chris.Gagnon

[CL 14126915 by Jamie Dale in ue5-main branch]
2020-08-17 16:27:02 -04:00
Marc Audy
a7c9001a94 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14075166
#rb
#rnx

[CL 14075271 by Marc Audy in ue5-main branch]
2020-08-11 01:36:57 -04:00
JeanMichel Dignard
70d074639f Merging //UE4/Dev-Main @ 10886849 to Dev-Tools-Staging (//UE4/Dev-Tools-Staging)
#rb none
#rnx

[CL 10906274 by JeanMichel Dignard in Dev-Tools-Staging branch]
2020-01-08 13:26:18 -05:00
ryan durand
627baf970a Updating copyright for Engine Editor.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870586 by ryan durand in Main branch]
2019-12-26 15:33:43 -05:00
Chris Gagnon
346a4b05ea Copy up from Dev-Editor @10681378
#rb none

[CL 10837446 by Chris Gagnon in Dev-Tools-Staging branch]
2019-12-19 18:07:47 -05:00