Scenes: a run resumed inside a hold plays its layers on from that moment

After placing the layers at the seek's moment, the hold settles them
without the seek, so the reveal continues from where the seek put it and
a clip the moment falls in starts again from its beginning (a clip
cannot be joined partway); one the moment is past stays finished.
This commit is contained in:
Sameh Khamis committed 2026-11-16 13:54:40 -08:00
1 parent 87b6a4d0c8
commit b2c7144cce
6 files changed
+127 -28

No files matched your search

+7 -1
View File
@@ -2152,7 +2152,7 @@ test('a run resumed inside a flight goes on from that point of the path and cloc
} finally { await director.destroy(); restoreFrames(); restore(); }
});
test('a run resumed inside a hold keeps the seek’s layer state and waits only the rest of it', async () => {
test('a run resumed inside a hold plays its layers on from the seek’s state and waits only the rest of it', async () => {
const project = structuredClone(PROJECT_FIXTURE);
project.scenes[0].shots[0].holdSec = 0.6;
const { director, viewer, restore } = makeDirector({ project });
@@ -2196,6 +2196,12 @@ test('a run resumed inside a hold keeps the seek’s layer state and waits only
assert.equal(seekStates.length, 1, 'shot A’s layers are given the moment');
assert.equal(seekStates[0].shot.id, 'shot-a');
assert.ok(Math.abs(seekStates[0].options.sceneSeek.holdElapsedSec - 0.4) < 1e-9);
// Then they play on from that moment: shot A settles without the seek.
const after = layerCalls.slice(layerCalls.indexOf(seekStates[0]) + 1);
const played = after.find(({ shot }) => shot.id === 'shot-a');
assert.ok(played, 'shot A’s layers go back to running playback');
assert.equal(played.options.cameraSettled, true);
assert.equal(played.options.sceneSeek, undefined);
} finally { await director.destroy(); restore(); }
});
+6 -4
View File
@@ -5,7 +5,8 @@ import { displaySceneTitle, displayShotTitle } from './recipes.js';
/**
* A run resumed partway into its first shot carries the seek state of that
* moment (`resume`). Inside the shot's hold, its layers take that moment's
* state as a seek gives it, and only the rest of the hold is waited out; inside
* state as a seek gives it and then play on from it, and only the rest of the
* hold is waited out; inside
* its flight, the camera goes on from where it is along the rest of the path.
*/
const inHold = (resume) => resume?.holdElapsedSec > 0;
@@ -101,9 +102,10 @@ export function createScenePlaybackAdapter(
director._publishShotTravel(scene, shot, travel);
return flight;
},
settle({ scene, shot, token, resume }) {
// Resumed inside the hold, the layers already hold that moment's state.
if (inHold(resume)) return;
settle({ scene, shot, token }) {
// Resumed inside the hold too: the layers placed at that moment go back
// to running playback from it. Their reveals go on, and scene media
// starts its clip again, since a clip cannot be joined partway.
director._settleShotLayerStates(scene, shot, token, travel);
},
hold({ scene, shot, token, resume }) {