scatter_foliage_on_layer
Scatter foliage only where a landscape paint layer's weight exceeds a threshold: sample candidate points in a box, place instances on matching areas, and reject the rest.
Instructions
Scatter foliage only where a landscape PAINT LAYER is strong enough: samples seeded candidates in a box, keeps those whose layer weight clears layer_weight_threshold, and rejects the rest -- so trees land on the forest layer and not on rock. The rule-driven sibling of scatter_foliage_in_box. DANGER: it reaches the same FFoliageInfo::AddInstance path that can crash the editor from its two sibling tools, so treat it as unsafe and prefer add_instanced_static_mesh_component + add_ism_instance (query the layer weight yourself) or a PCG graph. Save your work before calling it.
Returns: { applied, requested_count, instances_added, instances_rejected }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for deterministic scatter (default 1337) | |
| count | No | Number of candidate positions to sample (default 16) | |
| center | No | Optional [x,y,z] world center of the scatter box (default 0,0,0) | |
| extent | No | Optional [x,y,z] half-extent of the scatter box (default 500,500,0) | |
| layer_name | Yes | FName of the landscape paint layer (e.g. "Grass", "Forest") | |
| align_to_ground | No | When true, candidates placed at box-top Z so ground snap is meaningful | |
| foliage_type_path | Yes | Asset path of the UFoliageType (e.g. /Game/Foliage/BP_Tree) | |
| layer_weight_threshold | No | Minimum layer weight [0,1] for placement (default 0.5) | |
| landscape_name_or_label | Yes | Actor label (or name) of the target ALandscape |