The licensee has noticed that the deletion of a transient actor still marks the scene as dirty and asks it to be saved.
Checking the source it was noted that the transient flag is not verified on deletion.
They identified the origin of the issue resides on UUnrealEdEngine::DeleteActors(), more specifically on this snippet:
// Modify the level. Each level is modified only once.
// @todo DB: Shouldn't this be calling UWorld::ModifyLevel?
ULevel* Level = Actor->GetLevel();
if (LevelsAlreadyModified.Find(Level) == INDEX_NONE)
They suggest the setting of bShouldDirty to:
bool bShouldDirty = !((Actor->IsPackageExternal() && Level->IsUsingExternalActors()) || Actor->HasAnyFlags(RF_Transient));
That way the flag is also checked.
On an empty project create a C++ Actor, in the repro project I've named mine MyActor
Add Transient and Blueprintable to it's UCLASS()
Compile and open the project
Create a Blueprint from the created C++ Actor (BP_TransientActor in the repro)
Dragging the BP to a scene will not mark a scene as dirty/to be saved, as expected, because the BP is transient and should not be serialized
Now delete the spawned BP from the scene
Expected Result: the deletion of a transient actor should not mark the scene as dirty
Actual Result: the deletion of the transient actor marks the scene as dirty
> UnrealEditor-UnrealEd.dll!UUnrealEdEngine::DeleteActors(const TArray<AActor *,TSizedDefaultAllocator<32>> & InActorsToDelete, UWorld * InWorld, UTypedElementSelectionSet * InSelectionSet, const bool bVerifyDeletionCanHappen, const bool bWarnAboutReferences, const bool bWarnAboutSoftReferences) Line 1224 C++
UnrealEditor-UnrealEd.dll!UActorElementEditorWorldInterface::DeleteElements(TArrayView<FTypedElementHandle const ,int> InElementHandles, UWorld * InWorld, UTypedElementSelectionSet * InSelectionSet, const FTypedElementDeletionOptions & InDeletionOptions) Line 77 C++
UnrealEditor-Engine.dll!FTypedElementCommonActionsCustomization::DeleteElements(ITypedElementWorldInterface * InWorldInterface, TArrayView<FTypedElementHandle const ,int> InElementHandles, UWorld * InWorld, UTypedElementSelectionSet * InSelectionSet, const FTypedElementDeletionOptions & InDeletionOptions) Line 30 C++
UnrealEditor-LevelEditor.dll!FActorElementLevelEditorCommonActionsCustomization::DeleteElements(ITypedElementWorldInterface * InWorldInterface, TArrayView<FTypedElementHandle const ,int> InElementHandles, UWorld * InWorld, UTypedElementSelectionSet * InSelectionSet, const FTypedElementDeletionOptions & InDeletionOptions) Line 24 C++
UnrealEditor-Engine.dll!UTypedElementCommonActions::DeleteNormalizedElements(const TSharedPtr<TTypedElementList<FTypedElementHandle> const ,1> & ElementListPtr, UWorld * World, UTypedElementSelectionSet * SelectionSet, const FTypedElementDeletionOptions & DeletionOptions) Line 83 C++
UnrealEditor-Engine.dll!UTypedElementCommonActions::DeleteSelectedElements(UTypedElementSelectionSet * SelectionSet, UWorld * World, const FTypedElementDeletionOptions & DeletionOptions) Line 62 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec_Actor(UWorld * InWorld, const wchar_t * Str, FOutputDevice & Ar) Line 2610 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 725 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Exec_Editor(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 5640 C++
UnrealEditor-Core.dll!FExec::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 18 C++
UnrealEditor-Engine.dll!UEngine::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 4759 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 662 C++
UnrealEditor-LevelEditor.dll!FLevelEditorActionCallbacks::ExecuteExecCommand(FString Command) Line 2033 C++
[Inline Frame] UnrealEditor-LevelEditor.dll!Invoke(void[Image Removed](FString) &) Line 47 C++
UnrealEditor-LevelEditor.dll!??$ApplyAfter@AEBQ6AXVFString@@@Z$$V@?$TTupleBase@U?$TIntegerSequence@I$0A@@@VFString@@@Tuple@Private@Core@UE@@QEGBA?A_TAEBQ6AXVFString@@@Z@Z(void[Image Removed](FString) & Func) Line 309 C++
UnrealEditor-LevelEditor.dll!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy,FString>::ExecuteIfSafe() Line 777 C++
[Inline Frame] UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound() Line 570 C++
UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
UnrealEditor-Slate.dll!FUICommandList::ConditionalProcessCommandBindings(const FKey Key, bool bCtrl, bool bAlt, bool bShift, bool bCmd, bool bRepeat) Line 235 C++
UnrealEditor-Slate.dll!FUICommandList::ProcessCommandBindings(const FKeyEvent & InKeyEvent) Line 179 C++
UnrealEditor-UnrealEd.dll!SEditorViewport::OnKeyDown(const FGeometry & MyGeometry, const FKeyEvent & InKeyEvent) Line 143 C++
UnrealEditor-LevelEditor.dll!SLevelViewport::OnKeyDown(const FGeometry & MyGeometry, const FKeyEvent & InKeyEvent) Line 724 C++
[Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::ProcessKeyDownEvent::__l22::<lambda_2>::operator()(const FArrangedWidget &) Line 4789 C++
UnrealEditor-Slate.dll!??$Route@VFReply@@VFBubblePolicy@FEventRouter@@UFKeyEvent@@V<lambda_2>@?BG@??ProcessKeyDownEvent@FSlateApplication@@QEAA_NAEBU4@@Z@@FEventRouter@@SA?AVFReply@@PEAVFSlateApplication@@VFBubblePolicy@0@UFKeyEvent@@AEBV<lambda_2>@?BG@??ProcessKeyDownEvent@2@QEAA_NAEBU4@@Z@W4ESlateDebuggingInputEvent@@@Z(FSlateApplication * ThisApplication, FEventRouter::FBubblePolicy RoutingPolicy, FKeyEvent EventCopy, const FSlateApplication::ProcessKeyDownEvent::__l22::<lambda_2> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 447 C++
[Inline Frame] UnrealEditor-Slate.dll!FEventRouter::RouteAlongFocusPath(FSlateApplication *) Line 416 C++
UnrealEditor-Slate.dll!FSlateApplication::ProcessKeyDownEvent(const FKeyEvent & InKeyEvent) Line 4785 C++
UnrealEditor-Slate.dll!FSlateApplication::OnKeyDown(const int KeyCode, const unsigned int CharacterCode, const bool IsRepeat) Line 4696 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2078 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2750 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1919 C++
[Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 923 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 929 C++
[External Code]
[Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 116 C++
UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 145 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5850 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 180 C++
UnrealEditor.exe!GuardedMainWrapper(const wchar_t * CmdLine) Line 118 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 258 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
[External Code]
How does TextureRenderTarget2D get TArray<uint8> type data?
Why does the REMOVE method of map container remove elements have memory leaks?
How do I set a material as a post-processing material?
How to delete some elements correctly when deleting an array loop?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
What controls of umg have mouse wheel events in UE4.27?
Why does UV setting float2(1,1) display incorrectly in the material's custom node?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-243836 in the post.
0 |
Component | UE - World Creation - Worldbuilding Tools |
---|---|
Affects Versions | 5.4.4 |
Target Fix | 5.6 |
Created | Feb 6, 2025 |
---|---|
Updated | Feb 7, 2025 |