davinci-resolve-mcp 2.179.0 → 2.181.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 +29 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/docs/reference/api-limitations.md +1 -1
- package/install.py +1 -1
- package/package.json +1 -1
- package/resolve-advanced/server/aaf.mjs +3 -0
- package/resolve-advanced/server/aaf_probe.py +16 -0
- package/resolve-advanced/server/sequences.mjs +17 -1
- package/resolve-advanced/server/tools/drt.mjs +1 -1
- package/resolve-advanced/server/tools/editorial.mjs +1 -1
- package/resolve-advanced/vendor/drt-format/drt-parser.js +49 -5
- package/src/granular/common.py +1 -1
- package/src/server.py +1 -1
- package/src/utils/api_truth.py +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
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.181.0 — E127: DRT timelines get their real names, and compounds their kind
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **`drt.parse` / `list_sequences` named a timeline after its first clip.**
|
|
10
|
+
A SeqContainer XML carries no timeline name — its first `<Name>` is the
|
|
11
|
+
first clip's — so Resolve's DRT export of a compound timeline listed
|
|
12
|
+
"cut_src.mp4" and "white_src.mp4" as sequences (measured on 19.1.3.7; the
|
|
13
|
+
export is a permanent fixture). The pool folder's `Sm2MpTimelineClip` and
|
|
14
|
+
`Sm2MpCompoundClip` embed the `Sm2Sequence` each container's `<Sequence>`
|
|
15
|
+
names; the parser now takes names and `kind` (`timeline` | `compound`) from
|
|
16
|
+
there, tags a media-less clip named after a compound as `compound`, and
|
|
17
|
+
`list_sequences` reports `kind` and `nestedIn` so a picker can demote the
|
|
18
|
+
compound containers (E57_IN nested in E57_OUT, nested in E57_NESTED). The
|
|
19
|
+
bundled media template's sequence now lists by its real name,
|
|
20
|
+
`MediaTemplate`, where it used to read as its clip `sample.mp4`.
|
|
21
|
+
|
|
22
|
+
## What's New in v2.180.0 — E126: the sequence picker knows a nested composition from a turnover
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **`list_sequences` flags nested AAF compositions.** An Avid nested sequence
|
|
27
|
+
(a composition another composition uses as a clip) listed as a peer of the
|
|
28
|
+
timeline that uses it, so a "which sequence?" picker offered the inner
|
|
29
|
+
composition as a turnover of its own. Each AAF sequence now reports
|
|
30
|
+
`nests` (the compositions it flattens) and `nestedIn` (the sequences that
|
|
31
|
+
use it); nested compositions still list — their cuts also arrive flattened
|
|
32
|
+
inside the parent (E125) — but a picker can demote them.
|
|
33
|
+
|
|
5
34
|
## What's New in v2.179.0 — E125: an Avid nested sequence used as a clip flattens into the parent
|
|
6
35
|
|
|
7
36
|
### Fixed
|
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.181.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
|
@@ -313,7 +313,7 @@ equivalent, blocking full automation.
|
|
|
313
313
|
|
|
314
314
|
- **Object:** `MediaPool`
|
|
315
315
|
- **Signature:** `(filePath.xml) -> Timeline`
|
|
316
|
-
- **Behavior:** Resolve's FCP7 XML importer HONOURS a generatoritem's `fillcolor` parameter (measured on Studio 19.1.3.7, E110): a Premiere-shaped Color Matte (effectid Color, category Matte) and a Solid Color generatoritem, both with <red>/<green>/<blue>/<alpha> 0..255 values, imported as Solid Color items and rendered Y81 U90 V240 (red) and Y41 U240 V110 (blue) — exact BT.601 limited-range values for a 640x360 timeline. EXPORT_FCP_7_XML writes the fillcolor back (same 0..255 channels). EXPORT_DRT carries the colour as a 55-byte <EffectFiltersBA> on the Sm2TiGenerator: 8-byte header (version 2, length 47), a fixed 20-byte prefix, a flag byte, then big-endian uint16 A R G B (0xffff = full) plus a pad word, then a second, black colour record; only the ARGB words differed between the red and blue captures. The default generator has an EMPTY EffectFiltersBA. The same importer does NOT carry a TRANSITION's parameters: a `Dip to Color Dissolve` transitionitem with a white and with a red `color` parameter imported as `Dip To Color Dissolve` elements whose 37-byte EffectFiltersBA were byte-identical (defaults), and the transition rendered inert (luma flat through its window, the E66 law) — the dip colour stays GUI-only on 19.1.3.7 (measured, E111). The writer emits a Solid Color's colour as the FxPlug parameter `input_1` (effectid FxPlugWrapper:C18E8B62_…), not `fillcolor` — an authored EffectFiltersBA colour came back exactly (white, 128/64/191; E112). The OTIO writer CANNOT: EXPORT_OTIO emits a Solid Color as a Clip.2 named 'Solid Color' with a NULL media_reference, metadata {"Resolve_OTIO": {}} and a parameterless Transform effect — no colour anywhere (measured E117) — so only an XML re-export witnesses a generator colour (editorial.verify_roundtrip exportedFormat → generatorColourNotInExport). Such an OTIO export DOES re-conform through drt.assemble_from_interchange (E118): the media-less generator clips walk as black legs and the clip→generator fade renders 124→16 — black, the colour having been lost by the writer. COMPOUND CLIPS: EXPORT_OTIO nests a compound as a Stack.1 inside the track (its source_range = the trim window into the compound; nested compounds nest Stacks recursively — measured E120 on a depth-2 timeline), while EXPORT_FCP_7_XML flattens the compound to a single media-less clipitem named after it (no inner content). editorial.parse_interchange flattens the OTIO Stacks into record time (fromCompound on each cut).
|
|
316
|
+
- **Behavior:** Resolve's FCP7 XML importer HONOURS a generatoritem's `fillcolor` parameter (measured on Studio 19.1.3.7, E110): a Premiere-shaped Color Matte (effectid Color, category Matte) and a Solid Color generatoritem, both with <red>/<green>/<blue>/<alpha> 0..255 values, imported as Solid Color items and rendered Y81 U90 V240 (red) and Y41 U240 V110 (blue) — exact BT.601 limited-range values for a 640x360 timeline. EXPORT_FCP_7_XML writes the fillcolor back (same 0..255 channels). EXPORT_DRT carries the colour as a 55-byte <EffectFiltersBA> on the Sm2TiGenerator: 8-byte header (version 2, length 47), a fixed 20-byte prefix, a flag byte, then big-endian uint16 A R G B (0xffff = full) plus a pad word, then a second, black colour record; only the ARGB words differed between the red and blue captures. The default generator has an EMPTY EffectFiltersBA. The same importer does NOT carry a TRANSITION's parameters: a `Dip to Color Dissolve` transitionitem with a white and with a red `color` parameter imported as `Dip To Color Dissolve` elements whose 37-byte EffectFiltersBA were byte-identical (defaults), and the transition rendered inert (luma flat through its window, the E66 law) — the dip colour stays GUI-only on 19.1.3.7 (measured, E111). The writer emits a Solid Color's colour as the FxPlug parameter `input_1` (effectid FxPlugWrapper:C18E8B62_…), not `fillcolor` — an authored EffectFiltersBA colour came back exactly (white, 128/64/191; E112). The OTIO writer CANNOT: EXPORT_OTIO emits a Solid Color as a Clip.2 named 'Solid Color' with a NULL media_reference, metadata {"Resolve_OTIO": {}} and a parameterless Transform effect — no colour anywhere (measured E117) — so only an XML re-export witnesses a generator colour (editorial.verify_roundtrip exportedFormat → generatorColourNotInExport). Such an OTIO export DOES re-conform through drt.assemble_from_interchange (E118): the media-less generator clips walk as black legs and the clip→generator fade renders 124→16 — black, the colour having been lost by the writer. COMPOUND CLIPS: EXPORT_OTIO nests a compound as a Stack.1 inside the track (its source_range = the trim window into the compound; nested compounds nest Stacks recursively — measured E120 on a depth-2 timeline), while EXPORT_FCP_7_XML flattens the compound to a single media-less clipitem named after it (no inner content). editorial.parse_interchange flattens the OTIO Stacks into record time (fromCompound on each cut). EXPORT_DRT of the same timeline holds THREE SeqContainers (top + one per compound); a SeqContainer XML carries NO timeline name — its first <Name> is the first clip's — while MediaPool/Master/MpFolder.xml's Sm2MpTimelineClip / Sm2MpCompoundClip embed the <Sm2Sequence DbId> the container's track-level <Sequence> names (measured E127); the compound on the parent track is a plain Sm2TiVideoClip named after it with no MediaFilePath.
|
|
317
317
|
- **Workaround / current handling:** Author fade-to-white / colour mattes by placing a Solid Color generator with that blob (drp-format placeGenerator `color`, drt.assemble elements[].color) — or carry an XMEML generatoritem fillcolor through editorial.parse_interchange; the bridge authors the coloured leg.
|
|
318
318
|
- **Tags:** xml, import, generator, colour, export, drt
|
|
319
319
|
|
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.181.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
|
@@ -103,6 +103,9 @@ function sequenceSummary(s) {
|
|
|
103
103
|
startFrame: s.startFrame ?? null,
|
|
104
104
|
startTimecodeFps: s.startTimecodeFps ?? null,
|
|
105
105
|
startTimecodeDrop: s.startTimecodeDrop ?? null,
|
|
106
|
+
// E126: a composition another composition uses as a clip is NESTED — a
|
|
107
|
+
// picker should not offer it as a turnover of its own.
|
|
108
|
+
nestedIn: Array.isArray(s.nestedIn) ? s.nestedIn : [],
|
|
106
109
|
};
|
|
107
110
|
if (s.unhandled && Object.keys(s.unhandled).length) out.unhandled = s.unhandled;
|
|
108
111
|
return out;
|
|
@@ -1089,6 +1089,7 @@ def _walk_segment(segment, *, track, fps, rec, state, depth=0, transition=None):
|
|
|
1089
1089
|
nested = _nested_named_composition(segment)
|
|
1090
1090
|
if nested is not None and depth < _MAX_DEPTH:
|
|
1091
1091
|
comp_mob, inner_segment = nested
|
|
1092
|
+
state.setdefault("nestedRefs", set()).add(_usable_name(comp_mob))
|
|
1092
1093
|
length = _length(segment)
|
|
1093
1094
|
try:
|
|
1094
1095
|
start = int(getattr(segment, "start", 0) or 0)
|
|
@@ -1578,9 +1579,24 @@ def probe(path):
|
|
|
1578
1579
|
# A conform that silently loses 29 titles looks exactly like a
|
|
1579
1580
|
# conform that had none. Counted by operation name so it cannot.
|
|
1580
1581
|
"effectsWithoutEvents": dict(sorted(state.get("effectsWithoutEvents", {}).items())),
|
|
1582
|
+
# Compositions this sequence uses as clips (E126): the picker
|
|
1583
|
+
# should not offer a NESTED sequence as a turnover of its own.
|
|
1584
|
+
"nests": sorted(state.get("nestedRefs", set())),
|
|
1585
|
+
"nestedIn": [],
|
|
1581
1586
|
"events": events,
|
|
1582
1587
|
}
|
|
1583
1588
|
)
|
|
1589
|
+
# A composition used as a clip by another composition is NESTED in it — flag the
|
|
1590
|
+
# child so a "which sequence?" picker can demote it (it still lists; its cuts also
|
|
1591
|
+
# arrive flattened inside the parent, E125).
|
|
1592
|
+
by_name = {}
|
|
1593
|
+
for seq in sequences:
|
|
1594
|
+
by_name.setdefault(seq["name"], []).append(seq)
|
|
1595
|
+
for parent in sequences:
|
|
1596
|
+
for child_name in parent.get("nests", []):
|
|
1597
|
+
for child in by_name.get(child_name, []):
|
|
1598
|
+
if child is not parent and parent["name"] not in child["nestedIn"]:
|
|
1599
|
+
child["nestedIn"].append(parent["name"])
|
|
1584
1600
|
return sequences
|
|
1585
1601
|
|
|
1586
1602
|
|
|
@@ -45,7 +45,21 @@ export function detectFormat(filePath, explicit) {
|
|
|
45
45
|
|
|
46
46
|
/** Map a parseDRT() result → uniform [{id,name,eventCount,index}]. Shared with the drt tool. */
|
|
47
47
|
export function summarizeDrtTimelines(parsed) {
|
|
48
|
-
|
|
48
|
+
const tls = parsed.timelines || [];
|
|
49
|
+
// E127: a compound container is NESTED in every timeline/compound whose
|
|
50
|
+
// tracks place a clip named after it — the picker should offer the parent.
|
|
51
|
+
const nestedIn = new Map();
|
|
52
|
+
for (const tl of tls) {
|
|
53
|
+
for (const t of tl.videoTracks || []) {
|
|
54
|
+
for (const c of t.clips || []) {
|
|
55
|
+
if (c.compound) {
|
|
56
|
+
if (!nestedIn.has(c.compound)) nestedIn.set(c.compound, []);
|
|
57
|
+
if (!nestedIn.get(c.compound).includes(tl.name)) nestedIn.get(c.compound).push(tl.name);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return tls.map((tl, index) => {
|
|
49
63
|
const vids = (tl.videoTracks || []).reduce((n, t) => n + (t.clips ? t.clips.length : 0), 0);
|
|
50
64
|
const auds = (tl.audioTracks || []).reduce((n, t) => n + (t.clips ? t.clips.length : 0), 0);
|
|
51
65
|
return {
|
|
@@ -53,6 +67,8 @@ export function summarizeDrtTimelines(parsed) {
|
|
|
53
67
|
name: tl.name || `Sequence ${index + 1}`,
|
|
54
68
|
eventCount: vids + auds,
|
|
55
69
|
index,
|
|
70
|
+
...(tl.kind ? { kind: tl.kind } : {}),
|
|
71
|
+
nestedIn: nestedIn.get(tl.name) || [],
|
|
56
72
|
};
|
|
57
73
|
});
|
|
58
74
|
}
|
|
@@ -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; 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).',
|
|
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,kind,nestedIn}] to drive a "which sequence?" picker — names and kind (timeline|compound) come from the pool folder, since a SeqContainer carries no timeline name and its first <Name> is a CLIP\'s (measured, E127); a compound container is nestedIn every timeline that places it, and a media-less clip named after a compound is tagged `compound` in parse), 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'));
|
|
@@ -86,7 +86,7 @@ const markerSchema = z.object({
|
|
|
86
86
|
export const editorialTool = {
|
|
87
87
|
name: 'editorial',
|
|
88
88
|
description:
|
|
89
|
-
'Editorial integrity (Cluster E) — turnover interchange → normalized events → changelist + conform manifest with TIMING silent-lie guards (flattened retime / dropped J/L-cut audio / framerate-pulldown slip / reverse dropped / transition-handle starvation → flag, skip-not-fake). Report-only (gate: review). Actions: parse_interchange (EDL/OTIO/XMEML natively — incl. Resolve-written OTIO generator clips (a Solid Color is a Clip with a NULL media_reference; it walks as a BL leg with generatorName, and an OTIO GeneratorReference carries its colour) and nested OTIO Stacks (compound clips — Resolve\'s writer nests them with a trim window) FLATTEN into record time with fromCompound on each cut, so Resolve\'s own OTIO exports re-conform (its FCP7 XML writer flattens a compound to ONE media-less clipitem instead — tagged `compound`, which the bridge drops with a reason in unresolvedCompounds unless the sourceMap maps the compound name to a flattened media file), Resolve-written FCP7 -1 junction edges (paired in record order) + Solid Color / Color Matte generators carrying their `fillcolor` (BL legs with `color` → fade-to-white and colour mattes author, E110), XMEML audio-track transitionitems as audio cross-fades on numbered lanes A/A2/…, and CMX FROM/TO CLIP NAME comments over the generic AX reel — + AAF via pyaaf2 (flat sound/picture slots number A/A2/… and V/V2/… in slot order so separate beds keep their lanes; NestedScope layers keep layer numbering; a NESTED SEQUENCE used as a clip — a SourceClip referencing a named CompositionMob — flattens through its reference window with fromCompound, like OTIO Stacks) + PRPROJ via gunzip+XML → normalized events incl. span-explicit transitions, BL fade legs, and freezes as zero-speed events (OTIO FreezeFrame, XMEML timeremap 0, PrProj in==out, AAF 0% motion effects); for AAF/PRPROJ pass the file PATH as content; AAF also returns per-sequence startTimecode/startFrame — build the timeline at THAT start, not the Resolve 01:00:00:00 default — and per-clip `geometry` for Avid transform effects), list_sequences (ONE offline picker entry point across xml/edl/otio/drt/drp/aaf/prproj → [{id,name,eventCount}], plus startTimecode/startFrame for AAF), convert_to_interchange (author OTIO/EDL/DRT Resolve CAN import from events or a parsed source; the EDL target writes CMX transition pairs incl. BL fades — the .prproj→Resolve conform bridge, no Premiere needed; editorial timing/transitions survive and per-clip effects/color do not. SPEED/REVERSE survive on the otio (LinearTimeWarp) and edl (M2) targets ONLY — this FLAT drt target flattens every retime to 100% forward and returns `flattened`/`flattenedCount` naming each event that lost one (`flattened` is always present on `drt`, empty when there were none); for a .drt that AUTHORS retimes/dissolves/multi-track/audio, use drt.assemble_from_interchange), turnover_changelist (diff old vs new → moved/retimed/trimmed/replaced/new/gone PLUS the junction diff: transition_added/transition_dropped/transition_changed with fade in/out or dissolve, outgoing/incoming, span and duration/type/pre-roll deltas — zero-length CMX carrier lines and the BL legs that carry fades fold into the junction diff instead of reading as gone/new sources; events pair by closest record position, consumed once, so a source cut twice at two speeds compares instance to instance; + timing flags incl. transition_dropped and dropped_split_audio on any A-track; a compound seen collapsed in one cut and flattened in the other reports compound_collapsed/compound_expanded once, never replaced+gone), conform_manifest (per-event assert: source resolved/handles/retime/reverse/TC-base; BL-aware — black legs need no source, fades no black-side handles, and a fade-out tail requirement lands on the picture source; a compound clipitem fails source_resolved by NAME with the remedy — map it to a flattened file or turn over as OTIO), marker_roundtrip (markers with provenance tags), verify_roundtrip (input events vs re-export events -> pass/mismatches + fitted per-source TC offsets + marker compare w/ markersNotInExport honesty flag; FADE-AWARE: BL/Solid-Color legs merge out as blackSegments and fade-window boundary reshapes are excused into fadeReshapedBoundaries instead of failing; RETIME-AWARE: speed/reverse compare pairwise — EXPORT_OTIO carries an authored Sm2TimeMap back as LinearTimeWarp (measured), so a flattened/lost retime fails as drift geometry alone cannot catch; AUDIO-AWARE: declared audio events compare (a video-only export such as EXPORT_EDL flags audioNotInExport instead of failing) (channel legs deduped, mismatches tagged trackType audio) while the mirrored-A1 export of a video-only turnover stays informational; COLOUR-AWARE: an input generator leg carrying a fillcolor (fade-to-white, colour matte) must come back on the same track over its span with the same colour — Resolve\'s FCP7 writer emits it — else generator-colour fails (generatorColours reports the compare) — pass exportedFormat: an OTIO/EDL re-export cannot carry colour (measured) and reports generatorColourNotInExport instead of failing; COMPOUND-AWARE: an XML re-export that collapsed a compound to one clipitem over cuts the input flattened from that compound reports compoundsCollapsedInExport instead of count/source drift; the conform QC loop-closer). Offline (AAF needs pyaaf2; live AAF/DRP import is on the Python davinci-resolve MCP).',
|
|
89
|
+
'Editorial integrity (Cluster E) — turnover interchange → normalized events → changelist + conform manifest with TIMING silent-lie guards (flattened retime / dropped J/L-cut audio / framerate-pulldown slip / reverse dropped / transition-handle starvation → flag, skip-not-fake). Report-only (gate: review). Actions: parse_interchange (EDL/OTIO/XMEML natively — incl. Resolve-written OTIO generator clips (a Solid Color is a Clip with a NULL media_reference; it walks as a BL leg with generatorName, and an OTIO GeneratorReference carries its colour) and nested OTIO Stacks (compound clips — Resolve\'s writer nests them with a trim window) FLATTEN into record time with fromCompound on each cut, so Resolve\'s own OTIO exports re-conform (its FCP7 XML writer flattens a compound to ONE media-less clipitem instead — tagged `compound`, which the bridge drops with a reason in unresolvedCompounds unless the sourceMap maps the compound name to a flattened media file), Resolve-written FCP7 -1 junction edges (paired in record order) + Solid Color / Color Matte generators carrying their `fillcolor` (BL legs with `color` → fade-to-white and colour mattes author, E110), XMEML audio-track transitionitems as audio cross-fades on numbered lanes A/A2/…, and CMX FROM/TO CLIP NAME comments over the generic AX reel — + AAF via pyaaf2 (flat sound/picture slots number A/A2/… and V/V2/… in slot order so separate beds keep their lanes; NestedScope layers keep layer numbering; a NESTED SEQUENCE used as a clip — a SourceClip referencing a named CompositionMob — flattens through its reference window with fromCompound, like OTIO Stacks) + PRPROJ via gunzip+XML → normalized events incl. span-explicit transitions, BL fade legs, and freezes as zero-speed events (OTIO FreezeFrame, XMEML timeremap 0, PrProj in==out, AAF 0% motion effects); for AAF/PRPROJ pass the file PATH as content; AAF also returns per-sequence startTimecode/startFrame — build the timeline at THAT start, not the Resolve 01:00:00:00 default — and per-clip `geometry` for Avid transform effects), list_sequences (ONE offline picker entry point across xml/edl/otio/drt/drp/aaf/prproj → [{id,name,eventCount}], plus startTimecode/startFrame for AAF and nestedIn — an AAF composition another composition uses as a clip is NESTED in it; offer the parent, its cuts arrive flattened), convert_to_interchange (author OTIO/EDL/DRT Resolve CAN import from events or a parsed source; the EDL target writes CMX transition pairs incl. BL fades — the .prproj→Resolve conform bridge, no Premiere needed; editorial timing/transitions survive and per-clip effects/color do not. SPEED/REVERSE survive on the otio (LinearTimeWarp) and edl (M2) targets ONLY — this FLAT drt target flattens every retime to 100% forward and returns `flattened`/`flattenedCount` naming each event that lost one (`flattened` is always present on `drt`, empty when there were none); for a .drt that AUTHORS retimes/dissolves/multi-track/audio, use drt.assemble_from_interchange), turnover_changelist (diff old vs new → moved/retimed/trimmed/replaced/new/gone PLUS the junction diff: transition_added/transition_dropped/transition_changed with fade in/out or dissolve, outgoing/incoming, span and duration/type/pre-roll deltas — zero-length CMX carrier lines and the BL legs that carry fades fold into the junction diff instead of reading as gone/new sources; events pair by closest record position, consumed once, so a source cut twice at two speeds compares instance to instance; + timing flags incl. transition_dropped and dropped_split_audio on any A-track; a compound seen collapsed in one cut and flattened in the other reports compound_collapsed/compound_expanded once, never replaced+gone), conform_manifest (per-event assert: source resolved/handles/retime/reverse/TC-base; BL-aware — black legs need no source, fades no black-side handles, and a fade-out tail requirement lands on the picture source; a compound clipitem fails source_resolved by NAME with the remedy — map it to a flattened file or turn over as OTIO), marker_roundtrip (markers with provenance tags), verify_roundtrip (input events vs re-export events -> pass/mismatches + fitted per-source TC offsets + marker compare w/ markersNotInExport honesty flag; FADE-AWARE: BL/Solid-Color legs merge out as blackSegments and fade-window boundary reshapes are excused into fadeReshapedBoundaries instead of failing; RETIME-AWARE: speed/reverse compare pairwise — EXPORT_OTIO carries an authored Sm2TimeMap back as LinearTimeWarp (measured), so a flattened/lost retime fails as drift geometry alone cannot catch; AUDIO-AWARE: declared audio events compare (a video-only export such as EXPORT_EDL flags audioNotInExport instead of failing) (channel legs deduped, mismatches tagged trackType audio) while the mirrored-A1 export of a video-only turnover stays informational; COLOUR-AWARE: an input generator leg carrying a fillcolor (fade-to-white, colour matte) must come back on the same track over its span with the same colour — Resolve\'s FCP7 writer emits it — else generator-colour fails (generatorColours reports the compare) — pass exportedFormat: an OTIO/EDL re-export cannot carry colour (measured) and reports generatorColourNotInExport instead of failing; COMPOUND-AWARE: an XML re-export that collapsed a compound to one clipitem over cuts the input flattened from that compound reports compoundsCollapsedInExport instead of count/source drift; the conform QC loop-closer). Offline (AAF needs pyaaf2; live AAF/DRP import is on the Python davinci-resolve MCP).',
|
|
90
90
|
async handler({ action, args }) {
|
|
91
91
|
if (action === 'parse_interchange') {
|
|
92
92
|
const p = parseSchema.parse(args);
|
|
@@ -58,6 +58,7 @@ function extractClipsFromTrackXml(trackXml, trackType) {
|
|
|
58
58
|
}
|
|
59
59
|
clips.push({
|
|
60
60
|
clipId: m[3],
|
|
61
|
+
name: extractScalar(inner, 'Name'),
|
|
61
62
|
start,
|
|
62
63
|
duration,
|
|
63
64
|
mediaFilePath,
|
|
@@ -94,9 +95,44 @@ function extractTracks(seqXml, trackVecTag, trackTagBase, trackType) {
|
|
|
94
95
|
return tracks;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
/**
|
|
99
|
+
* The pool folder's own naming of every sequence (E127, measured against
|
|
100
|
+
* Resolve 19.1.3.7's EXPORT_DRT of a compound timeline): a SeqContainer XML
|
|
101
|
+
* carries NO timeline name — its first <Name> is the first CLIP's — while
|
|
102
|
+
* MediaPool/Master/MpFolder.xml holds an Sm2MpTimelineClip (a timeline) or
|
|
103
|
+
* Sm2MpCompoundClip (a compound) whose EMBEDDED <Sm2Sequence DbId=X> equals
|
|
104
|
+
* the container's track-level <Sequence>X</Sequence>. Map X → {name, kind}.
|
|
105
|
+
*/
|
|
106
|
+
async function loadPoolSequenceNames(zip) {
|
|
107
|
+
const map = new Map();
|
|
108
|
+
const entries = [];
|
|
109
|
+
zip.forEach((p, e) => { if (!e.dir && /(^|\/)MpFolder[^/]*\.xml$/.test(p)) entries.push(p); });
|
|
110
|
+
for (const p of entries) {
|
|
111
|
+
const xml = await zip.file(p).async('string');
|
|
112
|
+
const re = /<(Sm2MpTimelineClip|Sm2MpCompoundClip) DbId="([^"]+)">([\s\S]*?)<\/\1>/g;
|
|
113
|
+
let m;
|
|
114
|
+
while ((m = re.exec(xml)) !== null) {
|
|
115
|
+
const body = m[3];
|
|
116
|
+
const name = extractScalar(body, 'Name');
|
|
117
|
+
const seqRe = /<Sm2Sequence DbId="([^"]+)">/g;
|
|
118
|
+
let sm;
|
|
119
|
+
while ((sm = seqRe.exec(body)) !== null) {
|
|
120
|
+
if (!map.has(sm[1])) map.set(sm[1], { name, kind: m[1] === 'Sm2MpCompoundClip' ? 'compound' : 'timeline' });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return map;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function parseSeqContainer(seqXml, sequenceName, poolNames = new Map()) {
|
|
128
|
+
const seqId = extractScalar(seqXml, 'Sequence');
|
|
129
|
+
const pool = seqId ? poolNames.get(seqId) : null;
|
|
130
|
+
const compoundNames = new Set([...poolNames.values()].filter((v) => v.kind === 'compound' && v.name).map((v) => v.name));
|
|
131
|
+
const parsed = {
|
|
132
|
+
// The pool's name for this sequence when the export carries one; the
|
|
133
|
+
// first <Name> in the container is a CLIP name and only a fallback.
|
|
134
|
+
name: (pool && pool.name) || extractScalar(seqXml, 'Name') || sequenceName,
|
|
135
|
+
kind: pool ? pool.kind : null,
|
|
100
136
|
sequence: sequenceName,
|
|
101
137
|
frameRate: extractScalar(seqXml, 'FrameRate'),
|
|
102
138
|
startTimecode: extractScalar(seqXml, 'StartTC'),
|
|
@@ -107,9 +143,16 @@ function parseSeqContainer(seqXml, sequenceName) {
|
|
|
107
143
|
if (w === null || h === null) return null;
|
|
108
144
|
return `${w}x${h}`;
|
|
109
145
|
})(),
|
|
110
|
-
videoTracks: extractTracks(seqXml, 'VideoTrackVec', 'Sm2TiVideoTrack', 'video')
|
|
146
|
+
videoTracks: extractTracks(seqXml, 'VideoTrackVec', 'Sm2TiVideoTrack', 'video').map((t) => ({
|
|
147
|
+
...t,
|
|
148
|
+
// A media-less clip named after a compound in the pool IS that compound
|
|
149
|
+
// placed on this track (E127) — tag it so consumers do not read it as a
|
|
150
|
+
// missing source.
|
|
151
|
+
clips: (t.clips || []).map((c) => (c.mediaFilePath == null && c.name && compoundNames.has(c.name) ? { ...c, compound: c.name } : c)),
|
|
152
|
+
})),
|
|
111
153
|
audioTracks: extractTracks(seqXml, 'AudioTrackVec', 'Sm2TiAudioTrack', 'audio'),
|
|
112
154
|
};
|
|
155
|
+
return parsed;
|
|
113
156
|
}
|
|
114
157
|
|
|
115
158
|
async function loadMetadata(zip) {
|
|
@@ -146,10 +189,11 @@ async function parseDRT(drtPathOrBuffer, options = {}) {
|
|
|
146
189
|
throw new Error('parseDRT: no SeqContainer*.xml entries found — is this a DRT/DRP?');
|
|
147
190
|
}
|
|
148
191
|
|
|
192
|
+
const poolNames = await loadPoolSequenceNames(zip);
|
|
149
193
|
const timelines = [];
|
|
150
194
|
for (const p of seqEntries) {
|
|
151
195
|
const xml = await zip.file(p).async('string');
|
|
152
|
-
timelines.push(parseSeqContainer(xml, p));
|
|
196
|
+
timelines.push(parseSeqContainer(xml, p, poolNames));
|
|
153
197
|
}
|
|
154
198
|
|
|
155
199
|
const metadata = await loadMetadata(zip);
|
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.181.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()}")
|
package/src/server.py
CHANGED
package/src/utils/api_truth.py
CHANGED
|
@@ -2859,7 +2859,14 @@ API_TRUTH: List[Dict[str, Any]] = [
|
|
|
2859
2859
|
"compound to a single media-less clipitem named after it "
|
|
2860
2860
|
"(no inner content). editorial.parse_interchange flattens "
|
|
2861
2861
|
"the OTIO Stacks into record time (fromCompound on each "
|
|
2862
|
-
"cut)."
|
|
2862
|
+
"cut). EXPORT_DRT of the same timeline holds THREE "
|
|
2863
|
+
"SeqContainers (top + one per compound); a SeqContainer XML "
|
|
2864
|
+
"carries NO timeline name — its first <Name> is the first "
|
|
2865
|
+
"clip's — while MediaPool/Master/MpFolder.xml's "
|
|
2866
|
+
"Sm2MpTimelineClip / Sm2MpCompoundClip embed the "
|
|
2867
|
+
"<Sm2Sequence DbId> the container's track-level <Sequence> "
|
|
2868
|
+
"names (measured E127); the compound on the parent track is "
|
|
2869
|
+
"a plain Sm2TiVideoClip named after it with no MediaFilePath.",
|
|
2863
2870
|
"recommended": "Author fade-to-white / colour mattes by placing a "
|
|
2864
2871
|
"Solid Color generator with that blob "
|
|
2865
2872
|
"(drp-format placeGenerator `color`, drt.assemble "
|