auto-git:

[change] src/commands/apply-terrain-brush-patch-command.ts
 [change] src/core/terrain-brush.ts
 [change] src/document/migrate-scene-document.ts
 [change] src/document/scene-document.ts
 [change] src/geometry/terrain-brush.ts
 [change] src/geometry/terrain-mesh.ts
This commit is contained in:
2026-05-02 11:24:29 +02:00
parent 47defd9e03
commit e9adf9f37e
6 changed files with 166 additions and 19 deletions

View File

@@ -51,7 +51,8 @@ export function isTerrainBrushPatchEmpty(patch: TerrainBrushPatch): boolean {
return (
patch.heightSamples.length === 0 &&
patch.paintWeights.length === 0 &&
patch.foliageMaskValues.length === 0
patch.foliageMaskValues.length === 0 &&
patch.foliageBlockerMaskValues.length === 0
);
}
@@ -89,7 +90,10 @@ export function createApplyTerrainBrushPatchCommand(
paintWeights: options.patch.paintWeights.map((entry) => ({ ...entry })),
foliageMaskValues: options.patch.foliageMaskValues.map((entry) => ({
...entry
}))
})),
foliageBlockerMaskValues: options.patch.foliageBlockerMaskValues.map(
(entry) => ({ ...entry })
)
};
let previousSelection: EditorSelection | null = null;
let previousToolMode: ToolMode | null = null;
@@ -167,6 +171,21 @@ export function createApplyTerrainBrushPatchCommand(
}
}
for (const entry of patch.foliageBlockerMaskValues) {
assertValidPatchEntry(
entry,
terrain.foliageBlockerMask.values.length,
"Terrain foliage blocker mask"
);
terrain.foliageBlockerMask.values[entry.index] =
direction === "forward" ? entry.after : entry.before;
renderDirtyBounds = mergeTerrainSampleIndexIntoBounds(
renderDirtyBounds,
terrain,
entry.index
);
}
markTerrainRenderSamplesDirty(terrain, renderDirtyBounds);
context.setDocument({