How to make Material Slot accept "Materials" and "Material Instances"

I want to create a Blueprint containing a static mesh. When I place the blueprint on my map I want to be able to set the Material of the contained static Mesh, just as it would be possible when I had placed only a static mesh.
I created a Variable of Type “Material” and made it editable by clicking the small eye. Everything works fine exept that I can now only apply “Materials” to the now Visible slot, but not “Material Instances”. If I choose “Material Instance” as Variable type it is the other way around.
Is there a way to enable both types, so it works like a normal static mesh material slot?

Thanks for your help!
Cheers Michael

Do this in the Construction Script of your BP;


Drag the Material pin of Set Material node and then Promote to Variable, which will be the new material. Enable Editable and that’s it. If the mesh has multiple material ID’s you need to do this for each of them of course.

Thanks for your answer! That was exactly what I was looking for. Knowing that now, I could also do it manually by just setting the variable type to “Material Interface”.