Scene Graph Prefab regression

Summary

In the past Scene Graph prefabs permitted partially initialized components. Nowadays it’s no longer allowed. Unless there’s a further plan to permit this in the far future where the reflection would expose the bits that require explicit code side initialization I think there’s a possible solution which can be applied in the near term.

Currently the issue will be the reflected entity type, which must be concrete as the base entity type is marked as such. The entity itself is still concrete, it’s only that some components are partially initialized and during internal construction, this would be illegal. However, such entities are not meant to be initialized from code, or at least not at this point of time. Such entities with partially initialized components can be considered “editor-only” initializable (read below).

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Other

Steps to Reproduce

Create a component with an editable property that has no default value.

my_component := class<final_super>(component) {
  @editable
  TargetEntity: entity
}

Create a prefab (my_entity) and add that component to it, without setting the value. The editor will error out as this workflow has been disallowed.

Expected Result

The editor should not reject this component workflow.

:green_circle: In order to solve the issue that someone could initialize such a reflected prefab from code, the reflection will straight prohibit this via the <epic_internal> access modifier on the constructor’s side.

- my_entity<scoped { ... }> := class<final>(entity):
+ my_entity<scoped { ... }> := class<final><epic_internal>(entity):
                                           ^~~~~~~~~~~~~~~

This way the type can still be used in code when fetching or working with the prefab, but only the editor will be able to fully satisfy the initialization of that entity.

Furthermore make sure that concrete_subtype(entity) is not circumventing the construction and honors the <epic_internal> flag on the constructor.

Observed Result

The editor is stricter and rejects partially initialized components in prefabs.

Platform(s)

PC (v37.00)

Personally I have used partially initialized editor-only prefabs for more than half a year when it was allowed. Now I can no longer pre-place components and rely on the editor telling me which components in the outliner are not fully initialized yet. The regression is forcing me to remove the components from the prefabs entirely and requires to remember that I have to re-add those in the outliner entities. This is workflow is much more error prone, especially when the same prefabs are shared across multiple projects.

FORT-959193 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.