Apply Dynamic Material Instance to multiple Static Mesh Components

Hey ClockworkOcean!

I think I figured it out. Instead of Static Mesh Component I used the ‘Get Components By Class’. The only thing I need to figure out is why a few meshes are not being affected, which is weird because I have applied the Dynamic Material to those Static Mesh Components.

image

I hope this helps someone with the same issue.

2 Likes

is it not applying at random, or is it not applying on a per actor basis?

Its suppose to apply to all actors that have a Dynamic Material Instance or in my case Static Mesh Component since I converted meshes to BP. BP is within the converted BP I created. I am trying to control these meshes but I still see a few that are not being affect by my fade effect.

Do those components have more than one material slot?

Yes, but I have applied the same Dynamic Material. Some have three material slots with the same dynamic material applied. Would it be an issues if the mesh had different materials? Also, I should of mentioned that these were imported using datasmith plugin. Not sure if that makes a difference.

1 Like

in the case of 2 or more slots, are you applying with multiple set material nodes, each one pointing to a different slot?
for example a set material with element index 1 and a set material with element index 2 (or use a for loop to do this)

I’m using a For Each Loop.

Current BP:

I had it split using sequence, wanted a more optimized BP. ClockworkOcean helped me out with that.

Initial BP:

you are using a for each loop for each component, but each component may have multiple slots. you can do something like this.

This is my setup. Am I suppose to be using the Create Dynamic Material Instance with Parent Reference? It sets all my components to that specific material instead of maintaining the other materials.

Also, what did you mean “you are using a for each loop for each component”?

from what i can see, your setup looks good.
for this tho;

It sets all my components to that specific material instead of maintaining the other materials.

isnt this what you wanted? or did you want it to set each component to have a different material or something?

Also, what did you mean “you are using a for each loop for each component”?

oops misspoke. i meant to say “you are using a for each loop to get a reference of each component, but each component may have multiple slots”

I am trying to apply a fade affect to the whole structure while maintaining the materials. Would look weird with everything being the same color.

Ex. of materials I have:

This is what I was using before. Was trying to avoid applying static mesh components manually.

isnt this what you wanted? or did you want it to set each component to have a different material or something?
Yes, wanted to set each component to have a different material. Each material will have more than one component. Is there a way to do that?