UE4 Asset Directory Listing Blueprint

So I needed to be able to, in game, get listing of asset directories and assets in a folder style.  The purpose is to let me make on-the-fly menu selections of something like 10000 assets in game and do it fast.

Turns out in UE4.25 you can do all of this in blueprints.

The low level problem is that assets get packaged into .pak files when you ship the game.  Regular C++ style file and directory operations will not find any assets.  Instead there is the Asset Manager.

Assets are bundled as assets and are not in a directory structure in the pak file.  The path to an asset is in effect just a string.  So the over all flow is...


  1. Load all the assets under one or more asset directories.  When the game is packaged what was something like Content/DefaultObjects/Trees becomes /Game/DefaultObjects/Trees.
  2. When you want to ask "What sub directories and assets are in /Game/DefaultObject/Trees you call my blueprint node.  It returns a result structure with a list of string for subdirectories, and a list of strings for assets.
  3. Be very sure to check the check box for Cook everything in the project content directory (ignore list of maps below).  When a game is packaged the default is to only package assets that are actually used in the game.  So that checkbox tells it to package everything regardless.
The blueprints:






















Comments

Popular posts from this blog

Subsumption and Neural Hiding - The 'Object Oriented Paradigm' of Artificial Intelligence

Self Cycling Asynchronous Neural Systems