Create a different Material Dynamic Instance at each iteration

Hello Everyone!

I’m developing an Archviz apartment configurator and i want to add a function where i can “copy” a material from any actor in the scene and “paste” it on any actor of the scene.

I created a variable where i store the source material actor (sourceActor).

When i want to past the material on a destination actor, i do the following:

  1. Get the sourceActor from the variable
  2. Get its material
  3. Create a dynamic material instance from the material
  4. Get destinationActor
  5. Set Material to the destinationActor

Everything is working fine. Problem is, when i try to change any material parameter (Base Color for example) on ANY of the actors (source actor or destination actor) all the other change accordingly.

Looks like they are synched.

How can i paste a “different” instance of the dynamic material? I want them to be independent from each other so that i can change paramters individually even after i pasted the source material on them.

Thanks!

so, the problem is youre creating a dynamic material instance in the source material and then setting that to the new material, presumably theyre both using the same material instance. just create two different material instances, and assign the first one to the source actor and the second one to the destinatino actor

Hi and thanks for your reply! What i do is create a dynamic instance on every “paste” action.
Everytime i need to paste i just get the source actor from my variabe and create a dynamic material from its material. I do this for every destination actor.

Issue seems to be the following: creating a dyn material from THE SAME actor 10 times, yelds the same dynamic material for each of the 10 iterations.
Is that possible?