How do I set a dynamic material instance on all LODs of Static Mesh Component

Is is possible to set one dynamic material instance across all LODs of a static mesh?

Yes, assuming that the mesh’s LODs use a similar unwrap or texturing scheme. All you need to do to get this to work is in your BPs treat the Material Elements as consecutive numbers. So If you have a Box with 2 LODs and each LOD has 6 materials assigned (one for Each face) then to set the MID for the second LOD you would start at Element Index 6 (Element Indices begin at 0).

In a BP Construction Script you would need to create a Dynamic Material Instance then separately Set Material for each of the Element Indices.

Thank You

Eric Ketchum

Make and array and add one pin for each LOD you have on your mesh.
Then connect it to a ForEachLoop and link the for each loop array index to the Create Dynamic Material Instance element index. It will run your graph for each LOD you have on your mesh.

I am having some trouble following these instructions. I have a model of a book which has 2 LODs. Each LOD has 1 material element, so a total of 2.

If I am understanding the above suggestions, I should have the first LOD be set to Element 0, and the 2nd LOD to Element 1. However, everything I’ve tried results in both LODs using element 0. Is there a way I can force one of them to be Element 1? What am I missing here?

Hi Hyperspaien -

If you place your mesh into a Blueprint (I am assuming you are in 4.10.), you will see a setup in your details panel that looks like this:

You will see on the side that there is an Element 0 and an Element 1. In your Construction Script you will want to follow a setup similarly to this:

Hopefully the images help clarify, but if not, I have also attached a small test project below for you to take a look.

Thank You

Eric Ketchum

[Test Project 4.10.2][3]

Thank you. My problem was that I was looking in the Static Mesh Editor and noticing that each of my materials was listed as Element 0, but as you pointed out, in the blue print editor one of them has changed to Element 1. I tinkered with my blueprint and it works now, so thanks =)