Get all MediaPlayer assets in Blueprint

Is there a way to fetch all MediaPlayer assets in blueprint?

I did went throught this documentation:

but it only explains how to get a particular MediaPlayer as a variable in blueprint.

What I would like to do is to automatically fetch all MediaPlayer assets in a project (regardless of how many there are) and store them in a MediaPlayer matix so that they can be maniuplated later. How can this be done?

I don’t think currently there is official way to access asset registry from blueprint (system that keep tracks assets as when they are not loaded they don’t have object in memoery so reflection system can’t track it), you would need to use C++, here docs about it:

Try searching by “asset registry” maybe someone binded those APIs to blueprint

Thank your for your answer.

The link you provided looks promising,

Is it possible to do this:

  • create my own C++ class with function GetAllMediaPlayers() that gets all MediaPlayer assets
  • create MediaPlayer objects form fetched assets and return them as array od MediaPlayer
  • expose this class and function in blueprint and then use it in blueprints

?

I know how to create a C++ class and expose it in blueprint, but I wonder if there could be some problems with exposing in runtime the MediaPlayer objects I created in GetAllMediaPlayers() function?

(I’m a newbie to Unreal Engine so forgive me if I’m asking some obvious questions)

  1. Ofcorse you got “Get All Actors of Class” node that does that isn’t?
  2. Loaded assets are objects, once asset is loaded it’s object in memory which can be used in code. Same as you set Texture varable in blueprints for example, if you set it in defaults it will load when blueprint is loaded and you can call functions on it.
  3. Ofcorse, 95% of nodes in blueprints are exposed C++ functions.

You won’t be creating any objects, again once you load asset via asset registry it will be object in memory and API should give you pointer to it

late, but will reply that “get all actors of class” gets actors in the current level, not assets from the “content browser”. I’m in a situation where I am making arrays and maps of assets in the Game Instance blueprint, but (for a purposly-designed–for release on marketplace–blueprint-only project) would love a system to slurp them up automatically.

Hi Todd.

In the meantime I completely forgot about this question but also found a way how to load assets vi Blueprints. I haven’t tried it with media assets but had success with meshes and materials. If you want I can try to help you with your project…

Since I typed the response, I came up with a working method (though a bit kludgy)—python scripts to scrape the directories and make data tables (.csv files) to reimport. I got it working on textures, meshes, and materials so far, and based on that, “should” work on about everything. UE4 does allow data table specification of assets by properly-formatted strings, like: Material’/Game/ClassicFPS/Effects/Materials/Decals/M_Bullethole_Master.M_Bullethole_Master’ which the python scripts can construct from directory entries. The only downside is when I release to the public, a person wanting to add new assets would need to install Python to run the scripts, either that or modify the data tables by hand.

Based on what I have tried, in UE 4.19 you should be able to load assets from a folder via Blueprints (in my case it works for materials and meshes).
If you share your code with me I can see if I can help you with your case.