From d6088f8e355d64a2c15641c62dcc1251e2f490be Mon Sep 17 00:00:00 2001 From: gramps Date: Sun, 1 Nov 2026 15:59:10 -0800 Subject: [PATCH] fix(background): Use default background actually restores the shipped art MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Browse… writes the chosen picture into BOTH CustomBackgroundPath and AssetId, and the default stamp bails when AssetId is already set. So flipping "Use default background" back on changed a bool while the preview kept showing the custom image — it looked like the switch did nothing. Turning the default on now clears the custom pointer and the asset, re-runs StampDefaultBackgroundAsset for the scene's shipped art, and only then invalidates the bake, updates the preview and refreshes thumbnails. BackgroundTests pass (17); Release 0 warnings. --- ViewModels/MainViewModel.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index 33e7667..5817f58 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -107,6 +107,21 @@ public partial class MainViewModel : ViewModelBase { if (e.PropertyName == nameof(SceneElement.UseDefaultBackground)) { + // ⛔ Turning the default back ON has to RE-STAMP the shipped art. Browse… writes the + // custom image into both CustomBackgroundPath AND AssetId, so without this the toggle + // flipped a bool while the preview kept showing the custom picture — the setting + // appeared to do nothing (creator report, 2026-11-01). + if (StagedScene is { } scene) + { + var background = scene.Elements.OfType().FirstOrDefault(s => s.IsBackground); + if (background is { UseDefaultBackground: true }) + { + background.CustomBackgroundPath = null; + background.AssetId = null; // lets the stamp run + StampDefaultBackgroundAsset(background, scene.Name); + } + } + if (StagedScene != null) _sceneGraph.InvalidateBake(StagedScene); UpdateBackgroundImage(); RefreshSnapshotsAsync();