Description

For map placed blueprint actors with components with property modifications, when triggering Reset Instance Changes to Blueprint Default from the actor instance's Details panel, any components with property modifications are unregistered but not re-registered.

Expected: Reset Instance Changes to Blueprint Default should not leave previously registered components as unregistered.

 

Additional info: this affects C++ components only. The components remain unregistered while in editor, but will be registered when play starts. However, the action should still not change a component's registered state as it may affect editor behavior.

Interestingly once unregistered, the component will be registered again when you make a modification to it if it is declared as

UPROPERTY(VisibleAnywhere) 

but will remain unregistered if declared as

UPROPERTY(EditAnywhere) 

In both cases, the component should remain registered, if it was registered before triggering Reset Instance Changes to Blueprint Default

Steps to Reproduce
  • Create a USceneComponent subclass UMySceneComponent
    • Override RegisterComponent and UnregisterComponent to debug log when called (and call Super)
  • Create a native actor class AMyActor with a default subobject UMySceneComponent
    • Make it UPROPERTY(EditAnywhere)
  • Create a blueprint BP_MyActor of that actor class
  • Place a BP_MyActor in the level and select it
  • Change a property on the UMySceneComponent, such as bool bIsEditorOnly
  • Observe that RegisterComponent and UnregisterComponent are called (expected)
  • In the details panel top right, click Edit the Blueprint for this Actor > Reset Instance Changes to Blueprint Default
  • Observe: Only UnregisterComponent is called: the component is now unregistered
  • Expected: UnregisterComponent should be followed by a RegisterComponent call. The component should be registered.
Callstack

> UnrealEditor-ResetInstanceRepro53.dll!UMySceneComponent::OnUnregister() Line 25 C++
  UnrealEditor-Engine.dll!UActorComponent::ExecuteUnregisterEvents() Line 1706 C++
  UnrealEditor-Engine.dll!UActorComponent::UnregisterComponent() Line 1420 C++
  UnrealEditor-UnrealEd.dll!EditorUtilities::CopyActorProperties(AActor * SourceActor, AActor * TargetActor, const EditorUtilities::FCopyOptions & Options) Line 1669 C++
  UnrealEditor-SubobjectEditor.dll!SSubobjectInstanceEditor::OnResetToBlueprintDefaults() Line 614 C++
  [Inline Frame] UnrealEditor-SubobjectEditor.dll!Invoke(void(SSubobjectInstanceEditor::*)()) Line 66 C++
  [Inline Frame] UnrealEditor-SubobjectEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SSubobjectInstanceEditor::*)() &) Line 311 C++
  UnrealEditor-SubobjectEditor.dll!TBaseSPMethodDelegateInstance<0,SSubobjectInstanceEditor,1,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() Line 298 C++
  UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>() Line 570 C++
  [Inline Frame] UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
  UnrealEditor-Slate.dll!SMenuEntryBlock::OnClicked(bool bCheckBoxClicked) Line 1167 C++
  UnrealEditor-Slate.dll!SMenuEntryBlock::OnMenuItemButtonClicked() Line 1118 C++
  [Inline Frame] UnrealEditor-Slate.dll!Invoke(FReply(SMenuEntryBlock::*)()) Line 66 C++
  [Inline Frame] UnrealEditor-Slate.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(FReply(SMenuEntryBlock::*)() &) Line 311 C++
  UnrealEditor-Slate.dll!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 281 C++
  UnrealEditor-Slate.dll!TDelegate<FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 549 C++
  UnrealEditor-Slate.dll!SButton::ExecuteOnClick() Line 465 C++
  UnrealEditor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 390 C++
  UnrealEditor-Slate.dll!SMenuEntryButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 434 C++
  [Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3>::operator()(const FArrangedWidget &) Line 5220 C++
  UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,`FSlateApplication::RoutePointerUpEvent'::`8'::<lambda_3>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 442 C++
  UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5206 C++
  UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5775 C++
  UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5740 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2231 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 2738 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1099 C++
  [Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 931 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 937 C++
 [External Code]
  [Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 119 C++
  UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 148 C++
  UnrealEditor.exe!FEngineLoop::Tick() Line 5749 C++
  [Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
  UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 188 C++
  UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
  UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
 [External Code]
 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-204130 in the post.

1
Login to Vote

Unresolved
ComponentUE - Gameplay - Blueprint Editor
Affects Versions5.3
Target Fix5.5
CreatedJan 17, 2024
UpdatedFeb 16, 2024