Create Material Instance for each selected Texture blueprint

Hey guys!

I’m trying to create a script in Unreal Engine 5, that creates a material instances (Based upon a master material) for each selected texture. I got the for loop down but I cant seem to find the node to use to create material instances that appear in my content browser.

To make it clear what I want: For each selected texture (array) create an material instance (in the Content Drawer) based on a master material, and set the selected texture to the first texture parameter of that instance.

Does anyone have an example of how to do it or which node to use? that would be amazing!

2 Likes

I solved it myself so I’ll post the solution here for anyone having the same problem:

Apperantly there is no node specifically for creating a material or material instance. Instead you need to use the Asset Tools. The node used for this is called “Create Asset” from which you can choose Material Instance as the Asset Class.

In my case I used the “Duplicate Asset” node to duplicate an already made Material Instance and from that new node I change its values to the textures I selected.

3 Likes

Hey @Doxul , just wondering how you were able to change the texture values after duplicating the asset?

EDIT: I figured it out. Out of the Duplicate Asset node, cast to Material Instance Constant, then you can set your parameter values from there.

3 Likes