Why not possible to Create Dynamic Material Instance from the existing material?

Create Dynamic Material Instance works as expected but only when you select parent material manually, by hand:

Work

Don’t work

Completely the same M_Test_Inst material but getting it from the existing mesh.

It is not allowed to make Dynamics from connected pins, or am I missing something?

Try to save it as variable before connecting it to the create node.

I tried, that is not the issue.

This is unexpected. The example shown works at runtime. Please share more info to narrow down your issue.

are you sure the element index is correct?
i’ve used that code multiple times.

Yes, me too. In this tested case the character mesh has a single slot. Are you having issues with multiple slots?

also some components (i think maybe primitivecomponent) have a function called the same or similar (like CreateDynamicMaterialInstance) which will try to create a DMI for the current assigned material. so it’s the same, but more efficient since it makes sure it does not create it twice.
so you can simply do Mesh->CreateDynamicMaterialInstance()

Indexes are correct and not the issue. Created Dynamic Material is dead right after creation:

Inputed Parent material is alright however.

What is the input of the create node? Get Material from a primitive component?
Have you seen this?

OMG OMG OMG!

There is actually the second function, completely identical name with different inputs, which unlike the other one - works:

Several hours just went to this…

Great, this is Unreal. Also, check the creation flag as transient and see if returns invalid.
Good luck.

1 Like