From 26c9653668cb9571828a19dad7b6d05c2382beb3 Mon Sep 17 00:00:00 2001 From: luciano Date: Fri, 31 Jul 2026 17:15:38 +0200 Subject: [PATCH] Deactivate button for the 3D effect 'Disattiva' in the Animazioni 3D tab restores the last non-3D preset (tracked by applyEffect), answering 'how do I turn the 3D output off' without hunting through the effect library. Co-Authored-By: Claude Fable 5 --- src/control.html | 9 +++++++-- src/control.js | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/control.html b/src/control.html index e34702d..360c3f9 100644 --- a/src/control.html +++ b/src/control.html @@ -158,9 +158,14 @@ - +
+ + +
Le famiglie 3D vivono qui (non più nella libreria Effetti): - “Modello 3D” balla da solo a tempo; le “Interattivo” usano la camera.
+ “Modello 3D” balla da solo a tempo; le “Interattivo” usano la camera. + “Disattiva” ripristina l'ultimo effetto normale (equivale a scegliere + un preset dal tab Effetti).
diff --git a/src/control.js b/src/control.js index 501de6d..46ada5b 100644 --- a/src/control.js +++ b/src/control.js @@ -8,8 +8,10 @@ const filePath = (f) => djv.pathForFile(f); // ---------------------------------------------------------------- effects const EFFECTS = window.EFFECTS; let currentEffect = EFFECTS.list[0]; +let lastNon3d = EFFECTS.list[0]; // to step back out of the 3D families function applyEffect(effect) { + if (!effect.isModel3d && !effect.isInteractive) lastNon3d = effect; currentEffect = effect; send({ type: 'effect', effect }); $('#scene-name').textContent = effect.name; @@ -354,6 +356,7 @@ fill3dPresets(); fam3dSel.addEventListener('change', () => { fill3dPresets(); apply3d(); }); pre3dSel.addEventListener('change', apply3d); $('#glb-effect-go').addEventListener('click', apply3d); +$('#glb-effect-off').addEventListener('click', () => applyEffect(lastNon3d)); $('#btn-glb-load').addEventListener('click', () => $('#glb-input').click()); $('#glb-input').addEventListener('change', async (e) => {