Dynamic Material Instance not working on Material Billboard?

Hey everyone, I’ve been working with Dynamic Material Instances lately and noticed that they don’t seem to work on Material Billboards.
I have included a snapshot of the blueprint I’m using for this. This exact node network works fine on static meshes but when I try to apply it to a Material Billboard it doesn’t do anything at all.

Are there limitations in terms of what Dynamic Material Instances will work on or am I missing something?

1 Like

I am having the same issue.

I tried with a premade material.

I tried with one added after run time and even this didn’t work / update. Did error checking and they all returned true.

I was trying to create a health bar using the healthbar example to one of the mesh assets. I can manually change the health bar but when i try to do it in the blue print I get the same issue as the OP.

Even tried to add the Sprite in at run time and it did not show.

Any ideas ?

Looks like this is a bug.

Hi Erdrik ,there seems to be a bug
with doing this to a Material
Billboard atm. I’ll show this to the
programmers, for now if you are just
wanting to play around with changing
the materials, I would just do it on a
Static Mesh vs a Material Billboard. I
had never actually tried doing that on
a Material Billboard before, good
find!

This may not be the same cause originally, but based on the code in 4.6.1:

The UPrimitiveComponent SetMaterial method won’t work on this. UMaterialBillboardComponent has an array of FMaterialSpriteElement structures, named Elements, which is what you see and configure in the components view.

You could try to update a structure in this array, but the structure isn’t actually marked as BlueprintType, so you can’t create or interact with FMaterialSpriteElement structs in blueprints.

Even if you mark it as BlueprintType in the engine code, you’ll find that nothing changes. This is because changing the value doesn’t actually tell the component about the change to the structure.

UMaterialBillboardComponent has an AddElement method which does work, because it calls MarkRenderStateDirty after adding a new FMaterialSpriteElement element to the Elements array.

If you can manage to call MarkRenderStateDirty after changing anything in the Elements array, you should see your changes.

This issue has been resolved as of 4.7. They merged the PR I did.