Questions about Primary Data Assets.

I am using Unreal Engine 5.6.

I have a folder containing a number of primary data assets. In order for my game to be able to use them I need both

  • A project setting specifying the Primary Asset Type, the Asset Base Class, and directory to be scanned.
  • A Primary Asset Label. This specifies “Always Cook” and “Label Assets In My Directory”.

If I remove either of these then the assets are not found and my game fails to load them.

I also have a CommandLet. It uses exactly the same “Content” directory with all the same files. It has the same project settings. When I run the CommandLet I get an error message saying:

LogAssetManager: Display: Ignoring PrimaryAssetType DecorationDefinition - Conflicts with PrimaryAssetLabel - Asset: DecorationAssets

When my commandlet then tries to access the Primary Data Assets, I get this error:

LogAssetManager: Warning: Invalid Primary Asset Id DecorationDefinition:lit_torch: ChangeBundleStateForPrimaryAssets failed to find NameData

If I remove either the project setting or the Primary Asset Label, the first error goes away but the second remains.

So my questions are:

  1. Why do I need both the project setting and the primary data label asset in the game when they both seem to do the same thing?
  2. Why does having both generate the first error in the CommandLet but not in the Game?
  3. Why does the CommandLet not find the Primary Data Asset even though the first error message makes it clear that the asset manager is scanning the Primary Data Assets?

So…a partial answer.

UDecorationDefinition is a class shared between the two projects (game and commandlet) as part of an asset factory. In project A the class path is /script/A.DecorationDefinition. The AssetRegistry in project B can find these assets by using that class path, but the AssetManager will never ever accept them. Apparently.

Moreover, I will need to always make sure I add new data assets through project A or else I will get a nasty mix.

I don’t understand why other assets (static mesh, animation, blueprint, etc.) can easily be shared between projects, but data assets can’t. I mean I understand why, I just don’t understand why Epic designed it that way. And if they are going to do that then why can’t it scan and accept the assets into AssetManager?