How to read BaseColor from a Material in Blueprint(NOT PARAMETER)

Hello,

Is there a way to get the BaseColor value from a material in blueprint? I DON’T MEAN A PARAMETER for BaseColor, I mean the actual vector3 value for BaseColor. This is because I’m adding StaticMeshActors in my scene to an array and for each of them I need to read their BaseColor values to use as a variable for individual dynamic material instances later on.

Thank You.

1 Like

you want to read the data that is used in the material from blueprint?
i don’t think that is possible beside using RenderTargets. the opposite whoever is possible

BaseColor is not necessarily a single color. If it is defined in the material, there is no easy way getting it since it resides on the gpu. Here is my silly solution if you absolutely must have it AND you don’t care about performance AND your BaseColor is indeed a single color AND you want to do it in blueprint only: apply the material to a quad mesh, use a SceneCapture with BaseColor as Capture Source and a 1x1px render target, “Capture Scene”, read back the render target to main memory and get the pixel value (“Read Render Target Pixel”). The result will be 8 bit and you might need to undo the color transformation to sRGB. :wink:

Alright, thanks regardless.

Yeah, doesn’t seem like an plausible solution performance wise. I haven’t coded anything in C++ for a while and don’t wanna risk bricking anything. Never mind then, I’ll just resort to some…less than ideal measures. Thanks.