davinci-resolve-mcp 2.150.0 → 2.152.0
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/CHANGELOG.md +39 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/install.py +1 -1
- package/package.json +1 -1
- package/resolve-advanced/server/aaf_probe.py +29 -0
- package/resolve-advanced/server/author-interchange.mjs +42 -1
- package/resolve-advanced/server/editorial.mjs +57 -2
- package/resolve-advanced/server/tools/drt.mjs +1 -1
- package/src/granular/common.py +1 -1
- package/src/server.py +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
Release history for the DaVinci Resolve MCP Server. The latest release is summarized in the root README; older entries live here to keep the README focused.
|
|
4
4
|
|
|
5
|
+
## What's New in v2.152.0 — AAF dissolves conform at last, and AAF fades join the family
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **No AAF dissolve could ever conform through `assemble_from_interchange`**:
|
|
10
|
+
an AAF Transition consumes record time, so the walker (correctly) emits the
|
|
11
|
+
incoming clip overlapping the outgoing — and the bridge's overlap gate
|
|
12
|
+
threw on exactly that shape. A reconciliation pre-pass now trims the
|
|
13
|
+
outgoing's tail to the overlap start; the boundary shift then re-extends it
|
|
14
|
+
to the cut point, which is the AAF notional-cut (`CutPoint`) semantics
|
|
15
|
+
exactly. Render-verified: the dissolve blends through the 181.8 midpoint
|
|
16
|
+
fingerprint.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **AAF fades**: the walker synthesizes BL pseudo-events at filler-adjacent
|
|
21
|
+
and sequence-edge Transitions, completing fade parity across all four
|
|
22
|
+
formats (EDL v2.150, OTIO/XMEML v2.151, AAF now). The head-transition
|
|
23
|
+
"clamp" case is reinterpreted as what it is — a fade-in from black.
|
|
24
|
+
Full triple render-verified: fade-in 18→123, dissolve-to-white through the
|
|
25
|
+
midpoint, fade-out 230→21.
|
|
26
|
+
- A pyaaf2-authored AAF fixture test exercises the real walker end to end
|
|
27
|
+
(no stubs), skipped only where pyaaf2 is unavailable.
|
|
28
|
+
|
|
29
|
+
## What's New in v2.151.0 — fade parity: OTIO and XMEML fades author too
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **OTIO and XMEML fades route through the black machinery** shipped for EDL
|
|
34
|
+
BL legs in v2.150.0. OTIO: a Transition adjacent to a Gap (or the track
|
|
35
|
+
edge) is a fade — gap-then-Transition-then-Clip fades in, Transition-then-
|
|
36
|
+
Gap (or Transition as the last child) fades out. XMEML: an edge
|
|
37
|
+
transitionitem whose span has no outgoing clip fades in, no incoming clip
|
|
38
|
+
fades out. All synthesize BL pseudo-events; the bridge materializes a
|
|
39
|
+
zero-length black leg to cover its side of the span whenever the boundary
|
|
40
|
+
shift alone won't grow it (empty track renders black, so the growth is
|
|
41
|
+
render-neutral). Live OTIO render: fade-in luma ramps 18→123, the centered
|
|
42
|
+
fade-out 124→18 — identical geometry from all three parsers.
|
|
43
|
+
|
|
5
44
|
## What's New in v2.150.0 — fades conform: BL legs author, and Resolve's own EDL importer drops them
|
|
6
45
|
|
|
7
46
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#server-modes)
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#服务器模式)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[](https://www.python.org/downloads/)
|
|
13
13
|
[](https://opensource.org/licenses/MIT)
|
|
14
14
|
|
|
15
|
-
> 本翻译对应 v2.
|
|
15
|
+
> 本翻译对应 v2.152.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
package/install.py
CHANGED
|
@@ -37,7 +37,7 @@ from src.utils.update_check import (
|
|
|
37
37
|
|
|
38
38
|
# ─── Version ──────────────────────────────────────────────────────────────────
|
|
39
39
|
|
|
40
|
-
VERSION = "2.
|
|
40
|
+
VERSION = "2.152.0"
|
|
41
41
|
# Only hard floor: mcp[cli] requires Python 3.10+. There is no upper bound —
|
|
42
42
|
# Resolve's scripting bridge loads into newer interpreters on recent builds
|
|
43
43
|
# (Python 3.14 verified against Resolve Studio 20.3.2). Older Resolve builds
|
package/package.json
CHANGED
|
@@ -1161,6 +1161,21 @@ def _walk_components(sequence, *, track, fps, rec, state, depth, transition=None
|
|
|
1161
1161
|
"""
|
|
1162
1162
|
start = rec
|
|
1163
1163
|
pending_transition = transition
|
|
1164
|
+
# Sequence start counts as black: a Transition with Filler (or nothing)
|
|
1165
|
+
# on one side is a FADE. Synthesize zero-length BL pseudo-events so the
|
|
1166
|
+
# bridge's black machinery (E91-E93) authors a real clip-to-generator
|
|
1167
|
+
# dissolve — Resolve renders empty track as black, and the bridge grows
|
|
1168
|
+
# the BL leg to cover its side of the overlap.
|
|
1169
|
+
at_black = True
|
|
1170
|
+
|
|
1171
|
+
def _emit_bl(rec_pos, trans):
|
|
1172
|
+
state["events"].append({
|
|
1173
|
+
"index": state["idx"], "track": track, "source": "BL",
|
|
1174
|
+
"srcIn": 0, "srcOut": 0, "recIn": rec_pos, "recOut": rec_pos,
|
|
1175
|
+
"speed": 100, "reverse": False, "transition": trans, "fps": fps,
|
|
1176
|
+
})
|
|
1177
|
+
state["idx"] += 1
|
|
1178
|
+
|
|
1164
1179
|
components = getattr(sequence, "components", None)
|
|
1165
1180
|
if components is None:
|
|
1166
1181
|
components = [sequence]
|
|
@@ -1190,15 +1205,29 @@ def _walk_components(sequence, *, track, fps, rec, state, depth, transition=None
|
|
|
1190
1205
|
# be a worse lie than the malformed AAF that produced it.
|
|
1191
1206
|
rec = max(start, rec - duration)
|
|
1192
1207
|
continue
|
|
1208
|
+
if pending_transition is not None and cls in ("Filler", "ScopeReference"):
|
|
1209
|
+
# Transition then Filler = fade-OUT into black: the fade
|
|
1210
|
+
# attaches to a synthetic BL leg at the overlap start.
|
|
1211
|
+
_emit_bl(rec, pending_transition)
|
|
1212
|
+
pending_transition = None
|
|
1213
|
+
elif pending_transition is not None and at_black:
|
|
1214
|
+
# Filler (or sequence start) then Transition then clip =
|
|
1215
|
+
# fade-IN from black: zero-length BL predecessor at the
|
|
1216
|
+
# overlap start; the bridge's boundary shift grows it.
|
|
1217
|
+
_emit_bl(rec, None)
|
|
1193
1218
|
rec += _walk_segment(
|
|
1194
1219
|
comp, track=track, fps=fps, rec=rec, state=state, depth=depth, transition=pending_transition
|
|
1195
1220
|
)
|
|
1196
1221
|
pending_transition = None
|
|
1222
|
+
at_black = cls in ("Filler", "ScopeReference")
|
|
1197
1223
|
except Exception:
|
|
1198
1224
|
# Never let one bad component abort the whole sequence — but say so.
|
|
1199
1225
|
_note_unhandled(state, cls)
|
|
1200
1226
|
pending_transition = None
|
|
1201
1227
|
continue
|
|
1228
|
+
if pending_transition is not None:
|
|
1229
|
+
# Transition as the LAST component = fade-out to the sequence end.
|
|
1230
|
+
_emit_bl(rec, pending_transition)
|
|
1202
1231
|
return rec - start
|
|
1203
1232
|
|
|
1204
1233
|
|
|
@@ -313,9 +313,14 @@ export function eventsToAssembleSpec(events, opts = {}) {
|
|
|
313
313
|
d += d % 2;
|
|
314
314
|
let pre = Math.floor(d / 2);
|
|
315
315
|
if (e.transition.alignment === 'start') pre = 0;
|
|
316
|
+
else if (e.transition.inOffset != null) pre = Math.min(d, Math.max(0, toTl(e.transition.inOffset, e.fps)));
|
|
317
|
+
else if (e.transition.recStart != null) {
|
|
318
|
+
const spanStartAbs = ORIGIN + (toTl(e.transition.recStart, e.fps) - minRec);
|
|
319
|
+
pre = Math.min(d, Math.max(0, recIn - spanStartAbs));
|
|
320
|
+
}
|
|
316
321
|
transitionCandidates.push({
|
|
317
322
|
atFrame: recIn, durationFrames: d, track: vTrackEarly, pre,
|
|
318
|
-
explicitSpan: e.transition.alignment != null,
|
|
323
|
+
explicitSpan: e.transition.alignment != null || e.transition.inOffset != null || e.transition.recStart != null,
|
|
319
324
|
index: e.index, type: e.transition.type, rawDuration: e.transition.duration,
|
|
320
325
|
source: e.source, srcIn: Infinity, incomingCutRef: el, cutPoint: e.transition.cutPoint,
|
|
321
326
|
});
|
|
@@ -438,6 +443,29 @@ export function eventsToAssembleSpec(events, opts = {}) {
|
|
|
438
443
|
if (!perSource.has(e.source)) perSource.set(e.source, []);
|
|
439
444
|
perSource.get(e.source).push(cut);
|
|
440
445
|
}
|
|
446
|
+
// AAF overlap reconciliation (E93): an AAF Transition CONSUMES record time
|
|
447
|
+
// — the incoming component starts `duration` frames before the outgoing
|
|
448
|
+
// ends, so the walker legitimately emits OVERLAPPING events with the
|
|
449
|
+
// transition on the incoming (alignment 'start' at the overlap start).
|
|
450
|
+
// Trim the outgoing's tail to the overlap start before the overlap gates:
|
|
451
|
+
// the boundary-shift below then re-extends it to the cut point, which is
|
|
452
|
+
// exactly the AAF notional-cut semantics (CutPoint, centered by default).
|
|
453
|
+
// Without this the overlap gate threw and NO AAF dissolve could conform.
|
|
454
|
+
const reconcileAafOverlap = (cands, pls) => {
|
|
455
|
+
for (const c of cands) {
|
|
456
|
+
if (!c.explicitSpan || c.pre !== 0) continue;
|
|
457
|
+
const prev = pls.find((pl) => pl.track === c.track && pl.start < c.atFrame && pl.end > c.atFrame && pl.end - c.atFrame <= c.durationFrames);
|
|
458
|
+
if (!prev) continue;
|
|
459
|
+
const o = prev.end - c.atFrame;
|
|
460
|
+
if (prev.durationFrames <= o) continue; // degenerate: leave for the drop paths
|
|
461
|
+
prev.end -= o;
|
|
462
|
+
prev.durationFrames -= o;
|
|
463
|
+
prev.cutRef.durationFrames -= o;
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
reconcileAafOverlap(transitionCandidates, placements);
|
|
467
|
+
reconcileAafOverlap(audioTransCandidates, audioPlacements);
|
|
468
|
+
|
|
441
469
|
audioPlacements.sort((a, b) => a.start - b.start);
|
|
442
470
|
const audByTrack = new Map();
|
|
443
471
|
for (const pl of audioPlacements) {
|
|
@@ -508,6 +536,19 @@ export function eventsToAssembleSpec(events, opts = {}) {
|
|
|
508
536
|
// FULL-duration outgoing tail.
|
|
509
537
|
const pre = c.pre ?? c.durationFrames / 2;
|
|
510
538
|
const post = c.durationFrames - pre;
|
|
539
|
+
// OTIO/XMEML fades (E92): a zero-length BL leg MATERIALIZES to cover its
|
|
540
|
+
// side of the span whenever the boundary shift alone won't grow it —
|
|
541
|
+
// empty track renders black, so growth beyond the picture is
|
|
542
|
+
// render-neutral, and placeTransition needs a physical item on each side
|
|
543
|
+
// of the junction. (The CMX pre===0 form grows through the shift below.)
|
|
544
|
+
if (isBL(prev.source) && prev.cutRef.durationFrames === 0 && pre > 0) {
|
|
545
|
+
prev.cutRef.startFrame -= pre;
|
|
546
|
+
prev.cutRef.durationFrames += pre;
|
|
547
|
+
prev.start -= pre;
|
|
548
|
+
}
|
|
549
|
+
if (isBL(c.source) && c.incomingCutRef.durationFrames === 0 && post > 0) {
|
|
550
|
+
c.incomingCutRef.durationFrames += post;
|
|
551
|
+
}
|
|
511
552
|
// A BL side has infinite handles: a Solid Color generator extends freely
|
|
512
553
|
// in both directions (srcIn is already Infinity on BL candidates).
|
|
513
554
|
const bHandle = c.srcIn >= pre;
|
|
@@ -162,13 +162,31 @@ export function parseOTIO(otio, opts = {}) {
|
|
|
162
162
|
// field so the bridge can author it (type strings like SMPTE_Dissolve
|
|
163
163
|
// map through the same style table as XMEML effectids).
|
|
164
164
|
let pendingTransition = null;
|
|
165
|
+
// Track start counts as black: a Transition with a Gap (or nothing) on
|
|
166
|
+
// one side is a FADE. It routes through the same BL machinery as EDL BL
|
|
167
|
+
// dissolves (E91/E92): a synthetic zero-length BL event materializes the
|
|
168
|
+
// black side, and the bridge authors a real clip↔generator dissolve —
|
|
169
|
+
// empty track renders black anyway, so the growth is render-neutral.
|
|
170
|
+
let atBlack = true;
|
|
171
|
+
const lastRate = () => opts.fps || 24;
|
|
165
172
|
for (const child of track.children || []) {
|
|
166
173
|
const schema = child.OTIO_SCHEMA || '';
|
|
167
174
|
const dur = (child.source_range && child.source_range.duration && child.source_range.duration.value) || 0;
|
|
168
175
|
const rate = (child.source_range && child.source_range.duration && child.source_range.duration.rate) || opts.fps || 24;
|
|
169
176
|
if (schema.startsWith('Gap')) {
|
|
177
|
+
if (pendingTransition) {
|
|
178
|
+
// Transition then Gap = fade-out into black: attach it to a
|
|
179
|
+
// synthetic BL leg at the junction (the bridge grows it forward).
|
|
180
|
+
events.push(evt({
|
|
181
|
+
index: idx++, track: kind, source: 'BL',
|
|
182
|
+
recIn: rec, recOut: rec, transition: pendingTransition, fps: lastRate(),
|
|
183
|
+
}));
|
|
184
|
+
pendingTransition = null;
|
|
185
|
+
} else {
|
|
186
|
+
pendingTransition = null; // a mid-timeline gap breaks a junction
|
|
187
|
+
}
|
|
170
188
|
rec += dur;
|
|
171
|
-
|
|
189
|
+
atBlack = true;
|
|
172
190
|
continue;
|
|
173
191
|
}
|
|
174
192
|
if (schema.startsWith('Transition')) {
|
|
@@ -180,6 +198,15 @@ export function parseOTIO(otio, opts = {}) {
|
|
|
180
198
|
continue;
|
|
181
199
|
}
|
|
182
200
|
if (schema.startsWith('Clip')) {
|
|
201
|
+
if (pendingTransition && atBlack) {
|
|
202
|
+
// Gap (or track start) then Transition then Clip = fade-IN from
|
|
203
|
+
// black — the CMX zero-length-BL form, grown by the bridge.
|
|
204
|
+
events.push(evt({
|
|
205
|
+
index: idx++, track: kind, source: 'BL',
|
|
206
|
+
recIn: rec, recOut: rec, fps: rate,
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
209
|
+
atBlack = false;
|
|
183
210
|
const startVal = (child.source_range && child.source_range.start_time && child.source_range.start_time.value) || 0;
|
|
184
211
|
// Retime via a LinearTimeWarp effect (time_scalar).
|
|
185
212
|
let speed = 100,
|
|
@@ -220,6 +247,13 @@ export function parseOTIO(otio, opts = {}) {
|
|
|
220
247
|
rec += dur;
|
|
221
248
|
}
|
|
222
249
|
}
|
|
250
|
+
if (pendingTransition) {
|
|
251
|
+
// Transition as the LAST child = fade-out to the end of the track.
|
|
252
|
+
events.push(evt({
|
|
253
|
+
index: idx++, track: kind, source: 'BL',
|
|
254
|
+
recIn: rec, recOut: rec, transition: pendingTransition, fps: lastRate(),
|
|
255
|
+
}));
|
|
256
|
+
}
|
|
223
257
|
}
|
|
224
258
|
return events;
|
|
225
259
|
}
|
|
@@ -289,7 +323,28 @@ export function parseXMEMLEvents(xml, opts = {}) {
|
|
|
289
323
|
// recStart carries the transitionitem's EXPLICIT record span start
|
|
290
324
|
// (sequence-relative) so the bridge reproduces the editor's actual
|
|
291
325
|
// alignment instead of assuming centered.
|
|
292
|
-
if (incoming)
|
|
326
|
+
if (incoming) {
|
|
327
|
+
incoming.transition = { type: String(effectId), duration: e2 - s, recStart: s };
|
|
328
|
+
// No clip ENDS inside the span → nothing precedes: a fade-IN from
|
|
329
|
+
// black. Synthesize the zero-length BL leg (E91/E92) so the bridge
|
|
330
|
+
// authors a real black-to-picture dissolve instead of dropping it.
|
|
331
|
+
const outgoing = events.slice(before).find((ev) => ev.track === label && ev !== incoming && ev.recOut > s - 1 && ev.recOut <= e2);
|
|
332
|
+
if (!outgoing) {
|
|
333
|
+
events.push(evt({ index: idx++, track: label, source: 'BL', recIn: incoming.recIn, recOut: incoming.recIn, fps: seqRate }));
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
// No clip STARTS inside the span: a fade-OUT into black past the
|
|
337
|
+
// last clip. Attach the transition to a synthetic BL leg at the
|
|
338
|
+
// outgoing clip's end (the bridge grows it forward).
|
|
339
|
+
const outgoing = events.slice(before).find((ev) => ev.track === label && ev.recOut > s - 1 && ev.recOut <= e2);
|
|
340
|
+
if (outgoing) {
|
|
341
|
+
events.push(evt({
|
|
342
|
+
index: idx++, track: label, source: 'BL',
|
|
343
|
+
recIn: outgoing.recOut, recOut: outgoing.recOut,
|
|
344
|
+
transition: { type: String(effectId), duration: e2 - s, recStart: s }, fps: seqRate,
|
|
345
|
+
}));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
293
348
|
}
|
|
294
349
|
});
|
|
295
350
|
const atracks = media.audio && media.audio.track ? (Array.isArray(media.audio.track) ? media.audio.track : [media.audio.track]) : [];
|
|
@@ -153,7 +153,7 @@ function requirePathArg(args, key, action) {
|
|
|
153
153
|
export const drtTool = {
|
|
154
154
|
name: 'drt',
|
|
155
155
|
description:
|
|
156
|
-
'DaVinci Resolve Timeline (.drt) operations — offline, no Resolve required. Actions: assemble_from_interchange (EDL/OTIO/XML/AAF + sourceMap → IMPORTABLE RENDERING native .drt in one call; retimes AUTHOR — constant speed fwd/rev AND zero-speed freezes (EDL M2 000.0; render-proven frozen); cross-dissolves are AUTHORED when the cut abuts with handles both sides (render-verified on 19), else dropped with reason; EDL BL
|
|
156
|
+
'DaVinci Resolve Timeline (.drt) operations — offline, no Resolve required. Actions: assemble_from_interchange (EDL/OTIO/XML/AAF + sourceMap → IMPORTABLE RENDERING native .drt in one call; retimes AUTHOR — constant speed fwd/rev AND zero-speed freezes (EDL M2 000.0; render-proven frozen); cross-dissolves are AUTHORED when the cut abuts with handles both sides (render-verified on 19), else dropped with reason; fades AUTHOR across ALL FOUR formats (EDL BL legs, OTIO gap-adjacent Transitions, XMEML edge transitionitems, AAF filler-adjacent Transitions) and AAF overlap-consuming dissolves reconcile+author (CutPoint honored; before E93 they threw at the overlap gate) — BL legs become Solid Color generators and the fade a real clip-to-generator dissolve, luma-ramp render-verified, while Resolve\'s OWN EDL importer drops BL dissolves silently; ledger in `conform`), assemble (spec → IMPORTABLE native-schema .drt via template-spliced real structures; pass targetAppVersion e.g. \'19.1\' for pre-21 hosts), parse, list_sequences (enumerate the timelines inside a .drp/.drt → [{id,name,eventCount,index}] to drive a "which sequence?" picker), author, validate, inject_into_drp, extract_from_drp (pull one SeqContainer out as a .drt — feed the .drt to the Python davinci-resolve MCP timeline.import_timeline_checked, or use timeline.import_from_drp to do both), downgrade (stamp <ProjectVersion> down so an OLDER Resolve will import a .drt/.drp from a newer one — pass targetAppVersion like "19.1.3" or targetProjectVersion).',
|
|
157
157
|
async handler({ action, args }) {
|
|
158
158
|
if (action === 'parse') {
|
|
159
159
|
const p = parseSchema.parse(requirePathArg(args, 'drtPath', 'parse'));
|
package/src/granular/common.py
CHANGED
|
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
|
|
|
87
87
|
handlers=[logging.StreamHandler()],
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
VERSION = "2.
|
|
90
|
+
VERSION = "2.152.0"
|
|
91
91
|
logger = logging.getLogger("davinci-resolve-mcp")
|
|
92
92
|
logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
|
|
93
93
|
logger.info(f"Detected platform: {get_platform()}")
|