Description

Changing the type of an existing child scene component to be a non-scene component type triggers some fixup code at load time which attempts to remove the node from its current position in the scene component hierarchy and move it into the set of root nodes alongside other non-scene components.

The fixup code will currently fail due to an attempt to make this modification to the node array directly inside the node iteration loop (see USimpleConstructionScript::PostLoad).

Steps to Reproduce
  1. Create a new (blank) C++ project and launch the editor.
  2. Add a new C++ class based on SceneComponent (MySceneComponent), and either wait for Hot Reload to complete or close/re-launch the editor around rebuilding the C++ code.
  3. Create a new Blueprint class based on Actor (NewBlueprint) and open it in the Blueprint editor.
  4. Add a new Scene component under the DefaultSceneRoot node.
  5. Add a new MySceneComponent and drag it to make it a child of the 'Scene' node added in the previous step.
  6. Compile and save the Blueprint class.
  7. Close the editor.
  8. In Visual Studio, edit MySceneComponent.h and change the parent class of MySceneComponent from USceneComponent to UActorComponent.
  9. Recompile the C++ code and re-launch the editor.
  10. Attempt to open the NewBlueprint asset. A crash will result on load:
Ensure condition failed: Lhs.CurrentNum == Lhs.InitialNum [File:D:\dev\UE4\Dev-Framework\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 206] 
Array has changed during ranged-for iteration!
[2019.01.16-16.21.22:117][759]LogOutputDevice: Error: Ensure condition failed: Lhs.CurrentNum == Lhs.InitialNum [File:D:\dev\UE4\Dev-Framework\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 206] 
Array has changed during ranged-for iteration!
Callstack

> UE4Editor-Engine-Win64-Debug.dll!USimpleConstructionScript::PostLoad() Line 149 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObject::ConditionalPostLoad() Line 1031 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObject::PostLoadSubobjects(FObjectInstancingGraph * OuterInstanceGraph) Line 1066 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObject::ConditionalPostLoadSubobjects(FObjectInstancingGraph * OuterInstanceGraph) Line 1121 C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObject::ConditionalPostLoad() Line 1020 C++
UE4Editor-CoreUObject-Win64-Debug.dll!EndLoad() Line 1685 C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackageInternal::__l76::<lambda>() Line 1312 C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker, FArchive * InReaderOverride) Line 1405 C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, FArchive * InReaderOverride) Line 1498 C++
UE4Editor-CoreUObject-Win64-Debug.dll!ResolveName(UObject * & InPackage, FString & InOutName, bool Create, bool Throw, unsigned int LoadFlags) Line 834 C++
UE4Editor-CoreUObject-Win64-Debug.dll!StaticLoadObjectInternal(UClass * ObjectClass, UObject * InOuter, const wchar_t * InName, const wchar_t * Filename, unsigned int LoadFlags, UPackageMap * Sandbox, bool bAllowObjectReconciliation) Line 922 C++
UE4Editor-CoreUObject-Win64-Debug.dll!StaticLoadObject(UClass * ObjectClass, UObject * InOuter, const wchar_t * InName, const wchar_t * Filename, unsigned int LoadFlags, UPackageMap * Sandbox, bool bAllowObjectReconciliation) Line 993 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!FAssetData::GetAsset() Line 322 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!SContentBrowser::OnAssetsActivated(const TArray<FAssetData,FDefaultAllocator> & ActivatedAssets, EAssetTypeActivationMethod::Type ActivationMethod) Line 2103 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SContentBrowser,0,TTypeWrapper<void> __cdecl(TArray<FAssetData,FDefaultAllocator> const &,enum EAssetTypeActivationMethod::Type)>::Execute(const TArray<FAssetData,FDefaultAllocator> & <Params_0>, EAssetTypeActivationMethod::Type <Params_1>) Line 279 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SContentBrowser,0,void __cdecl(TArray<FAssetData,FDefaultAllocator> const &,enum EAssetTypeActivationMethod::Type)>::ExecuteIfSafe(const TArray<FAssetData,FDefaultAllocator> & <Params_0>, EAssetTypeActivationMethod::Type <Params_1>) Line 357 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TBaseDelegate<void,TArray<FAssetData,FDefaultAllocator> const &,enum EAssetTypeActivationMethod::Type>::ExecuteIfBound(const TArray<FAssetData,FDefaultAllocator> & <Params_0>, EAssetTypeActivationMethod::Type <Params_1>) Line 648 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!SAssetView::OnListMouseButtonDoubleClick(TSharedPtr<FAssetViewItem,0> AssetItem) Line 4359 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TMemberFunctionCaller<SAssetView,void (__cdecl SAssetView::*)(TSharedPtr<FAssetViewItem,0>)>::operator()<TSharedPtr<FAssetViewItem,0> &>(TSharedPtr<FAssetViewItem,0> & <Args_0>) Line 157 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SAssetView,0,TTypeWrapper<void> __cdecl(TSharedPtr<FAssetViewItem,0>)>::Execute(TSharedPtr<FAssetViewItem,0> <Params_0>) Line 279 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SAssetView,0,void __cdecl(TSharedPtr<FAssetViewItem,0>)>::ExecuteIfSafe(TSharedPtr<FAssetViewItem,0> <Params_0>) Line 357 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!TBaseDelegate<void,TSharedPtr<FAssetViewItem,0> >::ExecuteIfBound(TSharedPtr<FAssetViewItem,0> <Params_0>) Line 648 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!SListView<TSharedPtr<FAssetViewItem,0> >::Private_OnItemDoubleClicked(TSharedPtr<FAssetViewItem,0> TheItem) Line 820 C++
UE4Editor-ContentBrowser-Win64-Debug.dll!STableRow<TSharedPtr<FAssetViewItem,0> >::OnMouseButtonDoubleClick(const FGeometry & InMyGeometry, const FPointerEvent & InMouseEvent) Line 333 C++
UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerDoubleClickEvent::__l2::<lambda>(const FArrangedWidget & TargetWidget, const FPointerEvent & Event) Line 6100 C++
UE4Editor-Slate-Win64-Debug.dll!FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FPointerEvent,FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) >(FSlateApplication * ThisApplication, FEventRouter::FBubblePolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerDoubleClickEvent::__l2::FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) & Lambda) Line 271 C++
UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerDoubleClickEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 6098 C++
UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::ProcessMouseButtonDoubleClickEvent(const TSharedPtr<FGenericWindow,0> & PlatformWindow, const FPointerEvent & InMouseEvent) Line 6085 C++
UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::OnMouseDoubleClick(const TSharedPtr<FGenericWindow,0> & PlatformWindow, const EMouseButtons::Type Button, const FVector2D CursorPos) Line 6055 C++
UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 1846 C++
UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,0> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2292 C++
UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 942 C++
UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 771 C++
[External Code]
UE4Editor-ApplicationCore-Win64-Debug.dll!WinPumpMessages() Line 108 C++
UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 133 C++
UE4Editor-Win64-Debug.exe!FEngineLoop::Tick() Line 3810 C++
UE4Editor-Win64-Debug.exe!EngineTick() Line 63 C++
UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 177 C++
UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 255 C++

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-68579 in the post.

0
Login to Vote

Fixed
ComponentGameplay - Blueprint Editor
Affects Versions4.21
Target Fix4.22
Fix Commit4890130
Main Commit4890136
Release Commit4890645
CreatedJan 16, 2019
ResolvedFeb 4, 2019
UpdatedApr 1, 2019