Paint on landscape through C++

Hello everyone,
i’ve been wondering if anyone could hint me into the right direction on this topic. I’m using the procedual foliage tool and what i want to do now after for example it placed the trees is paint the landscape under it with a certain layer. (E.g. paint a forest texture with leaves under each tree). I’m pretty sure somewhere in the engine this is a function that accepts all the parameters. So in pseudo-code i guess what i want to do is creating a function that does this

PaintOnTerrain(landscape_ref, position, brushtype, layernum, strength)

If i can build that function i can gather the foliage positions and parse it through that function. I know that the functionality is only in the editor but that’s fine, the function should be simply a tool to design the world.

Thanks in advance!

Small Update for anyone else interested :
Most of this functionality can actually already be done in Blueprints. Since i wasn’t able to find the function to paint on the terrain directly i altered my approach to draw polygons on a render texture which is then exported and used as a layermask for the terrain.

If you can do it in Blueprint, you can do it by code, isn’t it?