Preview: reuse a belt print's toolpaths until the view is toggled

load_as_gcode() skips the conversion and GPU upload when it is handed the
result it already shows, but belt printers were exempt from that cache,
because the designed/raw view changes the toolpath geometry for the same
result. So every preview reload of a belt print, switching back to the
Preview tab for one, converted and uploaded every toolpath again.

Remember the view the result was converted for and reuse it while both
match. Toggling the view (B, the legend checkbox, the toolbar menu) still
converts again. The print config the back-transform reads cannot change
without a new G-code result, so the result id covers it as it does on any
other printer.

Suggested by raistlin7447 on #14394.
This commit is contained in:
harrierpigeon
2026-10-05 14:19:53 -05:00
parent 8d0608275b
commit 98c5eed4a6
3 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -373,7 +373,7 @@ void Preview::refresh_belt_view()
{
// Re-run the G-code preview conversion so the belt "designed view" toggle takes effect
// (the back-transform is baked into the toolpath geometry in GCodeViewer::load_as_gcode,
// and belt printers are exempt from the same-result-id load cache so the re-convert runs).
// whose same-result cache also keys on the view state, so the re-convert runs).
// Reset m_loaded_print to bypass the "already loaded" guard the way reload_print does, but
// keep the current layer (Z) range and only-gcode mode so the view doesn't jump on toggle.
m_loaded_print = nullptr;