UE4 does not automatically load DataAssets which derive from a BP class, that in turn derives from UPrimaryDataAsset. Only when I explicitly tell it via the Asset Manager project settings it loads them on startup. Is there any way that I can make UE4 load ALL DataAssets that derive from a (BP class that derives from a) specific base class?
I currently have the following setup:
C++ class:
class UItemAsset : public UPrimaryDataAsset
Blueprint class:
BP_ItemAsset (parent: UItemAsset)
Data Assets:
IT_BTestItem (parent: BP_ItemAsset)
IT_CTestItem (parent: UItemAsset)
Now, when I freshly start UE4, the CTestItem is properly loaded while the BTestItem is not. I have to open BTestItem once in the editor before it becomes selectable anywhere (e.g. for Actors that have a pointer to ItemAsset).
Also, when opening the DataAssets in the editor, BTestItem does not even show the “Open ParentClass” that DataAssets usually do. Almost seems like a bug.
If I add another entry to the Asset Manager project settings with BP_ItemAsset as the “Asset Base Class” the BTestItem is loaded properly on startup. Simply adding the C++ class ItemAsset to the Asset Manager settings is not working. I plan to create several BPs that derive from the C++ ItemAsset and this would mean I’d have to add every single one to the Asset Manager, which seems unviable to me.
Is there any way to make UE4 load all DataAssets that have a specific base class somewhere in their inheritance chain?
(I set 4.22 which is my working version, but this problem is also prevalent in 4.26)
(Maybe this question is more fitting for the “Using UE4” section?)