How do I convert a MediaTexture into a new Material in BP?

I currently have a MediaSource, MediaTexture, MediaPlayer that I’ve created programmatically in my GameMode.cpp (where I import a file and then create those media assets from it).

I want to eventually have a Widget’s Image reflect this media content, so I know I need to use the FSlateBrush’ MakeBrush node. However, I can’t immediately pass in my MediaTexture to the “MakeBrushFrom Texture” node OR the “MakeBrushFromMaterial” because the types are wrong.

Could someone please teach me how to convert a media texture to EITHER a material OR a Texture2D? What nodes would be used ?

Thanks so much for your help!

Hi @MsRainwater

In the asset browser right click on the media texture and there should be a create material option. Then inside the material make sure you set the domain from surface to ui

Thank you for the response :blush: - well since I’m creating the media texture programmatically in C++, I don’t actually have access to it in the asset browser :sob:

Currently I managed to make a new material via the “Create Dynamic Material Instance”, use the Set Texture Parameter value, and then pass in Media texture, but it’s not showing up on the static mesh actor!


I did confirm that the Media Player and assets were working since the the Media texture preview reflected the media player’s contents.

If you are using it direct on a mesh then the material domain space needs to be surface, i thoight you was using it in UI widget. So make sure its set to the correct one