fix: restore custom bed texture after undo/redo (#11211)#11251
Conversation
The custom bed (logo) texture filename is not part of the undo snapshot, so it is lost when the part plates are rebuilt on deserialize — the custom bed background disappears after an undo. Re-apply it from the config (which is not part of the model undo stack) in update_after_undo_redo via set_bed_shape(); when the bed shape itself is unchanged this only re-sets the logo texture filename, so it is cheap. Fixes bambulab#11211
|
Hello, could you show the before and after comparison? It can be a picture or a gif, thanks. |
Haidiye00
left a comment
There was a problem hiding this comment.
Hello, could you show the before and after comparison? It can be a picture or a gif, thanks.
|
Here's the before/after (#11211): Before: set a custom bed (logo) texture, then do any edit and press Undo (or Redo). The custom bed texture disappears and the bed falls back to the default - the logo is gone until you reload the project. After: the custom bed texture is preserved across undo/redo. Root cause: the custom bed/logo texture filename isn't part of the undo snapshot (it's not serialized by Repro: load a custom bed texture → move/edit an object → Undo → (before) texture gone / (after) texture stays. Same caveat as my other GUI PRs: no build environment here, so this is traced from code rather than a recorded GIF. Can add a capture if a maintainer build is handy. |
Summary
The custom bed (logo) texture disappears after an undo (#11211).
Root cause: the plate logo texture filename (
PartPlate::m_logo_texture_filename) is not part of the undo snapshot —PartPlateList::serializedoes not include it and the per-plateserializeis commented out, so when the plates are rebuilt on deserialize the texture filename is lost.update_after_undo_redo()never re-applies it.Fix: re-apply the bed texture from the config (which is not part of the model undo stack and therefore survives the undo) in
update_after_undo_redo()viaset_bed_shape(). Its internal guard only re-sets the logo texture filename when the bed shape is unchanged (the common case for a model-level undo), so this is cheap and does not rebuild the bed geometry.Fixes #11211