Hi,
In my game I have a dynamic list of all static meshes (I call them products in this project) from given path. I use this code to gather the meshes:
TArray<FAssetData> Assets;
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
FARFilter ARFilter;
ARFilter.ClassNames.Add(UStaticMesh::StaticClass()->GetFName());
ARFilter.PackagePaths.Add(PRODUCT_PATH);
ARFilter.bRecursivePaths = false;
ARFilter.bIncludeOnlyOnDiskAssets = true;
AssetRegistry.GetAssets(ARFilter, Assets);
PRODUCT_PATH is a path that should contain static meshes I’m interested in. So the game will first look in /Game/Products
directory and the check out the content-only-plugin directory that will be used as DLC - /NewProduct
It works fine the editor and in shipped build. What I want to do is create a DLC that would contain one or more products (static meshes).
So to do that, I followed tutorials on packaging and finally got my first DLC with a single product deployed in small .pak file. Next step is to apply the DLC, so I rename it, and copy/paste it into shipping build directory next to main .pak file.
It should work right?
Well, it doesnt.
For some reason AssetRegistry does not detect that new DLC/file was added and does not refresh itself. Content in DLC is just nowhere to be found by the code I posted above.
Whats interesting is that if I put a new map (level) into DLC and try to open it in shipped build it works just fine.
Am I missing something?