Place foliage only on Static Meshes with a specific Material (Foliage tool, PCG?)

I am trying to spawn foliage on many static meshes, but only on one Material.

My scenario is quite a huge area more than 1km2 with thousends of Static Meshes, some of them have a specific Material applied, now i want to have differend kind of foliage on top of these meshes.

To thest things i have a new world with a landscape and 3 cubes, two of them have the material “foliage” applied (its only a green colour), now i want to place grass on top of the two cubes with the “foliage” Material.

I have two ideas on how to do it:

  1. I can turn off the collision for everything, select the Meshes that the material is applied to (with select referenced assets), turn collision on for those and paint with the foliage tool.

  2. I am trying to use PCG. As far is i found out, i can use the “World Ray Hit Query” with an “Actor Tag Filter” (there i would need to tag each Static Mesh with the material), then i can use the “Surface Sampler” and a “Static Mesh Spawner”. This method works fine if the PCGVolume is small, but if i try to scale it to cover the hole world the Surface Sampler has an “Error: Skipped - tried to generate too many points” and “Warning: Input data is not bounded, so bounds must be provided for sampling”.
    The difference is only the scale of the PCGVolume. While i scale it up everything works, amound and location of the placed gras stayes the same until a certain scale where the PCG tries to generate over 300.000.000 points. Maybe there is a way that the points aro only generated on the rayes that hit the taged static meshes.

Is there a way to solve the error in the PCG methode, or maybe someone has an idea on how to place foliage differently only on one material : )