"Failed to find object" for UBlueprint pointers in 4.15P standalone

On 4.15 release, on packaged / standalone game, it appears UBlueprint pointers in assets are being corrupted.

Our project uses DataAssets to store data on gameplay objects. One of the properties is a link to a Blueprint actor.

UPROPERTY(EditAnywhere, Category = Content)
UBlueprint* Template;

I then use this to spawn the Blueprint actor from C++, using Template->GeneratedClass as a class. This design enables a clean interface to create gameplay objects and link them with a skin, and has been working for a few years now. It also works in PIE, even on 4.15.

But on packaged 4.15 builds, the “Template” attribute becomes invalid. “check(Template)” will fail, and Template->GeneratedClass will raise a segmentation fault. The logs will also be spammed when the DataAssets are loaded. See below.

LogUObjectGlobals:Warning: Failed to find object ‘Object /Game/Ships/Templates/BP_Dragon.BP_Dragon’

I have ensured that the missing Blueprint objects are indeed existing in the game at load, using the asset registry. All Blueprint actors are accounted for, so the packaging process has correctly packaged them.

const IAssetRegistry& Registry = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry").Get();

TArray<FAssetData> TemplateList;
Registry.GetAssetsByClass(UBlueprint::StaticClass()->GetFName(), TemplateList);

// All missing Blueprint assets are indeed present in TemplateList

From what I can gather, it looks like UBlueprints pointers are corrupt at load, while the asset itself is present.

EDIT : mark this bug as UE Release, not Preview.

You say this used to work before, so just something to check, especially if it’s been a while since this was set up.

You are using a UBlueprint pointer directly. Normally blueprint assets themselves are not packaged - only the generated classes.

There is a flag in DefaultEditor.ini that changes this: [EditoronlyBP] bDontLoadBlueprintOutsideEditor=

It must be set to false for UBlueprint objects to be packaged, otherwise, those objects in the asset registry are probably the generated classes. (Not familiar with the registry, myself)

We had this issue and set this flag for a while to fix it, until we had the time to transition to using the actual generated class via a base class ptr.

Hopefully that’s your issue, too!

Thanks ! I tried that, but unfortunately, it doesn’t work. :frowning:

It appears that bDontLoadBlueprintOutsideEditor isn’t referenced in the engine source, and EditoronlyBP is marked as removed in the release notes from 4.15. It does like like those changes are linked to my issue.

I’m going to try using the generated class.

Well, moving to UClass instead of UBlueprint fixed it.That was good advice. Thanks !

Gosh… spend three days on this issue.

Same thing for me, bDontLoadBlueprintOutsideEditor =false is corrupted for 4.15 and our packaged game couldn’t load anything.

Trying to move to UClass but ■■■■… that’s a lot of relinking stuffs for us.

Yeah, following up on the above comment (we are still stuck with 4.14 for a while), it was marked as deprecated some time ago. Looks like they finally removed it in 4.15.

condolences :frowning:

An actual error would have been nice - or even to just not compile UBlueprint* in !editor code.