When using Material Blend Layers - if I have a scalar parameter, how can I modify that through blueprints?

Disclaimer - I know I how to make this effect by using curves and blueprints without using the Layers system, but I wanted to investigate the possibility of using MLB’s for this, as they are a very dynamic and flexible tool which I only recently got to be acquainted with.


Hey there!

I have myself a Material using the layers system, and I wanted to use a Material Layer Blend to drive an animation to smoothly transition between two material layers:

image

As you can see, I exposed a parameter called “Driver_Dissolve” - I intended to plug that parameter to a curve in a blueprint and have that change based on a timeline:

But unfortunately, when I start playing the game, I see no change in my materials - I can see that the timeline is running from 0 to 1:

image

So my hypothesis is that I can’t access the Scalar Parameter within my MLB??

Any input is appreciated, thanks!

UnrealEditor_rsKaMy9RUB

Massive thanks to user “Dan Gant” from the Unreal Source discord - who suggested that I used Custom Primitive Data instead of a regular Scalar Parameter:

image

The effect is now following all the features I initially wanted from it :slight_smile:

in the MLB, I set the parameter type to be a Custom Primitive data, and now it is possible to use a different blueprint node to control the parameter on runtime.
image
image

Thanks a lot for the community for helping me out, and I hope this post is useful for another dev in the future :slight_smile:

Update.: because the MLB is still not a literal part of the main material, it is necessary to copy-paste the scalar parameter as a Custom Primitive Data into the parentmost Material, with the same name. If your parentmost material DOES NOT contain the Driver parameter with the same setup, I believe the system falls apart because it can’t find a reference to the MLB’s CPD.

I’ll keep logging any other errors I find with this over here.