[break] feat(terrain): add default layer creation and paint falloff - #940
Merged
Conversation
- addLayer with no layer argument falls back to a CLI-owned built-in Texture2D and material defaults, throwing TerrainLayerError when the internal asset is unavailable - persist Paint circle-brush falloff (clamped 0..1) across image-brush selection via getTerrainPaintBrushState - type the terrain gizmo: drop `as any` casts, add Camera.getCamera, Terrain manager/isTerrainChange module augmentation, blockCount tuple
stanleyljl
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and fixes to the camera and terrain editing systems, focusing on type safety, extensibility, and better state management for paint brushes and layers. The changes include new and refined TypeScript interfaces, improved runtime type safety, and enhanced API flexibility for terrain and camera services.
Camera Service Improvements:
getCamera()method to theICameraServiceinterface and its implementation, allowing safe access to the editor camera instance. The camera reference is now optional, and all usages are updated accordingly. [1] [2] [3] [4] [5] [6]Terrain Paint Brush and Session State:
ITerrainPaintBrushStateandITerrainPaintBrushPatchto explicitly support afalloffproperty for paint brushes, improving type safety and clarity. All relevant state and session patch interfaces are updated to use these types. [1] [2] [3] [4] [5]falloffvalues, ensuring consistent UI and editing behavior. [1] [2] [3] [4]Terrain Layer and Service API:
addLayermethod inITerrainServicenow accepts an optional layer argument, defaulting to built-in values when omitted, enhancing API flexibility. [1] [2]TerrainLayerErrorand error code types to standardize error reporting for layer authoring failures.Runtime and Type Safety Enhancements:
Terraincomponent for editor integration, improving type safety and maintainability. [1] [2]Miscellaneous Fixes and Refactoring:
File Formatting
These changes collectively enhance the robustness, maintainability, and usability of the camera and terrain editing subsystems.