davinci-resolve-mcp 5.2.5 → 5.2.7

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 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 v5.2.7 — Preset and media rows live-tested with fixtures
6
+
7
+ From #363 by @Ghoul0718. No server behaviour changes.
8
+
9
+ ### Added
10
+
11
+ - **`tests/live_preset_fixture_validation.py`**, a live harness for the API coverage rows marked "needs fixture". It builds what each call needs from synthetic ffmpeg media, runs relink and sync in a disposable project that it deletes afterwards, restores the open project, and sweeps every `ZZ_r2104_` preset so each preset list ends as it started. Presets that existed before the run are never deleted. No scripting call creates a burn-in preset, so `--burnin-wait N` waits while a person saves one in Workspace > Data Burn-In.
12
+
13
+ ### Changed
14
+
15
+ - **API coverage:** `SaveLayoutPreset`, `ImportRenderPreset`, `ExportRenderPreset`, `ImportBurnInPreset`, `ExportBurnInPreset` and `DeleteBurnInPreset` (Resolve), and `RelinkClips` and `AutoSyncAudio` (MediaPool) move from ⚠️ to ✅. Totals do not change, since both marks count as live-tested. The rows record that preset exports write `<name>.xml` inside a folder (v5.2.6) and that `AutoSyncAudio` over the bridge needs v5.2.5.
16
+
17
+ ### Not verified here
18
+
19
+ - The live results are the contributor's, from free 21.0.4.5 on macOS, with the burn-in round trip on a preset saved by hand. This machine runs Studio 19.1.3.7 and did not rerun the harness.
20
+
21
+ ## What's New in v5.2.6 — Preset exports report the file Resolve writes
22
+
23
+ From #362 by @Ghoul0718.
24
+
25
+ ### Fixed
26
+
27
+ - **Render and burn-in preset exports named the wrong file.** `ExportRenderPreset(presetName, exportPath)` and `ExportBurnInPreset` treat `exportPath` as a folder: Resolve creates it and writes `<presetName>.xml` inside, so a path ending in `.xml` becomes a folder of that name (measured on free 21.0.4.5, macOS). The tools echoed the path back as if it were the file, and the import tools could not read it. `export_render_preset` and `export_burn_in_preset` now return `export_file`, and `render_presets` `export_render` / `export_burnin` return `file`: the `.xml` to give the matching import. A failed export returns no file. The `projectlevel.export_burn_in_preset` probe checks the written `.xml` instead of the folder.
28
+ - On landing, the helper was made to check what is on disk: if a build writes the exact path it is given, that path is reported instead. Only the folder behaviour has been measured.
29
+
30
+ ### Not verified here
31
+
32
+ - The folder behaviour is the contributor's measurement on free 21.0.4.5. This machine runs Studio 19.1.3.7 and did not measure it. `ExportLayoutPreset` and `ExportUserPreferencesPreset` wrote the exact file on the same build and are unchanged.
33
+
5
34
  ## What's New in v5.2.5 — The bridge keeps number keys in settings dicts
6
35
 
7
36
  From #361 by @Ghoul0718.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](README.zh-CN.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.2.5-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.7-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#server-modes)
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.2.5-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.7-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#服务器模式)
@@ -12,7 +12,7 @@
12
12
  [![Python](https://img.shields.io/badge/python-3.10+-green.svg)](https://www.python.org/downloads/)
13
13
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
14
14
 
15
- > 本翻译对应 v5.2.5 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v5.2.7 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
@@ -139,7 +139,7 @@ source, these summaries are downstream of it:
139
139
  | Phase 5 | 6/6 | 100% | Scene cuts, subtitles from audio, graph node cache/tools/enable |
140
140
  | Resolve 20 delta | 12/12 | 100% | Resolve 20.0-20.2.2 scripting additions live-tested on 20.3.2 |
141
141
  | Resolve 21 delta | 7/7 | 100% | Resolve 21.0 additions that could be executed, live-tested on Studio 21.0.2.4 (`tests/live_resolve21_validation.py`). The other 6 need an AI Extras pack or are unsafe to run — counted as untested, not as passes |
142
- | Resolve 21.0.4 delta | 11/11 | 100% | Resolve 21.0.4 additions live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`). `DeleteBurnInPreset` is tested on a missing name only (⚠️). `LoadUserPreferencesPreset` swaps the user's global preferences, so it is not executed and stays untested |
142
+ | Resolve 21.0.4 delta | 11/11 | 100% | Resolve 21.0.4 additions live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`; `DeleteBurnInPreset` on an existing preset in `tests/live_preset_fixture_validation.py`). `LoadUserPreferencesPreset` swaps the user's global preferences, so it is not executed and stays untested |
143
143
  | **Total** | **349/349** | **100%** | **96.7% of the 361 covered methods tested live** |
144
144
 
145
145
  #### Resolve 21 delta detail
@@ -187,7 +187,8 @@ close them. Eleven of the twelve 21.0.4 rows are now live-tested on free 21.0.4.
187
187
  through the in-app bridge (`tests/live_resolve2104_validation.py`); they had
188
188
  carried contributor reports from Studio 21.0.4.5 (issue #131, issues #135–#138,
189
189
  PR #139), and the live run agrees with them. `DeleteBurnInPreset` is tested on a
190
- missing name only, because no scripting API creates a burn-in preset to delete.
190
+ missing name and on a preset saved by hand, because no scripting API creates a
191
+ burn-in preset to delete.
191
192
  `LoadUserPreferencesPreset` stays untested: it swaps the user's global
192
193
  preferences for the session, so it is not executed. Likewise
193
194
  `DisableBackgroundTasksForCurrentResolveSession` is a
@@ -223,20 +224,20 @@ Every method in the DaVinci Resolve Scripting API and its test status. Methods a
223
224
  | 10 | `UpdateLayoutPreset(presetName)` | ✅ | Updates existing preset |
224
225
  | 11 | `ExportLayoutPreset(presetName, presetFilePath)` | ✅ | Exports preset to file |
225
226
  | 12 | `DeleteLayoutPreset(presetName)` | ✅ | Deletes preset |
226
- | 13 | `SaveLayoutPreset(presetName)` | ⚠️ | API accepts; returns `False` when preset name conflicts |
227
+ | 13 | `SaveLayoutPreset(presetName)` | ✅ | Saves a fresh name (listed by `GetLayoutPresetList` afterwards); returns `False` for an existing name and does not list it twice. Live on free 21.0.4.5 through the in-app bridge (`tests/live_preset_fixture_validation.py`) |
227
228
  | 14 | `ImportLayoutPreset(presetFilePath, presetName)` | ✅ | Imports preset from file |
228
229
  | 15 | `Quit()` | ✅ | Quits DaVinci Resolve |
229
- | 16 | `ImportRenderPreset(presetPath)` | ⚠️ | API accepts; needs valid preset file |
230
- | 17 | `ExportRenderPreset(presetName, exportPath)` | ⚠️ | API accepts; needs valid preset name |
231
- | 18 | `ImportBurnInPreset(presetPath)` | ⚠️ | API accepts; needs valid preset file |
232
- | 19 | `ExportBurnInPreset(presetName, exportPath)` | ⚠️ | API accepts; needs valid preset name |
230
+ | 16 | `ImportRenderPreset(presetPath)` | ✅ | Takes the exported `.xml` file; after `DeleteRenderPreset` the import restores the preset under its exported name. Live on free 21.0.4.5 through the in-app bridge (`tests/live_preset_fixture_validation.py`) |
231
+ | 17 | `ExportRenderPreset(presetName, exportPath)` | ✅ | **`exportPath` is a folder**: Resolve creates it and writes `<presetName>.xml` inside (a path ending in `.xml` becomes a folder of that name). Live on free 21.0.4.5 through the in-app bridge (`tests/live_preset_fixture_validation.py`) |
232
+ | 18 | `ImportBurnInPreset(presetPath)` | ✅ | Takes the exported `.xml` file; after `DeleteBurnInPreset` the import restores the preset. Live on free 21.0.4.5 through the in-app bridge, on a preset saved by hand in Workspace > Data Burn-In (`tests/live_preset_fixture_validation.py --burnin-wait`) |
233
+ | 19 | `ExportBurnInPreset(presetName, exportPath)` | ✅ | **`exportPath` is a folder**, as for `ExportRenderPreset`: Resolve writes `<presetName>.xml` inside it. Live on free 21.0.4.5 through the in-app bridge (`tests/live_preset_fixture_validation.py --burnin-wait`) |
233
234
  | 20 | `GetKeyframeMode()` | ✅ | Returns keyframe mode |
234
235
  | 21 | `SetKeyframeMode(keyframeMode)` | ⚠️ | API accepts; mode must match valid enum |
235
236
  | 22 | `GetFairlightPresets()` | ✅ | Returns a preset map. Live on 20.3.2 Studio and 21.0.3 free; **absent below 20.2.2** — confirmed missing on 19.1.3, so the version floor is verified from both sides |
236
237
  | 23 | `DisableBackgroundTasksForCurrentResolveSession()` | 🔬 | Resolve 21.0. Present in `dir()`; **not executed** — session-wide, returns `None`, no `Enable...` counterpart, so no undo short of restarting Resolve |
237
238
  | 24 | `GetLayoutPresetList()` | ✅ | Resolve 21.0.4. Returns a list (live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`)); also reported via a save→list→delete round-trip on Studio 21.0.4.5 in issue #137 |
238
239
  | 25 | `GetBurnInPresetList()` | ✅ | Resolve 21.0.4. Returns a list (live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`)); reported returning a list on Studio 21.0.4.5 in issue #136 |
239
- | 26 | `DeleteBurnInPreset(presetName)` | ⚠️ | Resolve 21.0.4. Returns `False` for a name that does not exist and leaves the list unchanged (live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`)). A real delete is not exercised: no scripting API creates a burn-in preset to delete |
240
+ | 26 | `DeleteBurnInPreset(presetName)` | ✅ | Resolve 21.0.4. Deletes an existing preset (gone from `GetBurnInPresetList`); returns `False` for a name that does not exist and leaves the list unchanged. No scripting API creates a burn-in preset, so the real delete runs on one saved by hand (`tests/live_preset_fixture_validation.py --burnin-wait`); the missing-name case is in `tests/live_resolve2104_validation.py`. Live on free 21.0.4.5 through the in-app bridge |
240
241
  | 27 | `GetUserPreferencesPresetList()` | ✅ | Resolve 21.0.4. Returns a list of names; a saved preset appears and a deleted one disappears (live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`)); also issue #138 on Studio 21.0.4.5 |
241
242
  | 28 | `SaveUserPreferencesPreset(presetName)` | ✅ | Resolve 21.0.4. Returns `True` and the preset is listed (live-tested on free 21.0.4.5 through the in-app bridge (`tests/live_resolve2104_validation.py`)) |
242
243
  | 29 | `LoadUserPreferencesPreset(presetName)` | 🔬 | Resolve 21.0.4. `dir()`-present on 21.0.4.5; **not executed** even by the reporter — swaps the user's global preferences session-wide (issue #138) |
@@ -359,13 +360,13 @@ Every method in the DaVinci Resolve Scripting API and its test status. Methods a
359
360
  | 16 | `GetClipMatteList(item)` | ✅ | Returns matte paths |
360
361
  | 17 | `GetTimelineMatteList(folder)` | ✅ | Returns matte items |
361
362
  | 18 | `DeleteClipMattes(item, [paths])` | ✅ | Deletes clip mattes |
362
- | 19 | `RelinkClips([items], folderPath)` | ⚠️ | API accepts; needs offline clips |
363
+ | 19 | `RelinkClips([items], folderPath)` | ✅ | After the clip's file is moved, relinking to the new folder returns True and the clip's `File Path` points into it. Live on free 21.0.4.5 through the in-app bridge (`tests/live_preset_fixture_validation.py`) |
363
364
  | 20 | `UnlinkClips([items])` | ✅ | Unlinks clips |
364
365
  | 21 | `ImportMedia([items])` | ✅ | Imports media files |
365
366
  | 22 | `ExportMetadata(fileName, [clips])` | ✅ | Exports metadata CSV |
366
367
  | 23 | `GetUniqueId()` | ✅ | Returns UUID string |
367
368
  | 24 | `CreateStereoClip(left, right)` | ✅ | Creates stereo pair |
368
- | 25 | `AutoSyncAudio([items], {settings})` | ⚠️ | Tested; needs matching A/V clips |
369
+ | 25 | `AutoSyncAudio([items], {settings})` | ✅ | Waveform sync of a video and a separate audio file sharing a noise track sets the video's `Synced Audio` property. Live on free 21.0.4.5 through the in-app bridge (`tests/live_preset_fixture_validation.py`); over the bridge this needs the settings dict's number keys kept (PR #361), without which Resolve ignores the settings and returns `False` |
369
370
  | 26 | `GetSelectedClips()` | ✅ | Returns selected clips |
370
371
  | 27 | `SetSelectedClip(item)` | ✅ | Selects clip |
371
372
 
package/install.py CHANGED
@@ -37,7 +37,7 @@ from src.utils.update_check import (
37
37
 
38
38
  # ─── Version ──────────────────────────────────────────────────────────────────
39
39
 
40
- VERSION = "5.2.5"
40
+ VERSION = "5.2.7"
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "davinci-resolve-mcp",
3
- "version": "5.2.5",
3
+ "version": "5.2.7",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -93,7 +93,7 @@ if not logging.getLogger().handlers:
93
93
  handlers=[logging.StreamHandler()],
94
94
  )
95
95
 
96
- VERSION = "5.2.5"
96
+ VERSION = "5.2.7"
97
97
  logger = logging.getLogger("davinci-resolve-mcp")
98
98
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
99
99
  logger.info(f"Detected platform: {get_platform()}")
@@ -3,6 +3,7 @@
3
3
  from src.granular.common import * # noqa: F401,F403
4
4
  import os
5
5
  from src.utils import typed_api_search
6
+ from src.utils.preset_files import preset_export_file
6
7
  from src.utils.app_control import set_high_priority as set_resolve_high_priority
7
8
 
8
9
  resolve = ResolveProxy()
@@ -501,17 +502,25 @@ def import_render_preset(preset_path: str) -> Dict[str, Any]:
501
502
 
502
503
  @mcp.tool()
503
504
  def export_render_preset(preset_name: str, export_path: str) -> Dict[str, Any]:
504
- """Export a render preset to a file.
505
+ """Export a render preset as an .xml file inside a folder.
506
+
507
+ Resolve treats ``export_path`` as a folder: it creates the folder if needed
508
+ and writes ``<preset_name>.xml`` inside it (measured on 21.0.4.5). A path
509
+ ending in ``.xml`` becomes a folder of that name. On success the returned
510
+ ``export_file`` is the file to pass to the matching import tool.
505
511
 
506
512
  Args:
507
513
  preset_name: Name of the render preset to export.
508
- export_path: Absolute path where the preset file will be saved.
514
+ export_path: Absolute path of the folder the preset file is written into.
509
515
  """
510
516
  resolve = get_resolve()
511
517
  if resolve is None:
512
518
  return {"error": "Not connected to DaVinci Resolve"}
513
519
  result = resolve.ExportRenderPreset(preset_name, export_path)
514
- return {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
520
+ out = {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
521
+ if result:
522
+ out["export_file"] = preset_export_file(export_path, preset_name)
523
+ return out
515
524
 
516
525
 
517
526
  @mcp.tool()
@@ -530,17 +539,25 @@ def import_burn_in_preset(preset_path: str) -> Dict[str, Any]:
530
539
 
531
540
  @mcp.tool()
532
541
  def export_burn_in_preset(preset_name: str, export_path: str) -> Dict[str, Any]:
533
- """Export a burn-in preset to a file.
542
+ """Export a burn-in preset as an .xml file inside a folder.
543
+
544
+ Resolve treats ``export_path`` as a folder: it creates the folder if needed
545
+ and writes ``<preset_name>.xml`` inside it (measured on 21.0.4.5). A path
546
+ ending in ``.xml`` becomes a folder of that name. On success the returned
547
+ ``export_file`` is the file to pass to the matching import tool.
534
548
 
535
549
  Args:
536
550
  preset_name: Name of the burn-in preset to export.
537
- export_path: Absolute path where the preset file will be saved.
551
+ export_path: Absolute path of the folder the preset file is written into.
538
552
  """
539
553
  resolve = get_resolve()
540
554
  if resolve is None:
541
555
  return {"error": "Not connected to DaVinci Resolve"}
542
556
  result = resolve.ExportBurnInPreset(preset_name, export_path)
543
- return {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
557
+ out = {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
558
+ if result:
559
+ out["export_file"] = preset_export_file(export_path, preset_name)
560
+ return out
544
561
 
545
562
 
546
563
  @mcp.tool()
package/src/server.py CHANGED
@@ -11,7 +11,7 @@ Usage:
11
11
  python src/server.py --full # Start the 377-tool granular server instead
12
12
  """
13
13
 
14
- VERSION = "5.2.5"
14
+ VERSION = "5.2.7"
15
15
 
16
16
  import base64
17
17
  import os
@@ -63,6 +63,7 @@ from src.utils.film_cues import export_cue_sheet as _export_film_cue_sheet
63
63
  # Platform-specific Resolve paths
64
64
  from src.utils.cdl import normalize_cdl_payload
65
65
  from src.utils.media_paths import media_exists as _media_exists
66
+ from src.utils.preset_files import preset_export_file as _preset_export_file
66
67
  from src.utils import archive_guard
67
68
  from src.utils import subtitle_append_guard
68
69
  from src.utils import typed_api_search
@@ -20343,9 +20344,13 @@ def render_presets(action: str, params: Optional[Dict[str, Any]] = None) -> Dict
20343
20344
 
20344
20345
  Actions:
20345
20346
  import_render(path) -> {success}
20346
- export_render(name, path) -> {success}
20347
+ export_render(name, path) -> {success, file}
20347
20348
  import_burnin(path) -> {success}
20348
- export_burnin(name, path) -> {success}
20349
+ export_burnin(name, path) -> {success, file}
20350
+ Resolve treats an export `path` as a FOLDER: it creates it and writes
20351
+ `<name>.xml` inside (a path ending in .xml becomes a folder of that
20352
+ name). On success `file` is that .xml, the path to give import_render /
20353
+ import_burnin.
20349
20354
  list_burnin() -> {presets} — Resolve 21.0.4+; burn-in preset names usable
20350
20355
  with the render tool's DataBurnIn setting and load_burnin_preset on
20351
20356
  project_settings / timeline_item
@@ -20359,11 +20364,15 @@ def render_presets(action: str, params: Optional[Dict[str, Any]] = None) -> Dict
20359
20364
  if action == "import_render":
20360
20365
  return {"success": bool(r.ImportRenderPreset(p["path"]))}
20361
20366
  elif action == "export_render":
20362
- return {"success": bool(r.ExportRenderPreset(p["name"], p["path"]))}
20367
+ if not r.ExportRenderPreset(p["name"], p["path"]):
20368
+ return {"success": False}
20369
+ return {"success": True, "file": _preset_export_file(p["path"], p["name"])}
20363
20370
  elif action == "import_burnin":
20364
20371
  return {"success": bool(r.ImportBurnInPreset(p["path"]))}
20365
20372
  elif action == "export_burnin":
20366
- return {"success": bool(r.ExportBurnInPreset(p["name"], p["path"]))}
20373
+ if not r.ExportBurnInPreset(p["name"], p["path"]):
20374
+ return {"success": False}
20375
+ return {"success": True, "file": _preset_export_file(p["path"], p["name"])}
20367
20376
  elif action == "list_burnin":
20368
20377
  missing = _requires_method(r, "GetBurnInPresetList", "21.0.4")
20369
20378
  if missing:
@@ -0,0 +1,34 @@
1
+ """Where Resolve writes an exported render or burn-in preset.
2
+
3
+ ``ExportRenderPreset(presetName, exportPath)`` and
4
+ ``ExportBurnInPreset(presetName, exportPath)`` treat ``exportPath`` as a
5
+ folder, not a file. Resolve creates the folder if needed and writes
6
+ ``<presetName>.xml`` inside it. Measured on free 21.0.4.5 (macOS) through the
7
+ in-app bridge:
8
+
9
+ - ``/tmp/a/My.xml`` became the folder ``/tmp/a/My.xml/`` holding ``My.xml``
10
+ - ``/tmp/b/other.xml`` became the folder ``/tmp/b/other.xml/`` holding ``My.xml``
11
+ - ``/tmp/c`` (an existing folder) received ``/tmp/c/My.xml``
12
+
13
+ The import calls take the file itself, so a caller needs the real file path to
14
+ round-trip a preset.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import os
20
+
21
+
22
+ def preset_export_file(export_path: str, preset_name: str) -> str:
23
+ """The file Resolve writes when it exports ``preset_name`` to ``export_path``.
24
+
25
+ The folder behaviour above is one build's measurement. If ``export_path``
26
+ is itself a file after the export and ``<export_path>/<preset_name>.xml``
27
+ is not, the build wrote the exact path it was given, so that path is the
28
+ file. Otherwise, including before anything exists, the answer is the
29
+ measured one.
30
+ """
31
+ inside = os.path.join(export_path, f"{preset_name}.xml")
32
+ if os.path.isfile(export_path) and not os.path.isfile(inside):
33
+ return export_path
34
+ return inside
@@ -780,9 +780,11 @@ def _probe_projectlevel_render_preset(ctx):
780
780
 
781
781
  @probe("projectlevel.export_burn_in_preset", "projectlevel", timeout=120, destructive=True)
782
782
  def _probe_projectlevel_burnin(ctx):
783
- path = ctx.work / "burnin.preset"
784
- ok = ctx.resolve.ExportBurnInPreset("Default", str(path))
785
- return combine(ok, path.exists() and path.stat().st_size > 0)
783
+ # Resolve treats the export path as a folder and writes <name>.xml inside it.
784
+ folder = ctx.work / "burnin"
785
+ ok = ctx.resolve.ExportBurnInPreset("Default", str(folder))
786
+ written = folder / "Default.xml"
787
+ return combine(ok, written.is_file() and written.stat().st_size > 0)
786
788
 
787
789
 
788
790
  @probe("projectlevel.archive_project", "projectlevel", timeout=600, destructive=True,