Skip to content

Fix regions silently failing to save after an interrupted brush stroke - #1008

Merged
TokisanGames merged 1 commit into
TokisanGames:mainfrom
sci-comp:fix-intercepted-operations
Jul 28, 2026
Merged

Fix regions silently failing to save after an interrupted brush stroke#1008
TokisanGames merged 1 commit into
TokisanGames:mainfrom
sci-comp:fix-intercepted-operations

Conversation

@sci-comp

Copy link
Copy Markdown
Contributor

If a brush stroke ends without stop_operation() running, the affected regions are left permanently flagged as edited. This means backup_region() skips them, which means they are never marked modified, never written to disk, and never recorded for undo operations.

This bug will help resolve sci-comp/scene-builder#34 in my level design asset, which is how I found this bug (it's easy to intercept Terrain3D operations when another plugin is listening for hotkeys).

@TokisanGames TokisanGames added bug Something isn't working important High priority labels Jul 26, 2026
@TokisanGames TokisanGames added this to the 1.1 milestone Jul 26, 2026
@TokisanGames

Copy link
Copy Markdown
Owner

Our environment artist has reported an elusive bug where sometimes regions get in a state where they won't save. We haven't been able to find the cause, so this is a very welcome contribution.

@TokisanGames

Copy link
Copy Markdown
Owner

Is it better to clear the flag, or is it better to call stop_operation() which will clear the flag and store the undo? 🤔

@sci-comp

Copy link
Copy Markdown
Contributor Author

would it be this simple? (updated the commit)

Comment thread src/terrain_3d_editor.cpp Outdated
If a brush stroke ends without `stop_operation()` running, the affected
regions are left permanently flagged as edited. This means
`backup_region()` skips them, which means they are never marked
modified, never written to disk, and never recorded for undo operations.
@sci-comp
sci-comp force-pushed the fix-intercepted-operations branch from 8c393c0 to e0108aa Compare July 27, 2026 14:52
@TokisanGames

Copy link
Copy Markdown
Owner

Excellent, thank you!

@TokisanGames
TokisanGames merged commit 39b8388 into TokisanGames:main Jul 28, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working important High priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scene Builder conflicts with Terrain3D, causing data loss somehow (???)

2 participants