UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TypedElementCommonActions.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
8
11
12#include "TypedElementCommonActions.generated.h"
13
15
30
35{
36public:
38
44
47
50
51 inline explicit operator bool() const
52 {
53 return IsSet();
54 }
55
56 inline bool IsSet() const
57 {
58 return ElementWorldHandle.IsSet()
59 && CommonActionsCustomization;
60 }
61
62 //~ See UTypedElementCommonActions for API docs
63
64private:
66 FTypedElementCommonActionsCustomization* CommonActionsCustomization = nullptr;
67};
68
69USTRUCT(BlueprintType)
71{
73
74 // Todo Copy And Paste should we consider supporting pasting with surface snapping?
75
76 // Todo Copy And Paste should we add optional options to handle where to paste (Like some sort of per type paste context for example instance can go under existing actor/components or the partition mode)?
77
78 // If provided the SelectionSet selection will only contains the newly added elements
79 UPROPERTY(BlueprintReadWrite, Category = "TypedElementInterfaces|World|PasteOptions")
81
82 UPROPERTY(BlueprintReadWrite, Category = "TypedElementInterfaces|World|PasteOptions")
83 bool bPasteAtLocation = false;
84
85 UPROPERTY(BlueprintReadWrite, Category = "TypedElementInterfaces|World|PasteOptions")
86 FVector PasteLocation = FVector::ZeroVector;
87
88 // C++ Only. Allow for custom callbacks for some custom top level object in the T3D file
90};
91
96UCLASS(Transient, MinimalAPI)
98{
100
101public:
106 UFUNCTION(BlueprintCallable, Category="TypedElementFramework|Common")
107 ENGINE_API bool DeleteSelectedElements(UTypedElementSelectionSet* SelectionSet, UWorld* World, const FTypedElementDeletionOptions& DeletionOptions);
108
114
119 ENGINE_API TArray<FTypedElementHandle> DuplicateSelectedElements(const UTypedElementSelectionSet* SelectionSet, UWorld* World, const FVector& LocationOffset);
120
125 ENGINE_API virtual TArray<FTypedElementHandle> DuplicateNormalizedElements(const FTypedElementListConstPtr& ElementListPtr, UWorld* World, const FVector& LocationOffset);
126
131 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
132 ENGINE_API bool CopySelectedElements(UTypedElementSelectionSet* SelectionSet);
133
138 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
139 ENGINE_API bool CopySelectedElementsToString(UTypedElementSelectionSet* SelectionSet, FString& OutputString);
140
141 /*
142 * Copy any elements from the given selection set that can be copied into the clipboard.
143 * @note This list should have been pre-normalized via UTypedElementSelectionSet::GetNormalizedSelection or UTypedElementSelectionSet::GetNormalizedElementList.
144 */
145 ENGINE_API virtual bool CopyNormalizedElements(const FTypedElementListConstPtr& ElementListPtr, FString* OptionalOutputString = nullptr);
146
152
158
167 UFUNCTION(BlueprintCallable, Category="TypedElementFramework|Common")
169
174 UFUNCTION(BlueprintCallable, DisplayName="Duplicate Selected Elements", Category = "TypedElementFramework|Common", meta=(ScriptName="DuplicateSelectedElements"))
175 ENGINE_API TArray<FScriptTypedElementHandle> K2_DuplicateSelectedElements(const UTypedElementSelectionSet* SelectionSet, UWorld* World, const FVector& LocationOffset);
176
181 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
182 ENGINE_API TArray<FScriptTypedElementHandle> DuplicateNormalizedElements(const FScriptTypedElementListProxy ElementList, UWorld* World, const FVector& LocationOffset);
183
184 /*
185 * Copy any elements from the given selection set that can be copied into the clipboard.
186 * @note This list should have been pre-normalized via UTypedElementSelectionSet::GetNormalizedSelection or UTypedElementSelectionSet::GetNormalizedElementList.
187 */
188 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
189 ENGINE_API bool CopyNormalizedElements(const FScriptTypedElementListProxy& ElementList);
190
191 /*
192 * Copy any elements from the given selection set that can be copied into the clipboard.
193 * @note This list should have been pre-normalized via UTypedElementSelectionSet::GetNormalizedSelection or UTypedElementSelectionSet::GetNormalizedElementList.
194 */
195 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
196 ENGINE_API bool CopyNormalizedElementsToString(const FScriptTypedElementListProxy& ElementList, FString& OutputString);
197
202 UFUNCTION(BlueprintCallable, DisplayName="Paste Elements", Category = "TypedElementFramework|Common", meta=(ScriptName="PasteElements"))
204
209 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
210 ENGINE_API TArray<FScriptTypedElementHandle> PasteElementsFromString(UTypedElementSelectionSet* SelectionSet, UWorld* World, const FTypedElementPasteOptions& PasteOption, const FString& InputString);
211
216 UFUNCTION(BlueprintCallable, DisplayName="Paste Normalized Elements", Category = "TypedElementFramework|Common", meta=(ScriptName="PasteNormalizedElements"))
218
223 UFUNCTION(BlueprintCallable, Category = "TypedElementFramework|Common")
224 ENGINE_API TArray<FScriptTypedElementHandle> PasteNormalizedElementsFromString(const FScriptTypedElementListProxy& ElementList, UWorld* World, const FTypedElementPasteOptions& PasteOption, const FString& InputString);
225
226private:
230 FTypedElementCommonActionsElement ResolveCommonActionsElement(const FTypedElementHandle& InElementHandle) const;
231};
232
234{
239}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition OutputDevice.h:133
Definition TypedElementCommonActions.h:20
virtual ENGINE_API TSharedPtr< FWorldElementPasteImporter > GetPasteImporter(ITypedElementWorldInterface *InWorldInterface, const FTypedElementListConstPtr &InSelectedHandles, UWorld *InWorld)
Definition TypedElementCommonActions.cpp:43
virtual ~FTypedElementCommonActionsCustomization()=default
virtual ENGINE_API void DuplicateElements(ITypedElementWorldInterface *InWorldInterface, TArrayView< const FTypedElementHandle > InElementHandles, UWorld *InWorld, const FVector &InLocationOffset, TArray< FTypedElementHandle > &OutNewElements)
Definition TypedElementCommonActions.cpp:33
virtual ENGINE_API bool DeleteElements(ITypedElementWorldInterface *InWorldInterface, TArrayView< const FTypedElementHandle > InElementHandles, UWorld *InWorld, UTypedElementSelectionSet *InSelectionSet, const FTypedElementDeletionOptions &InDeletionOptions)
Definition TypedElementCommonActions.cpp:28
virtual ENGINE_API void CopyElements(ITypedElementWorldInterface *InWorldInterface, TArrayView< const FTypedElementHandle > InElementHandles, FOutputDevice &Out)
Definition TypedElementCommonActions.cpp:38
Definition TypedElementWorldInterface.h:80
Definition ArrayView.h:139
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition TypedElementInterfaceCustomization.h:40
Definition Object.h:95
Definition TypedElementCommonActions.h:98
Definition TypedElementSelectionSet.h:180
Definition World.h:918
Definition TypedElementCommonActions.cpp:15
bool IsElementCopyAndPasteEnabled()
Definition TypedElementCommonActions.cpp:23
@ false
Definition radaudio_common.h:23
Definition TypedElementListProxy.h:18
Definition TypedElementCommonActions.h:35
FTypedElementCommonActionsElement & operator=(FTypedElementCommonActionsElement &&)=default
bool IsSet() const
Definition TypedElementCommonActions.h:56
FTypedElementCommonActionsElement(FTypedElementCommonActionsElement &&)=default
FTypedElementCommonActionsElement(const FTypedElementCommonActionsElement &)=default
FTypedElementCommonActionsElement & operator=(const FTypedElementCommonActionsElement &)=default
FTypedElementCommonActionsElement(TTypedElement< ITypedElementWorldInterface > InElementWorldHandle, FTypedElementCommonActionsCustomization *InCommonActionsCustomization)
Definition TypedElementCommonActions.h:39
Definition TypedElementWorldInterface.h:33
Definition TypedElementHandle.h:18
Definition TypedElementCommonActions.h:71
Definition TypedElementWorldInterface.h:58
Definition ObjectPtr.h:488
bool IsSet() const
Definition TypedElementHandle.h:312
Definition TypedElementHandle.h:396