Download

Custom Opacity for many objects

Hi all,

I’d like to reuse a Material for different object, each with a unique opacity, rather than having to create a bunch of Material Instances for every possible opacity value I may need. Is there a way to set the rendering opacity of an object in the scene / object details / matinee timeline / etc. rather than creating a unique Material Instance for it?

Thanks for any help!

Customizing rendering parameters is what material instances are for.

However, you don’t need to create the dynamic instance as a material in the content browser; you can create it for the object in the blueprint in the event construct handler, for example.

Ah I see, thanks jwatte! I totally misunderstood Material Instances

For others with this problem:
In my material I hooked a Parameter to Opacity and created a Material Instance of this material.

I then created a blueprint with a “Set Scalar Parameter Value on Materials” and promoted the “Parameter Value” To a Variable.

Now I can drop the blueprint into my scene and change the Mesh, Material, and my custom Opacity Variable.

Oh follow up question -

I have my material set up so that I can change the opacity with a “Set Scalar Parameter Value on Materials” function which is really fantastic. I’d also like to set a TextureSampleParameter2D parameter to change the texture within the Material Instance. Is this possible to achieve? The closest I’ve found is “Set Material”, but this replaces the Material Instance rather than just the texture.

Thanks again!