Painting foliage on SMs based on a texture mask

Is it possible to use the foliage paint tool to spawn grass only on specific areas on a static mesh based on a mask?

I’m trying to achieve this effect.

I’d like to be be able to restrict the foliage painting to spawn grass meshes only in the gaps between the stones in the texture.

I’ve done a workaround before in which I had a separate static mesh on top of the ground mesh. That second mesh was cut following the pattern of the texture and then I removed the stones to only keep the grooves. I painted on that secondary mesh and set it to not visible in game. This workflow was fine because it was a small diorama, but now I have to do it on an entire level and doing custom secondary meshes for all my ground pieces is not practical anymore.

I watched the procedural foliage volume video where Ryan Brucks show the procedural spawning using masks but that seems to work only with landscape layers and I can’t apply those to a static mesh. I was wondering if there was a similar way in which this can be done for static meshes.

Thanks in advance for any help!