How to get a material's base color parameter from a static mesh

Hey guys,
How to get the base color parameter information from a static mesh, in blueprint?
From my understand, it should be like :
cube → Get Material → Get scalar parameter (with “Base Color” as name)
However, seems it is not so straight forward, after “Get Material”, I have no idea which node should be in next.

Thanks for any help!

I think it should work on two conditions:

  1. The base color IS a parameter

  2. You use a vector variable, not scalar

EDIT: Yes, this works:

315821-mat.jpg

Sorry, no way I know of. You’ll find your cast is failing there…

Because it’s not dynamic, it hasn’t been assigned at runtime.

If you want to have various meshes around the level and at some point want to know what material / color they are, it’s much easier to make them a BP and use an integer parameter to denote the color.

the “cube” has been assigned a material instance

Then, make sure to check the parameter in the material instance:

315827-0.jpg

And then:

PS: This is ugly. Not sure if this is the right way.

Thanks for the answer !
However in my condition, the “cube” already have a material instance, and I am trying to find the way to get the color parameter from the exist material instance.
So maybe my question should be: how to get dynamic material instance from static mesh?
Here is the method I use:

And the cast will be failed.

PS: the “cube” has been assigned a material instance, which has parameter called “Base Color”

315818-2.jpg

Works like a charm!

Hay,
Why can’t I access the pages linked in the above ansers ?

Hey guys…
Why I can not open any png attached? I have always message: OOPS! THE PAGE NOT EXIST OR IT IS PRIVATE
For only png…
Thanks