How to read BaseColor from a Material in Blueprint(NOT PARAMETER)
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.
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. ;-)
answered May 03 '19 at 10:59 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here