@nodetool-ai/timeline 0.8.18 → 0.8.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.nodetool-build-stamp +1 -1
- package/dist/animation/custom.d.ts.map +1 -1
- package/dist/animation/custom.js +35 -0
- package/dist/animation/custom.js.map +1 -1
- package/dist/animation/sample.d.ts +14 -0
- package/dist/animation/sample.d.ts.map +1 -1
- package/dist/animation/sample.js +22 -1
- package/dist/animation/sample.js.map +1 -1
- package/dist/animation/types.d.ts +8 -1
- package/dist/animation/types.d.ts.map +1 -1
- package/dist/animation/types.js +31 -3
- package/dist/animation/types.js.map +1 -1
- package/dist/authoredStyles.d.ts +7 -1
- package/dist/authoredStyles.d.ts.map +1 -1
- package/dist/authoredStyles.js +6 -1
- package/dist/authoredStyles.js.map +1 -1
- package/dist/autoCrossfade.d.ts +30 -0
- package/dist/autoCrossfade.d.ts.map +1 -0
- package/dist/autoCrossfade.js +130 -0
- package/dist/autoCrossfade.js.map +1 -0
- package/dist/automation.d.ts +32 -1
- package/dist/automation.d.ts.map +1 -1
- package/dist/automation.js +78 -1
- package/dist/automation.js.map +1 -1
- package/dist/automationRanges.d.ts +375 -0
- package/dist/automationRanges.d.ts.map +1 -0
- package/dist/automationRanges.js +375 -0
- package/dist/automationRanges.js.map +1 -0
- package/dist/clipAudio.d.ts +3 -1
- package/dist/clipAudio.d.ts.map +1 -1
- package/dist/clipAudio.js.map +1 -1
- package/dist/clipLoop.d.ts +67 -0
- package/dist/clipLoop.d.ts.map +1 -0
- package/dist/clipLoop.js +339 -0
- package/dist/clipLoop.js.map +1 -0
- package/dist/clipSpeed.d.ts.map +1 -1
- package/dist/clipSpeed.js +7 -0
- package/dist/clipSpeed.js.map +1 -1
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +9 -0
- package/dist/defaults.js.map +1 -1
- package/dist/dropResolve.d.ts.map +1 -1
- package/dist/dropResolve.js +56 -17
- package/dist/dropResolve.js.map +1 -1
- package/dist/finish-storyboard.d.ts.map +1 -1
- package/dist/finish-storyboard.js +6 -1
- package/dist/finish-storyboard.js.map +1 -1
- package/dist/harmony/chordChart.d.ts +25 -0
- package/dist/harmony/chordChart.d.ts.map +1 -0
- package/dist/harmony/chordChart.js +99 -0
- package/dist/harmony/chordChart.js.map +1 -0
- package/dist/harmony/chordRange.d.ts +9 -0
- package/dist/harmony/chordRange.d.ts.map +1 -0
- package/dist/harmony/chordRange.js +32 -0
- package/dist/harmony/chordRange.js.map +1 -0
- package/dist/harmony/chordSymbols.d.ts +28 -0
- package/dist/harmony/chordSymbols.d.ts.map +1 -0
- package/dist/harmony/chordSymbols.js +147 -0
- package/dist/harmony/chordSymbols.js.map +1 -0
- package/dist/harmony/chordTrack.d.ts +13 -0
- package/dist/harmony/chordTrack.d.ts.map +1 -0
- package/dist/harmony/chordTrack.js +11 -0
- package/dist/harmony/chordTrack.js.map +1 -0
- package/dist/harmony/detect.d.ts +35 -0
- package/dist/harmony/detect.d.ts.map +1 -0
- package/dist/harmony/detect.js +138 -0
- package/dist/harmony/detect.js.map +1 -0
- package/dist/harmony/detectAudio.d.ts +62 -0
- package/dist/harmony/detectAudio.d.ts.map +1 -0
- package/dist/harmony/detectAudio.js +226 -0
- package/dist/harmony/detectAudio.js.map +1 -0
- package/dist/harmony/expand.d.ts +7 -12
- package/dist/harmony/expand.d.ts.map +1 -1
- package/dist/harmony/expand.js +63 -11
- package/dist/harmony/expand.js.map +1 -1
- package/dist/harmony/index.d.ts +7 -0
- package/dist/harmony/index.d.ts.map +1 -1
- package/dist/harmony/index.js +7 -0
- package/dist/harmony/index.js.map +1 -1
- package/dist/harmony/progressionLibrary.d.ts +33 -0
- package/dist/harmony/progressionLibrary.d.ts.map +1 -0
- package/dist/harmony/progressionLibrary.js +71 -0
- package/dist/harmony/progressionLibrary.js.map +1 -0
- package/dist/harmony/summary.d.ts +4 -0
- package/dist/harmony/summary.d.ts.map +1 -0
- package/dist/harmony/summary.js +22 -0
- package/dist/harmony/summary.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/interchange.d.ts.map +1 -1
- package/dist/interchange.js +3 -0
- package/dist/interchange.js.map +1 -1
- package/dist/keyframes.d.ts +12 -2
- package/dist/keyframes.d.ts.map +1 -1
- package/dist/keyframes.js +24 -1
- package/dist/keyframes.js.map +1 -1
- package/dist/loopWindow.d.ts +17 -0
- package/dist/loopWindow.d.ts.map +1 -0
- package/dist/loopWindow.js +34 -0
- package/dist/loopWindow.js.map +1 -0
- package/dist/midi/cacheKey.d.ts +11 -2
- package/dist/midi/cacheKey.d.ts.map +1 -1
- package/dist/midi/cacheKey.js +69 -9
- package/dist/midi/cacheKey.js.map +1 -1
- package/dist/midi/controllerEdit.d.ts +35 -0
- package/dist/midi/controllerEdit.d.ts.map +1 -0
- package/dist/midi/controllerEdit.js +94 -0
- package/dist/midi/controllerEdit.js.map +1 -0
- package/dist/midi/controllerRange.d.ts +13 -0
- package/dist/midi/controllerRange.d.ts.map +1 -0
- package/dist/midi/controllerRange.js +13 -0
- package/dist/midi/controllerRange.js.map +1 -0
- package/dist/midi/controllers.d.ts +95 -0
- package/dist/midi/controllers.d.ts.map +1 -0
- package/dist/midi/controllers.js +421 -0
- package/dist/midi/controllers.js.map +1 -0
- package/dist/midi/curveCut.d.ts +17 -0
- package/dist/midi/curveCut.d.ts.map +1 -0
- package/dist/midi/curveCut.js +45 -0
- package/dist/midi/curveCut.js.map +1 -0
- package/dist/midi/edit.d.ts +13 -1
- package/dist/midi/edit.d.ts.map +1 -1
- package/dist/midi/edit.js +19 -3
- package/dist/midi/edit.js.map +1 -1
- package/dist/midi/engines/bl1.d.ts +10 -1
- package/dist/midi/engines/bl1.d.ts.map +1 -1
- package/dist/midi/engines/bl1.js +26 -6
- package/dist/midi/engines/bl1.js.map +1 -1
- package/dist/midi/engines/dr1.d.ts +11 -1
- package/dist/midi/engines/dr1.d.ts.map +1 -1
- package/dist/midi/engines/dr1.js +21 -3
- package/dist/midi/engines/dr1.js.map +1 -1
- package/dist/midi/engines/dsp.d.ts +1 -1
- package/dist/midi/engines/dsp.d.ts.map +1 -1
- package/dist/midi/engines/dsp.js +10 -2
- package/dist/midi/engines/dsp.js.map +1 -1
- package/dist/midi/engines/wt1.d.ts +10 -1
- package/dist/midi/engines/wt1.d.ts.map +1 -1
- package/dist/midi/engines/wt1.js +28 -5
- package/dist/midi/engines/wt1.js.map +1 -1
- package/dist/midi/events.d.ts +13 -4
- package/dist/midi/events.d.ts.map +1 -1
- package/dist/midi/events.js +33 -6
- package/dist/midi/events.js.map +1 -1
- package/dist/midi/expression.d.ts +25 -0
- package/dist/midi/expression.d.ts.map +1 -0
- package/dist/midi/expression.js +69 -0
- package/dist/midi/expression.js.map +1 -0
- package/dist/midi/index.d.ts +8 -0
- package/dist/midi/index.d.ts.map +1 -1
- package/dist/midi/index.js +8 -0
- package/dist/midi/index.js.map +1 -1
- package/dist/midi/instrument.d.ts.map +1 -1
- package/dist/midi/instrument.js +4 -0
- package/dist/midi/instrument.js.map +1 -1
- package/dist/midi/noteFunctions.d.ts +29 -0
- package/dist/midi/noteFunctions.d.ts.map +1 -0
- package/dist/midi/noteFunctions.js +213 -0
- package/dist/midi/noteFunctions.js.map +1 -0
- package/dist/midi/notes.d.ts +7 -1
- package/dist/midi/notes.d.ts.map +1 -1
- package/dist/midi/notes.js +43 -1
- package/dist/midi/notes.js.map +1 -1
- package/dist/midi/notesEdit.d.ts +13 -0
- package/dist/midi/notesEdit.d.ts.map +1 -1
- package/dist/midi/notesEdit.js +73 -2
- package/dist/midi/notesEdit.js.map +1 -1
- package/dist/midi/presets.d.ts +1 -1
- package/dist/midi/regionParams.d.ts +41 -0
- package/dist/midi/regionParams.d.ts.map +1 -0
- package/dist/midi/regionParams.js +164 -0
- package/dist/midi/regionParams.js.map +1 -0
- package/dist/midi/sampler.d.ts +2 -2
- package/dist/midi/sampler.d.ts.map +1 -1
- package/dist/midi/sampler.js +99 -21
- package/dist/midi/sampler.js.map +1 -1
- package/dist/midi/stepEditor.d.ts +50 -0
- package/dist/midi/stepEditor.d.ts.map +1 -0
- package/dist/midi/stepEditor.js +118 -0
- package/dist/midi/stepEditor.js.map +1 -0
- package/dist/midi/stepPattern.d.ts +173 -0
- package/dist/midi/stepPattern.d.ts.map +1 -0
- package/dist/midi/stepPattern.js +1390 -0
- package/dist/midi/stepPattern.js.map +1 -0
- package/dist/midi/stepPatternExpand.d.ts +149 -0
- package/dist/midi/stepPatternExpand.d.ts.map +1 -0
- package/dist/midi/stepPatternExpand.js +1068 -0
- package/dist/midi/stepPatternExpand.js.map +1 -0
- package/dist/midi/stepPatternLibrary.d.ts +65 -0
- package/dist/midi/stepPatternLibrary.d.ts.map +1 -0
- package/dist/midi/stepPatternLibrary.js +640 -0
- package/dist/midi/stepPatternLibrary.js.map +1 -0
- package/dist/midi/tempo.d.ts.map +1 -1
- package/dist/midi/tempo.js +3 -0
- package/dist/midi/tempo.js.map +1 -1
- package/dist/midi/voice.d.ts +51 -5
- package/dist/midi/voice.d.ts.map +1 -1
- package/dist/midi/voice.js +191 -21
- package/dist/midi/voice.js.map +1 -1
- package/dist/model3d.d.ts +132 -8
- package/dist/model3d.d.ts.map +1 -1
- package/dist/model3d.js +230 -7
- package/dist/model3d.js.map +1 -1
- package/dist/model3dBake.d.ts +41 -11
- package/dist/model3dBake.d.ts.map +1 -1
- package/dist/model3dBake.js +58 -21
- package/dist/model3dBake.js.map +1 -1
- package/dist/model3dBlockout.d.ts +62 -0
- package/dist/model3dBlockout.d.ts.map +1 -0
- package/dist/model3dBlockout.js +59 -0
- package/dist/model3dBlockout.js.map +1 -0
- package/dist/model3dCameraDescription.d.ts +32 -0
- package/dist/model3dCameraDescription.d.ts.map +1 -0
- package/dist/model3dCameraDescription.js +253 -0
- package/dist/model3dCameraDescription.js.map +1 -0
- package/dist/model3dCameraKeys.d.ts +47 -0
- package/dist/model3dCameraKeys.d.ts.map +1 -0
- package/dist/model3dCameraKeys.js +156 -0
- package/dist/model3dCameraKeys.js.map +1 -0
- package/dist/model3dCameraMoves.d.ts +97 -0
- package/dist/model3dCameraMoves.d.ts.map +1 -0
- package/dist/model3dCameraMoves.js +329 -0
- package/dist/model3dCameraMoves.js.map +1 -0
- package/dist/model3dReference.d.ts +96 -0
- package/dist/model3dReference.d.ts.map +1 -0
- package/dist/model3dReference.js +113 -0
- package/dist/model3dReference.js.map +1 -0
- package/dist/music/align.d.ts +111 -0
- package/dist/music/align.d.ts.map +1 -0
- package/dist/music/align.js +282 -0
- package/dist/music/align.js.map +1 -0
- package/dist/music/cut.d.ts +33 -0
- package/dist/music/cut.d.ts.map +1 -0
- package/dist/music/cut.js +50 -0
- package/dist/music/cut.js.map +1 -0
- package/dist/music/frames.d.ts +51 -0
- package/dist/music/frames.d.ts.map +1 -0
- package/dist/music/frames.js +110 -0
- package/dist/music/frames.js.map +1 -0
- package/dist/music/gain.d.ts +24 -0
- package/dist/music/gain.d.ts.map +1 -0
- package/dist/music/gain.js +38 -0
- package/dist/music/gain.js.map +1 -0
- package/dist/music/index.d.ts +9 -0
- package/dist/music/index.d.ts.map +1 -0
- package/dist/music/index.js +9 -0
- package/dist/music/index.js.map +1 -0
- package/dist/music/plan.d.ts +106 -0
- package/dist/music/plan.d.ts.map +1 -0
- package/dist/music/plan.js +304 -0
- package/dist/music/plan.js.map +1 -0
- package/dist/music/process.d.ts +9 -0
- package/dist/music/process.d.ts.map +1 -0
- package/dist/music/process.js +9 -0
- package/dist/music/process.js.map +1 -0
- package/dist/music/roles.d.ts +14 -0
- package/dist/music/roles.d.ts.map +1 -0
- package/dist/music/roles.js +30 -0
- package/dist/music/roles.js.map +1 -0
- package/dist/music/splice.d.ts +37 -0
- package/dist/music/splice.d.ts.map +1 -0
- package/dist/music/splice.js +67 -0
- package/dist/music/splice.js.map +1 -0
- package/dist/music/tempoRules.d.ts +41 -0
- package/dist/music/tempoRules.d.ts.map +1 -0
- package/dist/music/tempoRules.js +59 -0
- package/dist/music/tempoRules.js.map +1 -0
- package/dist/ops/apply.d.ts.map +1 -1
- package/dist/ops/apply.js +1009 -230
- package/dist/ops/apply.js.map +1 -1
- package/dist/ops/automation.d.ts +6 -0
- package/dist/ops/automation.d.ts.map +1 -0
- package/dist/ops/automation.js +217 -0
- package/dist/ops/automation.js.map +1 -0
- package/dist/ops/barTime.d.ts +14 -0
- package/dist/ops/barTime.d.ts.map +1 -0
- package/dist/ops/barTime.js +33 -0
- package/dist/ops/barTime.js.map +1 -0
- package/dist/ops/chords.d.ts +43 -0
- package/dist/ops/chords.d.ts.map +1 -0
- package/dist/ops/chords.js +691 -0
- package/dist/ops/chords.js.map +1 -0
- package/dist/ops/groupBake.d.ts +24 -0
- package/dist/ops/groupBake.d.ts.map +1 -0
- package/dist/ops/groupBake.js +81 -0
- package/dist/ops/groupBake.js.map +1 -0
- package/dist/ops/index.d.ts +7 -0
- package/dist/ops/index.d.ts.map +1 -1
- package/dist/ops/index.js +5 -0
- package/dist/ops/index.js.map +1 -1
- package/dist/ops/join.d.ts +20 -0
- package/dist/ops/join.d.ts.map +1 -0
- package/dist/ops/join.js +265 -0
- package/dist/ops/join.js.map +1 -0
- package/dist/ops/loop.d.ts +29 -0
- package/dist/ops/loop.d.ts.map +1 -0
- package/dist/ops/loop.js +107 -0
- package/dist/ops/loop.js.map +1 -0
- package/dist/ops/midiMix.d.ts +41 -0
- package/dist/ops/midiMix.d.ts.map +1 -0
- package/dist/ops/midiMix.js +522 -0
- package/dist/ops/midiMix.js.map +1 -0
- package/dist/ops/op.d.ts +94 -11
- package/dist/ops/op.d.ts.map +1 -1
- package/dist/ops/op.js +62 -1
- package/dist/ops/op.js.map +1 -1
- package/dist/ops/parse.d.ts.map +1 -1
- package/dist/ops/parse.js +316 -4
- package/dist/ops/parse.js.map +1 -1
- package/dist/ops/pasteRange.d.ts +46 -0
- package/dist/ops/pasteRange.d.ts.map +1 -0
- package/dist/ops/pasteRange.js +276 -0
- package/dist/ops/pasteRange.js.map +1 -0
- package/dist/ops/plugin.d.ts +57 -0
- package/dist/ops/plugin.d.ts.map +1 -0
- package/dist/ops/plugin.js +875 -0
- package/dist/ops/plugin.js.map +1 -0
- package/dist/ops/sections.d.ts +98 -0
- package/dist/ops/sections.d.ts.map +1 -0
- package/dist/ops/sections.js +930 -0
- package/dist/ops/sections.js.map +1 -0
- package/dist/ops/serialize.d.ts +79 -1
- package/dist/ops/serialize.d.ts.map +1 -1
- package/dist/ops/serialize.js +85 -3
- package/dist/ops/serialize.js.map +1 -1
- package/dist/ops/stepPattern.d.ts +44 -0
- package/dist/ops/stepPattern.d.ts.map +1 -0
- package/dist/ops/stepPattern.js +2106 -0
- package/dist/ops/stepPattern.js.map +1 -0
- package/dist/ops/stepPatternFolders.d.ts +54 -0
- package/dist/ops/stepPatternFolders.d.ts.map +1 -0
- package/dist/ops/stepPatternFolders.js +299 -0
- package/dist/ops/stepPatternFolders.js.map +1 -0
- package/dist/ops/types.d.ts +260 -2
- package/dist/ops/types.d.ts.map +1 -1
- package/dist/render/index.d.ts +1 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/model3dReferenceSamples.d.ts +25 -0
- package/dist/render/model3dReferenceSamples.d.ts.map +1 -0
- package/dist/render/model3dReferenceSamples.js +25 -0
- package/dist/render/model3dReferenceSamples.js.map +1 -0
- package/dist/render/sceneModel.d.ts +1 -1
- package/dist/render/sceneModel.d.ts.map +1 -1
- package/dist/render/sceneModel.js +10 -5
- package/dist/render/sceneModel.js.map +1 -1
- package/dist/rippleEdit.d.ts +5 -1
- package/dist/rippleEdit.d.ts.map +1 -1
- package/dist/rippleEdit.js +24 -9
- package/dist/rippleEdit.js.map +1 -1
- package/dist/scene.d.ts +1 -0
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +1 -0
- package/dist/scene.js.map +1 -1
- package/dist/shotLink.d.ts +35 -0
- package/dist/shotLink.d.ts.map +1 -1
- package/dist/shotLink.js +100 -0
- package/dist/shotLink.js.map +1 -1
- package/dist/splitClip.d.ts +29 -1
- package/dist/splitClip.d.ts.map +1 -1
- package/dist/splitClip.js +231 -1
- package/dist/splitClip.js.map +1 -1
- package/dist/testing/host-ops.js +3 -3
- package/dist/testing/host-ops.js.map +1 -1
- package/dist/testing/ops.d.ts +6 -1
- package/dist/testing/ops.d.ts.map +1 -1
- package/dist/testing/ops.js +872 -13
- package/dist/testing/ops.js.map +1 -1
- package/dist/timeRemap.d.ts +2 -2
- package/dist/timeRemap.d.ts.map +1 -1
- package/dist/timeRemap.js +18 -0
- package/dist/timeRemap.js.map +1 -1
- package/dist/trimClip.d.ts +1 -1
- package/dist/trimClip.d.ts.map +1 -1
- package/dist/trimClip.js +41 -7
- package/dist/trimClip.js.map +1 -1
- package/dist/types.d.ts +331 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -5
package/dist/model3dBake.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* `computeModel3DBakeSamples` in `render/`, because it samples the clip's
|
|
9
9
|
* animation curves and those are resolved by the scene model.
|
|
10
10
|
*/
|
|
11
|
+
import { model3dFreeCameraPose } from "./model3d.js";
|
|
11
12
|
import { stableSerialize } from "./stableSerialize.js";
|
|
12
13
|
/**
|
|
13
14
|
* What Blender clears to when the style is transparent. The value is never
|
|
@@ -16,9 +17,14 @@ import { stableSerialize } from "./stableSerialize.js";
|
|
|
16
17
|
*/
|
|
17
18
|
const TRANSPARENT_BACKGROUND_COLOR = "#000000";
|
|
18
19
|
/**
|
|
19
|
-
* The clip's camera as one frame of the bake job. `orbit` and `
|
|
20
|
-
*
|
|
20
|
+
* The clip's camera as one frame of the bake job. `orbit`, `scene` and `free`
|
|
21
|
+
* are the modes a clip has; the job's `auto` is not reachable from a clip,
|
|
21
22
|
* which is what makes the reverse mapping total.
|
|
23
|
+
*
|
|
24
|
+
* A `free` camera always sends `position`, `target` and `roll`, with the
|
|
25
|
+
* defaults of {@link model3dFreeCameraPose} filled in, so the Blender op never
|
|
26
|
+
* has to know them. The other modes send those fields only when the clip
|
|
27
|
+
* stores them.
|
|
22
28
|
*/
|
|
23
29
|
export function model3dBakeCameraParams(camera, style, render) {
|
|
24
30
|
const params = {
|
|
@@ -44,6 +50,19 @@ export function model3dBakeCameraParams(camera, style, render) {
|
|
|
44
50
|
if (camera.targetOffset !== undefined) {
|
|
45
51
|
params.target_offset = [...camera.targetOffset];
|
|
46
52
|
}
|
|
53
|
+
if (camera.mode === "free") {
|
|
54
|
+
const pose = model3dFreeCameraPose(camera);
|
|
55
|
+
params.position = pose.position;
|
|
56
|
+
params.target = pose.target;
|
|
57
|
+
params.roll = pose.rollDeg;
|
|
58
|
+
return params;
|
|
59
|
+
}
|
|
60
|
+
if (camera.position !== undefined)
|
|
61
|
+
params.position = [...camera.position];
|
|
62
|
+
if (camera.target !== undefined)
|
|
63
|
+
params.target = [...camera.target];
|
|
64
|
+
if (camera.rollDeg !== undefined)
|
|
65
|
+
params.roll = camera.rollDeg;
|
|
47
66
|
return params;
|
|
48
67
|
}
|
|
49
68
|
/**
|
|
@@ -54,7 +73,9 @@ export function model3dBakeCameraParams(camera, style, render) {
|
|
|
54
73
|
*/
|
|
55
74
|
export function clipModel3DCameraFromBakeParams(params) {
|
|
56
75
|
const camera = {
|
|
57
|
-
mode: params.camera_mode === "scene"
|
|
76
|
+
mode: params.camera_mode === "scene" || params.camera_mode === "free"
|
|
77
|
+
? params.camera_mode
|
|
78
|
+
: "orbit",
|
|
58
79
|
azimuthDeg: params.azimuth,
|
|
59
80
|
elevationDeg: params.elevation,
|
|
60
81
|
fovDeg: params.fov,
|
|
@@ -66,6 +87,12 @@ export function clipModel3DCameraFromBakeParams(params) {
|
|
|
66
87
|
if (params.target_offset !== undefined) {
|
|
67
88
|
camera.targetOffset = [...params.target_offset];
|
|
68
89
|
}
|
|
90
|
+
if (params.position !== undefined)
|
|
91
|
+
camera.position = [...params.position];
|
|
92
|
+
if (params.target !== undefined)
|
|
93
|
+
camera.target = [...params.target];
|
|
94
|
+
if (params.roll !== undefined)
|
|
95
|
+
camera.rollDeg = params.roll;
|
|
69
96
|
return camera;
|
|
70
97
|
}
|
|
71
98
|
/**
|
|
@@ -78,7 +105,7 @@ export function clipModel3DCameraFromBakeParams(params) {
|
|
|
78
105
|
* the value has to be is identical on every host for the same input, which a
|
|
79
106
|
* pure-arithmetic hash over a canonically ordered payload is.
|
|
80
107
|
*/
|
|
81
|
-
function
|
|
108
|
+
export function model3dPictureDigest(payload) {
|
|
82
109
|
const hash = (seed) => {
|
|
83
110
|
let acc = seed >>> 0;
|
|
84
111
|
for (let i = 0; i < payload.length; i += 1) {
|
|
@@ -93,22 +120,13 @@ function digest(payload) {
|
|
|
93
120
|
}
|
|
94
121
|
const MODEL3D_BAKE_HASH_VERSION_PREFIX = "model3d-bake-v1:";
|
|
95
122
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* the `orbit` preset among them), the trim window, the duration, the speed,
|
|
101
|
-
* the time remap, and the sequence's fps and size. A change to any of them
|
|
102
|
-
* makes the bake stale and the live 3D layer draws again.
|
|
103
|
-
*
|
|
104
|
-
* Everything else about the clip is deliberately absent: start, track,
|
|
105
|
-
* transform, opacity, effects, mask and matte apply to the baked layer the
|
|
106
|
-
* way they apply to any video clip, so a change to one of them does not need
|
|
107
|
-
* a re-render.
|
|
123
|
+
* Everything about a clip and its sequence that a render of the clip's span
|
|
124
|
+
* depends on, apart from the style, which each caller narrows first. The
|
|
125
|
+
* Blender bake and the Blockout reference both hash this record, so a field
|
|
126
|
+
* added here makes both stale.
|
|
108
127
|
*/
|
|
109
|
-
export function
|
|
110
|
-
|
|
111
|
-
const payload = `${MODEL3D_BAKE_HASH_VERSION_PREFIX}${stableSerialize({
|
|
128
|
+
export function model3dPictureInputs(clip, sequence, style) {
|
|
129
|
+
return {
|
|
112
130
|
assetId: clip.currentAssetId,
|
|
113
131
|
style,
|
|
114
132
|
animations: clip.animations,
|
|
@@ -121,7 +139,26 @@ export function computeModel3DBakeHash(clip, sequence) {
|
|
|
121
139
|
fps: sequence.fps,
|
|
122
140
|
width: sequence.width,
|
|
123
141
|
height: sequence.height
|
|
124
|
-
}
|
|
125
|
-
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The hash a `model3d` clip's bake is stored under, and checked against.
|
|
146
|
+
*
|
|
147
|
+
* It names every input the baked picture depends on (§D6): the style without
|
|
148
|
+
* `bake` and `reference`, the glTF asset, the clip's animations (the camera
|
|
149
|
+
* curves and the `orbit` preset among them), the trim window, the duration,
|
|
150
|
+
* the speed, the time remap, and the sequence's fps and size. A change to any
|
|
151
|
+
* of them makes the bake stale and the live 3D layer draws again.
|
|
152
|
+
*
|
|
153
|
+
* Everything else about the clip is deliberately absent: start, track,
|
|
154
|
+
* transform, opacity, effects, mask and matte apply to the baked layer the
|
|
155
|
+
* way they apply to any video clip, so a change to one of them does not need
|
|
156
|
+
* a re-render. `reference` is a render of the clip, not an input to one, so
|
|
157
|
+
* storing a Blockout reference leaves a bake current.
|
|
158
|
+
*/
|
|
159
|
+
export function computeModel3DBakeHash(clip, sequence) {
|
|
160
|
+
const { bake: _bake, reference: _reference, ...style } = clip.model3dStyle ?? {};
|
|
161
|
+
const payload = `${MODEL3D_BAKE_HASH_VERSION_PREFIX}${stableSerialize(model3dPictureInputs(clip, sequence, style))}`;
|
|
162
|
+
return model3dPictureDigest(payload);
|
|
126
163
|
}
|
|
127
164
|
//# sourceMappingURL=model3dBake.js.map
|
package/dist/model3dBake.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model3dBake.js","sourceRoot":"","sources":["../src/model3dBake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,s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,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAC/C,CAAC;AACJ,CAAC;AAED,MAAM,gCAAgC,GAAG,kBAAkB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAkB,EAClB,QAA6B,EAC7B,KAAgC;IAEhC,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,cAAc;QAC5B,KAAK;QACL,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAkB,EAClB,QAA6B;IAE7B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GACpD,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAG,GAAG,gCAAgC,GAAG,eAAe,CACnE,oBAAoB,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAC5C,EAAE,CAAC;IACJ,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a shot's blockout reaches the video model that renders a take of it.
|
|
3
|
+
*
|
|
4
|
+
* A model that takes reference video is sent the blockout's reference render.
|
|
5
|
+
* Any other model is sent no reference, and the camera move is written into
|
|
6
|
+
* the prompt instead. The choice is made from the model's declared tasks,
|
|
7
|
+
* never from its name.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The model tasks that take a reference video. `reference_to_video` is the one
|
|
11
|
+
* task in the model catalog whose provider call carries reference videos
|
|
12
|
+
* (`BaseProvider.referenceToVideo`). `motion_control` is a chat composer mode
|
|
13
|
+
* with no model task and no provider call behind it, so no model can declare
|
|
14
|
+
* it and it is not listed.
|
|
15
|
+
*/
|
|
16
|
+
export declare const BLOCKOUT_REFERENCE_VIDEO_TASKS: readonly ["reference_to_video"];
|
|
17
|
+
/**
|
|
18
|
+
* Whether a video model takes a reference video, from the `supported_tasks`
|
|
19
|
+
* the catalog reports for it. A model that declares no tasks does not: the
|
|
20
|
+
* model picker treats `reference_to_video` as a task a model must declare.
|
|
21
|
+
*/
|
|
22
|
+
export declare function modelTakesReferenceVideo(supportedTasks: readonly string[] | null | undefined): boolean;
|
|
23
|
+
/** What the model is told about the reference video it is sent. */
|
|
24
|
+
export declare const BLOCKOUT_REFERENCE_INSTRUCTION: string;
|
|
25
|
+
/** Shown to the user when the selected model takes no reference video. */
|
|
26
|
+
export declare const BLOCKOUT_PROMPT_ONLY_NOTE: string;
|
|
27
|
+
export interface BlockoutGenerationInput {
|
|
28
|
+
/** The shot's composed prompt, before any blockout wording. */
|
|
29
|
+
prompt: string;
|
|
30
|
+
/** `supported_tasks` of the selected video model. */
|
|
31
|
+
supportedTasks: readonly string[] | null | undefined;
|
|
32
|
+
/** The blockout clip's current reference video asset. */
|
|
33
|
+
referenceAssetId: string;
|
|
34
|
+
/** `describeModel3DCameraMove` of the blockout clip. */
|
|
35
|
+
cameraMove: string;
|
|
36
|
+
}
|
|
37
|
+
/** A `reference_videos` entry of the `generate_media` command. */
|
|
38
|
+
export interface BlockoutReferenceVideo {
|
|
39
|
+
type: "video";
|
|
40
|
+
asset_id: string;
|
|
41
|
+
}
|
|
42
|
+
export type BlockoutGenerationPlan = {
|
|
43
|
+
route: "reference_video";
|
|
44
|
+
prompt: string;
|
|
45
|
+
capability: "reference_to_video";
|
|
46
|
+
referenceVideos: BlockoutReferenceVideo[];
|
|
47
|
+
} | {
|
|
48
|
+
route: "prompt_only";
|
|
49
|
+
prompt: string;
|
|
50
|
+
/** {@link BLOCKOUT_PROMPT_ONLY_NOTE}, for the surface to show. */
|
|
51
|
+
note: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Decide what a take generated from a blockout sends.
|
|
55
|
+
*
|
|
56
|
+
* `reference_video`: the reference asset rides in `referenceVideos`, with its
|
|
57
|
+
* full asset id, and the prompt gains {@link BLOCKOUT_REFERENCE_INSTRUCTION}
|
|
58
|
+
* and the camera sentence. `prompt_only`: nothing is attached and the prompt
|
|
59
|
+
* gains the camera sentence alone.
|
|
60
|
+
*/
|
|
61
|
+
export declare function planBlockoutGeneration(input: BlockoutGenerationInput): BlockoutGenerationPlan;
|
|
62
|
+
//# sourceMappingURL=model3dBlockout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model3dBlockout.d.ts","sourceRoot":"","sources":["../src/model3dBlockout.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,YAAI,oBAAoB,CAAU,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,GACnD,OAAO,CAMT;AAED,mEAAmE;AACnE,eAAO,MAAM,8BAA8B,QAGR,CAAC;AAEpC,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,QAEgC,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACrD,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,sBAAsB,GAC9B;IACE,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,oBAAoB,CAAC;IACjC,eAAe,EAAE,sBAAsB,EAAE,CAAC;CAC3C,GACD;IACE,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEN;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,uBAAuB,GAC7B,sBAAsB,CAqBxB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a shot's blockout reaches the video model that renders a take of it.
|
|
3
|
+
*
|
|
4
|
+
* A model that takes reference video is sent the blockout's reference render.
|
|
5
|
+
* Any other model is sent no reference, and the camera move is written into
|
|
6
|
+
* the prompt instead. The choice is made from the model's declared tasks,
|
|
7
|
+
* never from its name.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The model tasks that take a reference video. `reference_to_video` is the one
|
|
11
|
+
* task in the model catalog whose provider call carries reference videos
|
|
12
|
+
* (`BaseProvider.referenceToVideo`). `motion_control` is a chat composer mode
|
|
13
|
+
* with no model task and no provider call behind it, so no model can declare
|
|
14
|
+
* it and it is not listed.
|
|
15
|
+
*/
|
|
16
|
+
export const BLOCKOUT_REFERENCE_VIDEO_TASKS = ["reference_to_video"];
|
|
17
|
+
/**
|
|
18
|
+
* Whether a video model takes a reference video, from the `supported_tasks`
|
|
19
|
+
* the catalog reports for it. A model that declares no tasks does not: the
|
|
20
|
+
* model picker treats `reference_to_video` as a task a model must declare.
|
|
21
|
+
*/
|
|
22
|
+
export function modelTakesReferenceVideo(supportedTasks) {
|
|
23
|
+
return (supportedTasks?.some((task) => BLOCKOUT_REFERENCE_VIDEO_TASKS.some((accepted) => accepted === task)) ?? false);
|
|
24
|
+
}
|
|
25
|
+
/** What the model is told about the reference video it is sent. */
|
|
26
|
+
export const BLOCKOUT_REFERENCE_INSTRUCTION = "Follow the camera movement, framing and staging of the reference video. " +
|
|
27
|
+
"The reference is an untextured grey 3D blockout: take its motion and " +
|
|
28
|
+
"composition, not its grey look.";
|
|
29
|
+
/** Shown to the user when the selected model takes no reference video. */
|
|
30
|
+
export const BLOCKOUT_PROMPT_ONLY_NOTE = "This model does not take a reference video. The blockout's camera move " +
|
|
31
|
+
"was added to the prompt as text, and the grey render was not sent.";
|
|
32
|
+
/**
|
|
33
|
+
* Decide what a take generated from a blockout sends.
|
|
34
|
+
*
|
|
35
|
+
* `reference_video`: the reference asset rides in `referenceVideos`, with its
|
|
36
|
+
* full asset id, and the prompt gains {@link BLOCKOUT_REFERENCE_INSTRUCTION}
|
|
37
|
+
* and the camera sentence. `prompt_only`: nothing is attached and the prompt
|
|
38
|
+
* gains the camera sentence alone.
|
|
39
|
+
*/
|
|
40
|
+
export function planBlockoutGeneration(input) {
|
|
41
|
+
const base = input.prompt.trim();
|
|
42
|
+
const camera = input.cameraMove.trim();
|
|
43
|
+
const join = (...parts) => parts.filter((part) => part.length > 0).join("\n\n");
|
|
44
|
+
if (modelTakesReferenceVideo(input.supportedTasks) &&
|
|
45
|
+
input.referenceAssetId.length > 0) {
|
|
46
|
+
return {
|
|
47
|
+
route: "reference_video",
|
|
48
|
+
prompt: join(base, `${BLOCKOUT_REFERENCE_INSTRUCTION} ${camera}`.trim()),
|
|
49
|
+
capability: "reference_to_video",
|
|
50
|
+
referenceVideos: [{ type: "video", asset_id: input.referenceAssetId }]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
route: "prompt_only",
|
|
55
|
+
prompt: join(base, camera),
|
|
56
|
+
note: BLOCKOUT_PROMPT_ONLY_NOTE
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=model3dBlockout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model3dBlockout.js","sourceRoot":"","sources":["../src/model3dBlockout.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,oBAAoB,CAAU,CAAC;AAE9E;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,cAAoD;IAEpD,OAAO,CACL,cAAc,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5B,8BAA8B,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,IAAI,CAAC,CACrE,IAAI,KAAK,CACX,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,MAAM,8BAA8B,GACzC,0EAA0E;IAC1E,uEAAuE;IACvE,iCAAiC,CAAC;AAEpC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GACpC,yEAAyE;IACzE,oEAAoE,CAAC;AAiCvE;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAA8B;IAE9B,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,CAAC,GAAG,KAAe,EAAU,EAAE,CAC1C,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,IACE,wBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC;QAC9C,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EACjC,CAAC;QACD,OAAO;YACL,KAAK,EAAE,iBAAiB;YACxB,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,8BAA8B,IAAI,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;YACxE,UAAU,EAAE,oBAAoB;YAChC,eAAe,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC;SACvE,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;QAC1B,IAAI,EAAE,yBAAyB;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plain-language description of a `model3d` clip's camera move, for a video
|
|
3
|
+
* model that takes no reference video.
|
|
4
|
+
*
|
|
5
|
+
* The words come from the camera the renderer draws, sampled across the clip:
|
|
6
|
+
* its keyframes and its preset animations together. Sampling is what tells a
|
|
7
|
+
* full circle from a camera that never moved, and a half circle to the right
|
|
8
|
+
* from one to the left.
|
|
9
|
+
*/
|
|
10
|
+
import type { TimelineClip } from "./types.js";
|
|
11
|
+
/** What {@link describeModel3DCameraMove} says when nothing moves. */
|
|
12
|
+
export declare const MODEL3D_STATIC_CAMERA_DESCRIPTION = "The camera is static and holds one framing for the whole shot.";
|
|
13
|
+
/** What a camera that moved and came back reads as. */
|
|
14
|
+
export declare const MODEL3D_RETURNING_CAMERA_DESCRIPTION = "The camera moves through the shot and returns to the framing it started on.";
|
|
15
|
+
/**
|
|
16
|
+
* Describe the clip's camera move across its length, for a prompt: "The
|
|
17
|
+
* camera pushes in slowly and pans right."
|
|
18
|
+
*
|
|
19
|
+
* A free camera is read as a push in or pull out (movement along the view
|
|
20
|
+
* axis), a truck (sideways), a pedestal (eye and target rise together) or a
|
|
21
|
+
* crane (the eye rises and keeps looking at the target), a pan and a tilt
|
|
22
|
+
* (the view direction turning about the eye), an orbit (the eye circling a
|
|
23
|
+
* target that stays put), a zoom (the lens) and a roll. An orbit camera is
|
|
24
|
+
* read from its azimuth, elevation, zoom and lens channels. A scene camera
|
|
25
|
+
* has no keyed pose and reads as static. A change under the thresholds at the
|
|
26
|
+
* top of this file is left out, and a clip with nothing left reads as
|
|
27
|
+
* {@link MODEL3D_STATIC_CAMERA_DESCRIPTION}. Turns add up across the clip, so
|
|
28
|
+
* a full circle reads as an orbit. A camera that moved and ends where it
|
|
29
|
+
* began reads as {@link MODEL3D_RETURNING_CAMERA_DESCRIPTION}.
|
|
30
|
+
*/
|
|
31
|
+
export declare function describeModel3DCameraMove(clip: TimelineClip): string;
|
|
32
|
+
//# sourceMappingURL=model3dCameraDescription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model3dCameraDescription.d.ts","sourceRoot":"","sources":["../src/model3dCameraDescription.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,sEAAsE;AACtE,eAAO,MAAM,iCAAiC,mEACoB,CAAC;AAenE,uDAAuD;AACvD,eAAO,MAAM,oCAAoC,gFAC8B,CAAC;AAuIhF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAwIpE"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plain-language description of a `model3d` clip's camera move, for a video
|
|
3
|
+
* model that takes no reference video.
|
|
4
|
+
*
|
|
5
|
+
* The words come from the camera the renderer draws, sampled across the clip:
|
|
6
|
+
* its keyframes and its preset animations together. Sampling is what tells a
|
|
7
|
+
* full circle from a camera that never moved, and a half circle to the right
|
|
8
|
+
* from one to the left.
|
|
9
|
+
*/
|
|
10
|
+
import { MODEL3D_CAMERA_PROPERTIES, model3dFreeCameraBasis, model3dFreeCameraPose, resolveModel3DCamera } from "./model3d.js";
|
|
11
|
+
import { compileClipAnimations, sampleAnimations } from "./animation/index.js";
|
|
12
|
+
import { resolveBeatAnimations } from "./animation/beat.js";
|
|
13
|
+
import { clipSteppedTime } from "./render/temporal.js";
|
|
14
|
+
import { clipSourceMsAt } from "./timeRemap.js";
|
|
15
|
+
/** What {@link describeModel3DCameraMove} says when nothing moves. */
|
|
16
|
+
export const MODEL3D_STATIC_CAMERA_DESCRIPTION = "The camera is static and holds one framing for the whole shot.";
|
|
17
|
+
/** Rotation below this many degrees is not described. */
|
|
18
|
+
const ANGLE_THRESHOLD_DEG = 3;
|
|
19
|
+
/** Translation below this fraction of the eye-to-target distance is not described. */
|
|
20
|
+
const DISTANCE_THRESHOLD = 0.05;
|
|
21
|
+
/** Lens change below this many degrees of field of view is not described. */
|
|
22
|
+
const FOV_THRESHOLD_DEG = 2;
|
|
23
|
+
/** A vertical move is a crane when the target rises less than this share of the eye's rise. */
|
|
24
|
+
const CRANE_TARGET_SHARE = 0.5;
|
|
25
|
+
/** Steps the clip is sampled in: a full circle is 10 degrees a step. */
|
|
26
|
+
const SAMPLE_STEPS = 36;
|
|
27
|
+
/** The camera channels do not depend on the frame, so any canvas reads them. */
|
|
28
|
+
const SAMPLE_CANVAS = { width: 1920, height: 1080, fps: 30 };
|
|
29
|
+
/** What a camera that moved and came back reads as. */
|
|
30
|
+
export const MODEL3D_RETURNING_CAMERA_DESCRIPTION = "The camera moves through the shot and returns to the framing it started on.";
|
|
31
|
+
/**
|
|
32
|
+
* The camera channels at each sample instant, first to last. The last sample
|
|
33
|
+
* is a millisecond inside the clip: a looping animation is back at its start
|
|
34
|
+
* on the clip's end, which no frame shows.
|
|
35
|
+
*/
|
|
36
|
+
function sampleChannels(clip) {
|
|
37
|
+
// The renderer's camera path (`resolveAnimatedLayerProps`), without the
|
|
38
|
+
// render module: that one loads Yoga, whose top-level await would make
|
|
39
|
+
// every importer of this package asynchronous.
|
|
40
|
+
const compiled = compileClipAnimations(resolveBeatAnimations(clip), clip.durationMs, SAMPLE_CANVAS, { staggerCount: 0, staggerUnit: "word" });
|
|
41
|
+
const samples = [];
|
|
42
|
+
const lastMs = Math.max(clip.durationMs - 1, 0);
|
|
43
|
+
for (let step = 0; step <= SAMPLE_STEPS; step++) {
|
|
44
|
+
const timeMs = clipSteppedTime(clip, clip.startMs + Math.min((clip.durationMs * step) / SAMPLE_STEPS, lastMs));
|
|
45
|
+
const sample = sampleAnimations(compiled, timeMs - clip.startMs, undefined, clipSourceMsAt(clip, timeMs));
|
|
46
|
+
const channels = {};
|
|
47
|
+
for (const property of MODEL3D_CAMERA_PROPERTIES) {
|
|
48
|
+
channels[property] = sample[property];
|
|
49
|
+
}
|
|
50
|
+
samples.push(channels);
|
|
51
|
+
}
|
|
52
|
+
return samples;
|
|
53
|
+
}
|
|
54
|
+
/** The sum of the absolute steps of `values`: how far a channel travelled. */
|
|
55
|
+
const travelOf = (values) => values.reduce((sum, value, index) => (index === 0 ? 0 : sum + Math.abs(value - values[index - 1])), 0);
|
|
56
|
+
const RAD = 180 / Math.PI;
|
|
57
|
+
const sub = (a, b) => [
|
|
58
|
+
a[0] - b[0],
|
|
59
|
+
a[1] - b[1],
|
|
60
|
+
a[2] - b[2]
|
|
61
|
+
];
|
|
62
|
+
const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
63
|
+
const length = (a) => Math.sqrt(dot(a, a));
|
|
64
|
+
/** Wrap an angle difference into -180..180. */
|
|
65
|
+
const wrapDeg = (deg) => ((((deg + 180) % 360) + 360) % 360) - 180;
|
|
66
|
+
/**
|
|
67
|
+
* "slowly", "quickly" or nothing, from a rate measured against the rate an
|
|
68
|
+
* unremarkable move has. `rate` and `typical` share a unit per second.
|
|
69
|
+
*/
|
|
70
|
+
function pace(rate, typical) {
|
|
71
|
+
if (rate < typical / 3)
|
|
72
|
+
return " slowly";
|
|
73
|
+
if (rate > typical * 3)
|
|
74
|
+
return " quickly";
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
/** `returned` says the camera moved on the way, though it ends where it began. */
|
|
78
|
+
function sentence(phrases, returned = false) {
|
|
79
|
+
if (phrases.length === 0) {
|
|
80
|
+
return returned
|
|
81
|
+
? MODEL3D_RETURNING_CAMERA_DESCRIPTION
|
|
82
|
+
: MODEL3D_STATIC_CAMERA_DESCRIPTION;
|
|
83
|
+
}
|
|
84
|
+
const joined = phrases.length === 1
|
|
85
|
+
? phrases[0]
|
|
86
|
+
: `${phrases.slice(0, -1).join(", ")} and ${phrases[phrases.length - 1]}`;
|
|
87
|
+
return `The camera ${joined}.`;
|
|
88
|
+
}
|
|
89
|
+
function describeOrbitCamera(samples, seconds) {
|
|
90
|
+
const first = samples[0];
|
|
91
|
+
const last = samples[samples.length - 1];
|
|
92
|
+
const phrases = [];
|
|
93
|
+
// The turn adds up step by step: a looping sweep that wraps from 360 back
|
|
94
|
+
// to 0 shows the same picture and keeps turning.
|
|
95
|
+
let azimuth = 0;
|
|
96
|
+
for (let index = 1; index < samples.length; index++) {
|
|
97
|
+
azimuth += wrapDeg(samples[index].cameraAzimuth - samples[index - 1].cameraAzimuth);
|
|
98
|
+
}
|
|
99
|
+
if (Math.abs(azimuth) >= ANGLE_THRESHOLD_DEG) {
|
|
100
|
+
phrases.push(`orbits ${azimuth > 0 ? "right" : "left"} around the subject` +
|
|
101
|
+
pace(Math.abs(azimuth) / seconds, 20));
|
|
102
|
+
}
|
|
103
|
+
const elevation = last.cameraElevation - first.cameraElevation;
|
|
104
|
+
if (Math.abs(elevation) >= ANGLE_THRESHOLD_DEG) {
|
|
105
|
+
phrases.push(`${elevation > 0 ? "rises" : "descends"}` +
|
|
106
|
+
pace(Math.abs(elevation) / seconds, 20));
|
|
107
|
+
}
|
|
108
|
+
// `cameraZoom` multiplies the framing distance multiplier, so the move is
|
|
109
|
+
// the ratio of its two ends. Above one is closer.
|
|
110
|
+
const zoomStart = first.cameraZoom;
|
|
111
|
+
const zoomEnd = last.cameraZoom;
|
|
112
|
+
const zoom = zoomStart > 0 && zoomEnd > 0 ? zoomEnd / zoomStart : 1;
|
|
113
|
+
if (Math.abs(zoom - 1) >= DISTANCE_THRESHOLD) {
|
|
114
|
+
phrases.push(`${zoom > 1 ? "pushes in" : "pulls out"}` +
|
|
115
|
+
pace(Math.abs(Math.log(zoom)) / seconds, 0.15));
|
|
116
|
+
}
|
|
117
|
+
const fov = last.cameraFov - first.cameraFov;
|
|
118
|
+
if (Math.abs(fov) >= FOV_THRESHOLD_DEG) {
|
|
119
|
+
phrases.push(`zooms ${fov < 0 ? "in" : "out"}` + pace(Math.abs(fov) / seconds, 8));
|
|
120
|
+
}
|
|
121
|
+
const returned = travelOf(samples.map((sample) => sample.cameraAzimuth)) >= ANGLE_THRESHOLD_DEG * 2 ||
|
|
122
|
+
travelOf(samples.map((sample) => sample.cameraElevation)) >= ANGLE_THRESHOLD_DEG * 2 ||
|
|
123
|
+
travelOf(samples.map((sample) => Math.log(Math.max(sample.cameraZoom, 1e-6)))) >=
|
|
124
|
+
DISTANCE_THRESHOLD * 2 ||
|
|
125
|
+
travelOf(samples.map((sample) => sample.cameraFov)) >= FOV_THRESHOLD_DEG * 2;
|
|
126
|
+
return sentence(phrases, returned);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Describe the clip's camera move across its length, for a prompt: "The
|
|
130
|
+
* camera pushes in slowly and pans right."
|
|
131
|
+
*
|
|
132
|
+
* A free camera is read as a push in or pull out (movement along the view
|
|
133
|
+
* axis), a truck (sideways), a pedestal (eye and target rise together) or a
|
|
134
|
+
* crane (the eye rises and keeps looking at the target), a pan and a tilt
|
|
135
|
+
* (the view direction turning about the eye), an orbit (the eye circling a
|
|
136
|
+
* target that stays put), a zoom (the lens) and a roll. An orbit camera is
|
|
137
|
+
* read from its azimuth, elevation, zoom and lens channels. A scene camera
|
|
138
|
+
* has no keyed pose and reads as static. A change under the thresholds at the
|
|
139
|
+
* top of this file is left out, and a clip with nothing left reads as
|
|
140
|
+
* {@link MODEL3D_STATIC_CAMERA_DESCRIPTION}. Turns add up across the clip, so
|
|
141
|
+
* a full circle reads as an orbit. A camera that moved and ends where it
|
|
142
|
+
* began reads as {@link MODEL3D_RETURNING_CAMERA_DESCRIPTION}.
|
|
143
|
+
*/
|
|
144
|
+
export function describeModel3DCameraMove(clip) {
|
|
145
|
+
const style = clip.model3dStyle;
|
|
146
|
+
if (!style || style.camera.mode === "scene") {
|
|
147
|
+
return MODEL3D_STATIC_CAMERA_DESCRIPTION;
|
|
148
|
+
}
|
|
149
|
+
const seconds = Math.max(clip.durationMs / 1000, 1e-3);
|
|
150
|
+
const samples = sampleChannels(clip);
|
|
151
|
+
if (style.camera.mode === "orbit") {
|
|
152
|
+
return describeOrbitCamera(samples, seconds);
|
|
153
|
+
}
|
|
154
|
+
const poses = samples.map((channels) => model3dFreeCameraPose(resolveModel3DCamera(style, channels)));
|
|
155
|
+
const start = poses[0];
|
|
156
|
+
const end = poses[poses.length - 1];
|
|
157
|
+
const basis = model3dFreeCameraBasis(start.position, start.target, start.rollDeg);
|
|
158
|
+
const endBasis = model3dFreeCameraBasis(end.position, end.target, end.rollDeg);
|
|
159
|
+
const distance = Math.max(length(sub(start.target, start.position)), 1e-6);
|
|
160
|
+
const eyeMove = sub(end.position, start.position);
|
|
161
|
+
const targetMove = sub(end.target, start.target);
|
|
162
|
+
// The unrolled right axis, so a rolled camera still trucks "left" and
|
|
163
|
+
// "right" in the ground plane.
|
|
164
|
+
const flat = model3dFreeCameraBasis(start.position, start.target, 0);
|
|
165
|
+
const forward = dot(eyeMove, basis.forward) / distance;
|
|
166
|
+
const sideways = dot(eyeMove, flat.right) / distance;
|
|
167
|
+
const vertical = eyeMove[1] / distance;
|
|
168
|
+
const yaw = (f) => Math.atan2(f[0], -f[2]) * RAD;
|
|
169
|
+
const pitch = (f) => Math.asin(Math.min(1, Math.max(-1, f[1]))) * RAD;
|
|
170
|
+
const tilt = pitch(endBasis.forward) - pitch(basis.forward);
|
|
171
|
+
// What only the path shows. The turn adds up step by step, so a full
|
|
172
|
+
// circle is 360 degrees and not none, and half a circle has a direction.
|
|
173
|
+
let pan = 0;
|
|
174
|
+
/** Sideways travel of the eye, each step in the frame the camera had then. */
|
|
175
|
+
let swing = 0;
|
|
176
|
+
let eyePath = 0;
|
|
177
|
+
let targetPath = 0;
|
|
178
|
+
let turnPath = 0;
|
|
179
|
+
let distanceDrift = 0;
|
|
180
|
+
let lensPath = 0;
|
|
181
|
+
for (let index = 1; index < poses.length; index++) {
|
|
182
|
+
const from = poses[index - 1];
|
|
183
|
+
const to = poses[index];
|
|
184
|
+
const fromBasis = model3dFreeCameraBasis(from.position, from.target, from.rollDeg);
|
|
185
|
+
const toBasis = model3dFreeCameraBasis(to.position, to.target, to.rollDeg);
|
|
186
|
+
const step = sub(to.position, from.position);
|
|
187
|
+
const turn = wrapDeg(yaw(toBasis.forward) - yaw(fromBasis.forward));
|
|
188
|
+
pan += turn;
|
|
189
|
+
swing += dot(step, model3dFreeCameraBasis(from.position, from.target, 0).right);
|
|
190
|
+
eyePath += length(step);
|
|
191
|
+
targetPath += length(sub(to.target, from.target));
|
|
192
|
+
turnPath +=
|
|
193
|
+
Math.abs(turn) +
|
|
194
|
+
Math.abs(pitch(toBasis.forward) - pitch(fromBasis.forward)) +
|
|
195
|
+
Math.abs(to.rollDeg - from.rollDeg);
|
|
196
|
+
distanceDrift = Math.max(distanceDrift, Math.abs(length(sub(to.target, to.position)) - distance));
|
|
197
|
+
lensPath += Math.abs(to.fovDeg - from.fovDeg);
|
|
198
|
+
}
|
|
199
|
+
const phrases = [];
|
|
200
|
+
// An orbit: the target stays where it was, the eye keeps its distance and
|
|
201
|
+
// swings around it. Seen from the eye that is a sideways move plus an
|
|
202
|
+
// opposite pan, which reads wrong as "trucks right and pans left".
|
|
203
|
+
const targetHeld = targetPath / distance < DISTANCE_THRESHOLD;
|
|
204
|
+
const distanceHeld = distanceDrift / distance < DISTANCE_THRESHOLD * 2;
|
|
205
|
+
const orbiting = targetHeld && distanceHeld && Math.abs(pan) >= ANGLE_THRESHOLD_DEG;
|
|
206
|
+
if (orbiting) {
|
|
207
|
+
phrases.push(`orbits ${swing > 0 ? "right" : "left"} around the subject` +
|
|
208
|
+
pace(Math.abs(pan) / seconds, 20));
|
|
209
|
+
if (Math.abs(vertical) >= DISTANCE_THRESHOLD) {
|
|
210
|
+
phrases.push(vertical > 0 ? "rises" : "descends");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
if (Math.abs(forward) >= DISTANCE_THRESHOLD) {
|
|
215
|
+
phrases.push(`${forward > 0 ? "pushes in" : "pulls out"}` +
|
|
216
|
+
pace(Math.abs(forward) / seconds, 0.15));
|
|
217
|
+
}
|
|
218
|
+
if (Math.abs(sideways) >= DISTANCE_THRESHOLD) {
|
|
219
|
+
phrases.push(`trucks ${sideways > 0 ? "right" : "left"}` +
|
|
220
|
+
pace(Math.abs(sideways) / seconds, 0.15));
|
|
221
|
+
}
|
|
222
|
+
// A crane raises the eye while it keeps looking at the target, so the
|
|
223
|
+
// tilt that comes with it is part of the move. A pedestal raises the eye
|
|
224
|
+
// and the target together.
|
|
225
|
+
const crane = Math.abs(vertical) >= DISTANCE_THRESHOLD &&
|
|
226
|
+
Math.abs(targetMove[1]) < Math.abs(eyeMove[1]) * CRANE_TARGET_SHARE;
|
|
227
|
+
if (Math.abs(vertical) >= DISTANCE_THRESHOLD) {
|
|
228
|
+
phrases.push(`${crane ? "cranes" : "pedestals"} ${vertical > 0 ? "up" : "down"}` +
|
|
229
|
+
pace(Math.abs(vertical) / seconds, 0.15));
|
|
230
|
+
}
|
|
231
|
+
if (Math.abs(pan) >= ANGLE_THRESHOLD_DEG) {
|
|
232
|
+
phrases.push(`pans ${pan > 0 ? "right" : "left"}` + pace(Math.abs(pan) / seconds, 20));
|
|
233
|
+
}
|
|
234
|
+
if (!crane && Math.abs(tilt) >= ANGLE_THRESHOLD_DEG) {
|
|
235
|
+
phrases.push(`tilts ${tilt > 0 ? "up" : "down"}` + pace(Math.abs(tilt) / seconds, 20));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const fov = end.fovDeg - start.fovDeg;
|
|
239
|
+
if (Math.abs(fov) >= FOV_THRESHOLD_DEG) {
|
|
240
|
+
phrases.push(`zooms ${fov < 0 ? "in" : "out"}` + pace(Math.abs(fov) / seconds, 8));
|
|
241
|
+
}
|
|
242
|
+
const roll = end.rollDeg - start.rollDeg;
|
|
243
|
+
if (Math.abs(roll) >= ANGLE_THRESHOLD_DEG) {
|
|
244
|
+
// Positive roll turns the horizon clockwise in the picture.
|
|
245
|
+
phrases.push(`rolls so the horizon turns ${roll > 0 ? "clockwise" : "counterclockwise"}`);
|
|
246
|
+
}
|
|
247
|
+
const returned = eyePath / distance >= DISTANCE_THRESHOLD * 2 ||
|
|
248
|
+
targetPath / distance >= DISTANCE_THRESHOLD * 2 ||
|
|
249
|
+
turnPath >= ANGLE_THRESHOLD_DEG * 2 ||
|
|
250
|
+
lensPath >= FOV_THRESHOLD_DEG * 2;
|
|
251
|
+
return sentence(phrases, returned);
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=model3dCameraDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model3dCameraDescription.js","sourceRoot":"","sources":["../src/model3dCameraDescription.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EAGrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAA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AO,GAAG,KAAK,CAAC,OAAO,CAAC;IACzC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,mBAAmB,EAAE,CAAC;QAC1C,4DAA4D;QAC5D,OAAO,CAAC,IAAI,CACV,8BAA8B,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAC5E,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GACZ,OAAO,GAAG,QAAQ,IAAI,kBAAkB,GAAG,CAAC;QAC5C,UAAU,GAAG,QAAQ,IAAI,kBAAkB,GAAG,CAAC;QAC/C,QAAQ,IAAI,mBAAmB,GAAG,CAAC;QACnC,QAAQ,IAAI,iBAAiB,GAAG,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keying a `model3d` clip's free camera at one instant, and the lens
|
|
3
|
+
* conversion a camera patch accepts.
|
|
4
|
+
*
|
|
5
|
+
* A camera key is one keyframe on each free camera channel at the same time,
|
|
6
|
+
* so the whole pose is pinned there and a later key on one channel cannot
|
|
7
|
+
* drag the others. The channels fold by addition onto the clip's authored
|
|
8
|
+
* camera, so every stored value is the wanted pose minus the authored one.
|
|
9
|
+
*/
|
|
10
|
+
import type { ClipAnimation } from "./animation/types.js";
|
|
11
|
+
import { type Model3DFreeCameraPose } from "./model3d.js";
|
|
12
|
+
import type { TimelineClip } from "./types.js";
|
|
13
|
+
/** The widest and the narrowest lens a free camera takes, vertical degrees. */
|
|
14
|
+
export declare const MODEL3D_MIN_FOV_DEG = 1;
|
|
15
|
+
export declare const MODEL3D_MAX_FOV_DEG = 170;
|
|
16
|
+
/** The lens of a camera patch: a field of view or a focal length, never both. */
|
|
17
|
+
export interface Model3DLensInput {
|
|
18
|
+
fovDeg?: number;
|
|
19
|
+
focalLengthMm?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The vertical field of view a lens input asks for, or undefined when it names
|
|
23
|
+
* no lens. `field` is the path of the object in the caller's arguments, for
|
|
24
|
+
* the message.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveModel3DLensFovDeg(lens: Model3DLensInput, field?: string): number | undefined;
|
|
27
|
+
/** A free camera pose with the lens in both units, rounded for a report. */
|
|
28
|
+
export interface Model3DFreeCameraReport extends Model3DFreeCameraPose {
|
|
29
|
+
focalLengthMm: number;
|
|
30
|
+
}
|
|
31
|
+
export declare function model3dFreeCameraReport(pose: Model3DFreeCameraPose): Model3DFreeCameraReport;
|
|
32
|
+
/** Throws when `easing` is outside the easing grammar. `field` names it. */
|
|
33
|
+
export declare function assertKnownEasing(easing: string, field: string): void;
|
|
34
|
+
export interface KeyModel3DFreeCameraOptions {
|
|
35
|
+
/** Easing of the segment that arrives at this key. Linear when absent. */
|
|
36
|
+
easing?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Key the clip's free camera at `atMs`, clip-relative, and return the clip's
|
|
40
|
+
* new animation list, the way `setKeyframe` does.
|
|
41
|
+
*
|
|
42
|
+
* Every field `pose` leaves out keeps the value the camera has at `atMs`, so
|
|
43
|
+
* `{}` pins the current picture. All eight free channels get a keyframe. The
|
|
44
|
+
* clip has to be in `free` mode and `atMs` inside the clip.
|
|
45
|
+
*/
|
|
46
|
+
export declare function keyModel3DFreeCamera(clip: TimelineClip, atMs: number, pose?: Partial<Model3DFreeCameraPose>, options?: KeyModel3DFreeCameraOptions): ClipAnimation[];
|
|
47
|
+
//# sourceMappingURL=model3dCameraKeys.d.ts.map
|