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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user