How to control Material Instances from imported materials from Quixel Bridge via Blueprints?

Hey, everyone. I’m using surfaces imported from Quixel Bridge in Unreal Engine 5 and I’m looking into changing the Albedo Tint of the Material Instance. I’m kinda stuck and unsure if what I am going on the right direction.

What I did so far.

The parameters I am trying to access.

Thank you in advance!

You’re on the right track. But the tint is not a scalar, it’s a vector :slight_smile:

Thank you for the reply! Do I need to use the Set Material node and apply the dynamic material instance onto my mesh? Because whenever I do use the Set Material node I’m encountering an error “Accessed none trying to read property” :frowning:

You need to make the dynamic instance, and keep that in a variable, then set the parameter on that variable, like you have above.

You can’t just have a variable of the correct type, it has to be assigned to something, otherwise you get the ‘none’ error.

Thanks for this! Really helps. Also I wanted to do the change of the Albedo Tint on button pressed.

Is this correct?

That’s it. It works, right?

It doesn’t seem to work. :frowning: Does this have to do with my mesh inside a Blueprint?

Mine did. I’m gonna ask a silly question here. You did connect this?

image

( and are you still getting ‘none’ errors? )

Yup. I have it connected. :smiley:

But whenever I click the button I always get the “none” errors. :confused:

It’s because your mesh reference isn’t pointing at anything…

So you have the bed sheet mesh, and you want to change it’s color using a BP?

Yes, yes. Uhm, what do you mean by my mesh reference isn’t pointing at anything? :confused: Sorry for the question, still new to Unreal.

You have a mesh reference

but when did you tell the system which object this is?

( I’m thinking you didn’t )

You made a variable of type ‘BP bed blanket’, but how is unreal to know you don’t have 15 blankets in the scene? Which one are you talking to?

For now ( not the best answer ), you can use GetActorOfClass ( with BP bed blanket as the param ).

Thank you! The GetActorOfClass did it. :smiley: I can change the Albedo Tint now. Thank you very much!!

No worries.

In the end a more structured approach would help, but it depends on many things ( is it during play, or in editor, how does the interface work etc ).

I mean, you don’t want to write a different widget for every single thing you want to change :slight_smile:

1 Like

Hello! Sorry but I have another question. Do you happen to have an idea where I can change the selected actor to another actor via button press? In what I am working on, I have a BP_Blanket and I have another BP_Comforter. From the Blueprints above, this only affects the BP_Blanket but I want to also change the BP_Comforter. I have an idea that all the Blueprints are inside an Array and then a button is pressed I should increment it? Not sure if this is an idea solution since I think working with an array and once it gets bigger can give a performance hit.

Keeping an array to reference the actors will have no performance hit :slight_smile: