Description

The incorrect use of NewObject() to instance nested class-owned subobjects will force StaticAllocateObject() to reconstruct the instance that was already constructed by the outer class ctor in native engine code. This will eventually result in a call to the UObjectBase dtor.

When async loading is enabled, the UObjectBase destruction will assert if the load results in this code path occurring on an async load worker thread rather than the main (game) thread.

Suggested workarounds are as follows (only one of the following is needed):

  1. Disable async loading for the project.
  2. Disable nativization of all Widget Blueprint assets. In your DefaultEditor.ini, add the following:
    [BlueprintNativizationSettings]
    +ExcludedBlueprintTypes=/Script/UMGEditor.WidgetBlueprint
    
  3. Disable nativization of the specific Blueprint asset(s) causing issues. In your DefaultEditor.ini, add the following (note that this is an example only; you'll need to replace sample path below with the content path that's specific to your project):
    [BlueprintNativizationSettings]
    +ExcludedAssets=/Game/Widgets/MyWidgetBlueprint.uasset
    
Steps to Reproduce
  1. Launch the UE4 editor and create a new, blank Blueprint-only project.
  2. Create a new Widget Blueprint class asset (NewWidgetBlueprint).
  3. Double-click to open the Widget Blueprint class in the editor.
  4. In the Animations tab, create a new animation.
  5. In the Timeline tab, create a new Material Parameter Collection track (any asset).
  6. Compile, save and close the Blueprint editor.
  7. Open the Level Blueprint for editing and switch to the Event graph.
  8. Drag off the BeginPlay event node and add a new "Create Widget" node.
  9. Change the "Class" input pin to "NewWidgetBlueprint"
  10. Compile the Level Blueprint and save the map (NewMap), then close the Blueprint editor.
  11. Choose "Edit->Project Settings..." and switch to "Project/Maps & Modes," then set the Game Default Map to "NewMap."
  12. Switch to "Project/Packaging" and set "Blueprint Nativization Method" to "Inclusive."
  13. Switch to "Engine/Streaming" and set "Async Loading Thread Enabled" to "True."
  14. Close the Project Settings window.
  15. Choose File->Package Project->Windows->Win64 and choose a location to save.
  16. Wait for packaging to finish.
  17. Navigate to your project's Intermediate/Plugins/NativizedAssets/Windows/Game/Source/NativizedAssets/Private folder, and open the "NewWidgetBlueprint_pf*.cpp" file in a text editor.
  18. Search for "EaseInFunction".
  19. Note that the generated code is using "NewObject" to instance this subobject. This is incorrect as this subobject is already going to be instanced by native engine code in the UMovieSceneSection ctor (see MovieSceneSection.cpp).
    Expected result: The generated code should be using GetDefaultSubobjectByName() to access class-owned nested subobjects that already exist from native engine ctor code.

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.224.234.24
Target Fix4.25
Fix Commit11060342
Main Commit11254295
CreatedJan 18, 2020
ResolvedJan 18, 2020
UpdatedFeb 5, 2020
View Jira Issue