Calling for engine adepts.
I’m making a plugin that creates K2Node based on other blueprints.
It doesn’t always work stably… But usually this doesn’t cause serious problems.
But recently I found a 100% way to break it (unfortunately )
Apparently the dependency tracking and loading object (blueprint compilation?) system doesn’t always work as I need it to.
If I open the persistence level immediately after loading the editor, I get this crash:
Assertion failed: !InClass || (InClass->ClassWithin && InClass->ClassConstructor) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3106]
Here are the dependencies:
If after loading the editor I immediately open the sublevel, or if before opening the Persistence level I open (load) the blueprint in which my node is located, then the problem disappears.
The crash only happens in the editor. In the build, everything works as it should.
The node stores a TSoftObjectPtr< UBlueprint >, and calls LoadSynchronous() when required.
I guess I need to somehow force the engine to load all blueprints that contain my nodes from the beginning, so that they don’t get compiled while other objects are loading.
I tried (probably incorrectly) to use Primary Assets - but the manager doesn’t exist yet at the loading stage of my plugin.
I would like to know how to do it correctly. Or maybe you have other versions of the origin/solution of the problem. I will be glad to hear them.
UPD2
CallStack.txt (13.9 KB)
MyFile.txt (369 Bytes)
Stop point:
Last stop point before crash:
Thanks in advance.
UPD
Also after loading some projects where my plugin is used, an error appears:
LogOutputDevice: Error: Ensure condition failed: QueuedRequests.Num() == 0 [File:D:\build\++UE5\Sync\Engine\Source\Editor\Kismet\Private\BlueprintCompilationManager.cpp] [Line: 1715]
But they are successfully built and work.