From c2c4a1852750ae00fdc12009ac30b36b1fd9ffa9 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 2 May 2026 11:27:21 +0200 Subject: [PATCH] Integrate foliage blocker mask values into viewport state and brush logic --- src/viewport-three/viewport-host.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 7882209a..ebc132ce 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -10025,6 +10025,9 @@ export class ViewportHost { const heightSampleIndices = new Set(activeStroke.heightSampleIndices); const paintWeightIndices = new Set(activeStroke.paintWeightIndices); const foliageMaskValueKeys = new Set(activeStroke.foliageMaskValueKeys); + const foliageBlockerMaskValueIndices = new Set( + activeStroke.foliageBlockerMaskValueIndices + ); const mergeStampIndices = ( result: { heightSampleIndices: readonly number[]; @@ -10033,6 +10036,7 @@ export class ViewportHost { typeof applyTerrainBrushStampInPlace >["foliageMaskValueIndices"]; foliageMaskValueKeys?: readonly string[]; + foliageBlockerMaskValueIndices?: readonly number[]; } ) => { for (const sampleIndex of result.heightSampleIndices) { @@ -10055,6 +10059,10 @@ export class ViewportHost { for (const foliageMaskValueKey of result.foliageMaskValueKeys ?? []) { foliageMaskValueKeys.add(foliageMaskValueKey); } + + for (const maskIndex of result.foliageBlockerMaskValueIndices ?? []) { + foliageBlockerMaskValueIndices.add(maskIndex); + } }; if (!cancelled) { @@ -10110,7 +10118,8 @@ export class ViewportHost { changed && (heightSampleIndices.size > 0 || paintWeightIndices.size > 0 || - foliageMaskValueKeys.size > 0); + foliageMaskValueKeys.size > 0 || + foliageBlockerMaskValueIndices.size > 0); const toolState = this.activeTerrainBrushStroke.toolState; this.activeTerrainBrushStroke = null; this.terrainBrushPreviewGroup.visible = false; @@ -10127,7 +10136,8 @@ export class ViewportHost { paintWeightIndices, foliageMaskValueIndices: [...foliageMaskValueKeys].map( parseTerrainFoliageMaskValueKey - ) + ), + foliageBlockerMaskValueIndices: [...foliageBlockerMaskValueIndices] }); const committed =