Make brush from material, how?
I have to create a widget button that allows the player to customize the material applied to a certain static mesh. The Button contains an Image in order to display a Slate Brush for preview purpose.
My question is: How can I create a slate brush starting from a material? I know that there is a function called Make Brush from Material, and the following picture shows how I'm using it
But unfortunatelly the result is an empy picture (transparent picture) as shown below:
The widget is correct because if I apply any other brush to the Image it works.
Also the input material is always valid and the Cast function never fails because of previous code not visible in the picture.
This is how one button should look like:
Am I using the function in the wrong way or it's a bug?
You are using a UMG and a UButton with a UImage.
The UImage can MakeBrushFromMaterial (c++: SetBrushFromMaterial) but it will not be visible as long as the Material's Domain is not "User Interface".
I have not found a way to dynamically set the "Material Domain" to a material.
I suggest refactoring the UI interaction.
Follow this question
Once you sign in you will be able to subscribe for any updates here