Description

A Packaged build that has had an Editor Only Component added to one of its Blueprints logs a false positive warning in USimpleConstructionScript::FixupRootNodeParentReferences():

USimpleConstructionScript::FixupRootNodeParentReferences() - Couldn't find native parent component 'MyEditorOnlyComponent' for 'MyEditorOnly' in BlueprintGeneratedClass 'BP_MyBrokenActor_C' (it may have been removed) 

It looks like the Component that was added in the Editor is not removed before packaging and ends up "parentless". It's expected that the engine handles this edge case prior to throwing a warning.

Steps to Reproduce
  • Create a fresh C++ project
  • Create a C++ SceneComponent - I'll call it MyEditorOnlyComponent
  • In MyEditorOnlyComponent constructor, set the flag bIsEditorOnly = true
  • Create a C++ Actor - I'll call it MyBrokenActor
  • Add to MyBrokenActor.h:
#if WITH_EDITORONLY_DATA
UMyEditorOnlyComponent* MyEditorOnlyComponent;
#endif //WITH_EDITORONLY_DATA
  • Add to AMyBrokenActor::AMyBrokenActor() (MyBrokenActor.cpp):
#if WITH_EDITORONLY_DATA
MyEditorOnlyComponent = CreateDefaultSubobject<UMyEditorOnlyComponent>(TEXT("MyEditorOnlyComponent"));
MyEditorOnlyComponent->SetupAttachment(GetRootComponent());
#endif //WITH_EDITORONLY_DATA 
  • Now create a BP from MyBrokenActor - I'll call it BP_MyBrokenActor
  • Add more MyEditorOnlyComponent to BP_MyBrokenActor in the Editor
  • Create a blank scene, save it and set it up as GameDefaultMap on the ProjectSettings
  • Instantiate BP_MyBrokenActor to this scene and save it
  • We need the -SkipCookingEditorContent so I've created a Custom Launch Profile inside Project Launcher:
    It's the basic setup but add -SkipCookingEditorContent to the AdditionalCookerOptions field.
  • Launch the profile and after it finishes, run the created executable.
  • Navigate to packaged build folder, \Windows\<Project>\Saved\Logs\<Project>.log
  • Check the logs and see the Warning: USimpleConstructionScript::FixupRootNodeParentReferences() - Couldn't find native parent component 'MyEditorOnlyComponent' for 'MyEditorOnly' in BlueprintGeneratedClass 'BP_MyBrokenActor_C' (it may have been removed) for each MyEditorOnlyComponent you add in the Editor.

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Gameplay - Components
Affects Versions5.4.4
Target Fix5.6
CreatedOct 15, 2024
UpdatedOct 17, 2024
View Jira Issue