@synthetic-ai/premiere-mcp 2.1.0 → 2.3.0-dev.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 +135 -123
- package/LICENSE +21 -21
- package/README.md +242 -242
- package/cep-plugin/.debug +8 -8
- package/cep-plugin/CSInterface.js +92 -92
- package/cep-plugin/host.jsx +7 -7
- package/cep-plugin/index.html +472 -472
- package/cep-plugin/main.js +6 -0
- package/cep-plugin/premiere.jsx +24947 -24947
- package/dist/bridge/script-builder.js +378 -378
- package/dist/index.js +103 -4
- package/dist/license.js +38 -0
- package/dist/server.js +60 -60
- package/dist/tools/advanced.js +357 -357
- package/dist/tools/audio-advanced.js +1049 -1049
- package/dist/tools/audio.js +42 -42
- package/dist/tools/captions.js +27 -27
- package/dist/tools/clipboard.js +214 -214
- package/dist/tools/color-advanced.js +253 -253
- package/dist/tools/discovery.js +291 -291
- package/dist/tools/effects.js +285 -285
- package/dist/tools/export-presets.js +206 -206
- package/dist/tools/export.js +255 -255
- package/dist/tools/health.js +10 -10
- package/dist/tools/inspection.js +885 -885
- package/dist/tools/keyframes.js +369 -369
- package/dist/tools/markers.js +89 -89
- package/dist/tools/media.js +178 -178
- package/dist/tools/metadata.js +94 -94
- package/dist/tools/multicam.js +50 -50
- package/dist/tools/playback.js +15 -15
- package/dist/tools/playhead.js +95 -95
- package/dist/tools/project-manager.js +21 -21
- package/dist/tools/project.js +149 -149
- package/dist/tools/scripting.js +319 -319
- package/dist/tools/selection.js +202 -202
- package/dist/tools/sequence-advanced.js +379 -379
- package/dist/tools/sequence-settings.js +564 -564
- package/dist/tools/sequence.js +167 -167
- package/dist/tools/source-monitor.js +68 -68
- package/dist/tools/text.js +58 -58
- package/dist/tools/timeline.js +312 -312
- package/dist/tools/track-management.js +446 -446
- package/dist/tools/track-targeting.js +635 -635
- package/dist/tools/tracks.js +87 -87
- package/dist/tools/transitions-motion.js +174 -174
- package/dist/tools/transitions.js +111 -111
- package/dist/tools/utility.js +606 -606
- package/dist/tools/workspace.js +29 -29
- package/package.json +66 -66
- package/scripts/build-chat-dmg.sh +210 -210
- package/scripts/build-chat-zip.sh +291 -291
- package/scripts/install-cep-windows.ps1 +99 -99
- package/scripts/install-cep.sh +66 -66
- package/scripts/install-chat-plugin.bat +67 -67
- package/scripts/install-chat-plugin.sh +85 -85
- package/scripts/install-windows.bat +95 -95
- package/scripts/package.mjs +254 -254
package/dist/tools/project.js
CHANGED
|
@@ -6,11 +6,11 @@ export function getProjectTools(bridgeOptions) {
|
|
|
6
6
|
description: "Save the current Premiere Pro project",
|
|
7
7
|
parameters: {},
|
|
8
8
|
handler: async () => {
|
|
9
|
-
const script = buildToolScript(`
|
|
10
|
-
var project = app.project;
|
|
11
|
-
if (!project) return __error("No project is open");
|
|
12
|
-
project.save();
|
|
13
|
-
return __result({ saved: true, name: project.name, path: project.path });
|
|
9
|
+
const script = buildToolScript(`
|
|
10
|
+
var project = app.project;
|
|
11
|
+
if (!project) return __error("No project is open");
|
|
12
|
+
project.save();
|
|
13
|
+
return __result({ saved: true, name: project.name, path: project.path });
|
|
14
14
|
`);
|
|
15
15
|
return sendCommand(script, bridgeOptions);
|
|
16
16
|
},
|
|
@@ -28,11 +28,11 @@ export function getProjectTools(bridgeOptions) {
|
|
|
28
28
|
required: ["path"],
|
|
29
29
|
},
|
|
30
30
|
handler: async (args) => {
|
|
31
|
-
const script = buildToolScript(`
|
|
32
|
-
var project = app.project;
|
|
33
|
-
if (!project) return __error("No project is open");
|
|
34
|
-
project.saveAs("${escapeForExtendScript(args.path)}");
|
|
35
|
-
return __result({ saved: true, path: "${escapeForExtendScript(args.path)}" });
|
|
31
|
+
const script = buildToolScript(`
|
|
32
|
+
var project = app.project;
|
|
33
|
+
if (!project) return __error("No project is open");
|
|
34
|
+
project.saveAs("${escapeForExtendScript(args.path)}");
|
|
35
|
+
return __result({ saved: true, path: "${escapeForExtendScript(args.path)}" });
|
|
36
36
|
`);
|
|
37
37
|
return sendCommand(script, bridgeOptions);
|
|
38
38
|
},
|
|
@@ -50,10 +50,10 @@ export function getProjectTools(bridgeOptions) {
|
|
|
50
50
|
required: ["path"],
|
|
51
51
|
},
|
|
52
52
|
handler: async (args) => {
|
|
53
|
-
const script = buildToolScript(`
|
|
54
|
-
app.openDocument("${escapeForExtendScript(args.path)}");
|
|
55
|
-
var project = app.project;
|
|
56
|
-
return __result({ opened: true, name: project.name, path: project.path });
|
|
53
|
+
const script = buildToolScript(`
|
|
54
|
+
app.openDocument("${escapeForExtendScript(args.path)}");
|
|
55
|
+
var project = app.project;
|
|
56
|
+
return __result({ opened: true, name: project.name, path: project.path });
|
|
57
57
|
`);
|
|
58
58
|
return sendCommand(script, bridgeOptions);
|
|
59
59
|
},
|
|
@@ -71,11 +71,11 @@ export function getProjectTools(bridgeOptions) {
|
|
|
71
71
|
required: ["sequence_id"],
|
|
72
72
|
},
|
|
73
73
|
handler: async (args) => {
|
|
74
|
-
const script = buildToolScript(`
|
|
75
|
-
var seq = __findSequence("${escapeForExtendScript(args.sequence_id)}");
|
|
76
|
-
if (!seq) return __error("Sequence not found: ${escapeForExtendScript(args.sequence_id)}");
|
|
77
|
-
app.project.activeSequence = seq;
|
|
78
|
-
return __result({ active: true, name: seq.name, id: seq.sequenceID });
|
|
74
|
+
const script = buildToolScript(`
|
|
75
|
+
var seq = __findSequence("${escapeForExtendScript(args.sequence_id)}");
|
|
76
|
+
if (!seq) return __error("Sequence not found: ${escapeForExtendScript(args.sequence_id)}");
|
|
77
|
+
app.project.activeSequence = seq;
|
|
78
|
+
return __result({ active: true, name: seq.name, id: seq.sequenceID });
|
|
79
79
|
`);
|
|
80
80
|
return sendCommand(script, bridgeOptions);
|
|
81
81
|
},
|
|
@@ -93,14 +93,14 @@ export function getProjectTools(bridgeOptions) {
|
|
|
93
93
|
},
|
|
94
94
|
handler: async (args) => {
|
|
95
95
|
const count = args.count || 1;
|
|
96
|
-
const script = buildToolScript(`
|
|
97
|
-
// undo is a QE-DOM operation, not on the Project DOM in most PP builds.
|
|
98
|
-
app.enableQE();
|
|
99
|
-
for (var i = 0; i < ${count}; i++) {
|
|
100
|
-
if (qe && qe.project && qe.project.undo) { qe.project.undo(); }
|
|
101
|
-
else if (app.project.undo) { app.project.undo(); }
|
|
102
|
-
}
|
|
103
|
-
return __result({ undone: ${count} });
|
|
96
|
+
const script = buildToolScript(`
|
|
97
|
+
// undo is a QE-DOM operation, not on the Project DOM in most PP builds.
|
|
98
|
+
app.enableQE();
|
|
99
|
+
for (var i = 0; i < ${count}; i++) {
|
|
100
|
+
if (qe && qe.project && qe.project.undo) { qe.project.undo(); }
|
|
101
|
+
else if (app.project.undo) { app.project.undo(); }
|
|
102
|
+
}
|
|
103
|
+
return __result({ undone: ${count} });
|
|
104
104
|
`);
|
|
105
105
|
return sendCommand(script, bridgeOptions);
|
|
106
106
|
},
|
|
@@ -109,9 +109,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
109
109
|
description: "Consolidate duplicate project items",
|
|
110
110
|
parameters: {},
|
|
111
111
|
handler: async () => {
|
|
112
|
-
const script = buildToolScript(`
|
|
113
|
-
app.project.consolidateDuplicates();
|
|
114
|
-
return __result({ consolidated: true });
|
|
112
|
+
const script = buildToolScript(`
|
|
113
|
+
app.project.consolidateDuplicates();
|
|
114
|
+
return __result({ consolidated: true });
|
|
115
115
|
`);
|
|
116
116
|
return sendCommand(script, bridgeOptions);
|
|
117
117
|
},
|
|
@@ -129,11 +129,11 @@ export function getProjectTools(bridgeOptions) {
|
|
|
129
129
|
required: ["path"],
|
|
130
130
|
},
|
|
131
131
|
handler: async (args) => {
|
|
132
|
-
const script = buildToolScript(`
|
|
133
|
-
app.newProject("${escapeForExtendScript(args.path)}");
|
|
134
|
-
var project = app.project;
|
|
135
|
-
if (!project) return __error("Failed to create project");
|
|
136
|
-
return __result({ created: true, name: project.name, path: project.path });
|
|
132
|
+
const script = buildToolScript(`
|
|
133
|
+
app.newProject("${escapeForExtendScript(args.path)}");
|
|
134
|
+
var project = app.project;
|
|
135
|
+
if (!project) return __error("Failed to create project");
|
|
136
|
+
return __result({ created: true, name: project.name, path: project.path });
|
|
137
137
|
`);
|
|
138
138
|
return sendCommand(script, bridgeOptions);
|
|
139
139
|
},
|
|
@@ -154,17 +154,17 @@ export function getProjectTools(bridgeOptions) {
|
|
|
154
154
|
// We always suppress the interactive prompt (promptUser = 0) since this runs
|
|
155
155
|
// headless via the bridge; the saveFirst flag is what actually controls intent.
|
|
156
156
|
const save = args.save_first !== false;
|
|
157
|
-
const script = buildToolScript(`
|
|
158
|
-
var project = app.project;
|
|
159
|
-
if (!project) return __error("No project is open");
|
|
160
|
-
var name = project.name;
|
|
161
|
-
try {
|
|
162
|
-
// saveFirst: ${save ? "1 (save)" : "0 (do not save)"}, promptUserIfDirty: 0 (suppressed)
|
|
163
|
-
project.closeDocument(${save ? "1" : "0"}, 0);
|
|
164
|
-
} catch (e) {
|
|
165
|
-
return __error("Failed to close project: " + e.toString());
|
|
166
|
-
}
|
|
167
|
-
return __result({ closed: true, name: name, saved: ${save} });
|
|
157
|
+
const script = buildToolScript(`
|
|
158
|
+
var project = app.project;
|
|
159
|
+
if (!project) return __error("No project is open");
|
|
160
|
+
var name = project.name;
|
|
161
|
+
try {
|
|
162
|
+
// saveFirst: ${save ? "1 (save)" : "0 (do not save)"}, promptUserIfDirty: 0 (suppressed)
|
|
163
|
+
project.closeDocument(${save ? "1" : "0"}, 0);
|
|
164
|
+
} catch (e) {
|
|
165
|
+
return __error("Failed to close project: " + e.toString());
|
|
166
|
+
}
|
|
167
|
+
return __result({ closed: true, name: name, saved: ${save} });
|
|
168
168
|
`);
|
|
169
169
|
return sendCommand(script, bridgeOptions);
|
|
170
170
|
},
|
|
@@ -195,18 +195,18 @@ export function getProjectTools(bridgeOptions) {
|
|
|
195
195
|
: `var targetBin = app.project.rootItem;`;
|
|
196
196
|
if (args.comp_names && args.comp_names.length > 0) {
|
|
197
197
|
const comps = args.comp_names.map(c => `"${escapeForExtendScript(c)}"`).join(", ");
|
|
198
|
-
const script = buildToolScript(`
|
|
199
|
-
${binLookup}
|
|
200
|
-
app.project.importAEComps("${escapeForExtendScript(args.ae_project_path)}", [${comps}], targetBin);
|
|
201
|
-
return __result({ imported: true, comps: [${comps}] });
|
|
198
|
+
const script = buildToolScript(`
|
|
199
|
+
${binLookup}
|
|
200
|
+
app.project.importAEComps("${escapeForExtendScript(args.ae_project_path)}", [${comps}], targetBin);
|
|
201
|
+
return __result({ imported: true, comps: [${comps}] });
|
|
202
202
|
`);
|
|
203
203
|
return sendCommand(script, bridgeOptions);
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
|
-
const script = buildToolScript(`
|
|
207
|
-
${binLookup}
|
|
208
|
-
app.project.importAllAEComps("${escapeForExtendScript(args.ae_project_path)}", targetBin);
|
|
209
|
-
return __result({ imported: true, allComps: true });
|
|
206
|
+
const script = buildToolScript(`
|
|
207
|
+
${binLookup}
|
|
208
|
+
app.project.importAllAEComps("${escapeForExtendScript(args.ae_project_path)}", targetBin);
|
|
209
|
+
return __result({ imported: true, allComps: true });
|
|
210
210
|
`);
|
|
211
211
|
return sendCommand(script, bridgeOptions);
|
|
212
212
|
}
|
|
@@ -225,13 +225,13 @@ export function getProjectTools(bridgeOptions) {
|
|
|
225
225
|
required: ["bin_id"],
|
|
226
226
|
},
|
|
227
227
|
handler: async (args) => {
|
|
228
|
-
const script = buildToolScript(`
|
|
229
|
-
var bin = __findProjectItem("${escapeForExtendScript(args.bin_id)}");
|
|
230
|
-
if (!bin) return __error("Bin not found: ${escapeForExtendScript(args.bin_id)}");
|
|
231
|
-
if (bin.type !== 2) return __error("Item is not a bin");
|
|
232
|
-
var name = bin.name;
|
|
233
|
-
bin.deleteBin();
|
|
234
|
-
return __result({ deleted: true, name: name });
|
|
228
|
+
const script = buildToolScript(`
|
|
229
|
+
var bin = __findProjectItem("${escapeForExtendScript(args.bin_id)}");
|
|
230
|
+
if (!bin) return __error("Bin not found: ${escapeForExtendScript(args.bin_id)}");
|
|
231
|
+
if (bin.type !== 2) return __error("Item is not a bin");
|
|
232
|
+
var name = bin.name;
|
|
233
|
+
bin.deleteBin();
|
|
234
|
+
return __result({ deleted: true, name: name });
|
|
235
235
|
`);
|
|
236
236
|
return sendCommand(script, bridgeOptions);
|
|
237
237
|
},
|
|
@@ -253,13 +253,13 @@ export function getProjectTools(bridgeOptions) {
|
|
|
253
253
|
required: ["bin_id", "new_name"],
|
|
254
254
|
},
|
|
255
255
|
handler: async (args) => {
|
|
256
|
-
const script = buildToolScript(`
|
|
257
|
-
var bin = __findProjectItem("${escapeForExtendScript(args.bin_id)}");
|
|
258
|
-
if (!bin) return __error("Bin not found: ${escapeForExtendScript(args.bin_id)}");
|
|
259
|
-
if (bin.type !== 2) return __error("Item is not a bin");
|
|
260
|
-
var oldName = bin.name;
|
|
261
|
-
bin.renameBin("${escapeForExtendScript(args.new_name)}");
|
|
262
|
-
return __result({ renamed: true, oldName: oldName, newName: "${escapeForExtendScript(args.new_name)}" });
|
|
256
|
+
const script = buildToolScript(`
|
|
257
|
+
var bin = __findProjectItem("${escapeForExtendScript(args.bin_id)}");
|
|
258
|
+
if (!bin) return __error("Bin not found: ${escapeForExtendScript(args.bin_id)}");
|
|
259
|
+
if (bin.type !== 2) return __error("Item is not a bin");
|
|
260
|
+
var oldName = bin.name;
|
|
261
|
+
bin.renameBin("${escapeForExtendScript(args.new_name)}");
|
|
262
|
+
return __result({ renamed: true, oldName: oldName, newName: "${escapeForExtendScript(args.new_name)}" });
|
|
263
263
|
`);
|
|
264
264
|
return sendCommand(script, bridgeOptions);
|
|
265
265
|
},
|
|
@@ -281,9 +281,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
281
281
|
required: ["name", "query"],
|
|
282
282
|
},
|
|
283
283
|
handler: async (args) => {
|
|
284
|
-
const script = buildToolScript(`
|
|
285
|
-
app.project.rootItem.createSmartBin("${escapeForExtendScript(args.name)}", "${escapeForExtendScript(args.query)}");
|
|
286
|
-
return __result({ created: true, name: "${escapeForExtendScript(args.name)}", query: "${escapeForExtendScript(args.query)}" });
|
|
284
|
+
const script = buildToolScript(`
|
|
285
|
+
app.project.rootItem.createSmartBin("${escapeForExtendScript(args.name)}", "${escapeForExtendScript(args.query)}");
|
|
286
|
+
return __result({ created: true, name: "${escapeForExtendScript(args.name)}", query: "${escapeForExtendScript(args.query)}" });
|
|
287
287
|
`);
|
|
288
288
|
return sendCommand(script, bridgeOptions);
|
|
289
289
|
},
|
|
@@ -301,20 +301,20 @@ export function getProjectTools(bridgeOptions) {
|
|
|
301
301
|
required: ["path_search"],
|
|
302
302
|
},
|
|
303
303
|
handler: async (args) => {
|
|
304
|
-
const script = buildToolScript(`
|
|
305
|
-
var root = app.project.rootItem;
|
|
306
|
-
var matches = root.findItemsMatchingMediaPath("${escapeForExtendScript(args.path_search)}");
|
|
307
|
-
var items = [];
|
|
308
|
-
if (matches) {
|
|
309
|
-
for (var i = 0; i < matches.length; i++) {
|
|
310
|
-
items.push({
|
|
311
|
-
nodeId: matches[i].nodeId,
|
|
312
|
-
name: matches[i].name,
|
|
313
|
-
type: matches[i].type === 1 ? "clip" : matches[i].type === 2 ? "bin" : "sequence"
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return __result({ count: items.length, items: items });
|
|
304
|
+
const script = buildToolScript(`
|
|
305
|
+
var root = app.project.rootItem;
|
|
306
|
+
var matches = root.findItemsMatchingMediaPath("${escapeForExtendScript(args.path_search)}");
|
|
307
|
+
var items = [];
|
|
308
|
+
if (matches) {
|
|
309
|
+
for (var i = 0; i < matches.length; i++) {
|
|
310
|
+
items.push({
|
|
311
|
+
nodeId: matches[i].nodeId,
|
|
312
|
+
name: matches[i].name,
|
|
313
|
+
type: matches[i].type === 1 ? "clip" : matches[i].type === 2 ? "bin" : "sequence"
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return __result({ count: items.length, items: items });
|
|
318
318
|
`);
|
|
319
319
|
return sendCommand(script, bridgeOptions);
|
|
320
320
|
},
|
|
@@ -323,9 +323,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
323
323
|
description: "Start encoding all items in the Adobe Media Encoder render queue",
|
|
324
324
|
parameters: {},
|
|
325
325
|
handler: async () => {
|
|
326
|
-
const script = buildToolScript(`
|
|
327
|
-
app.encoder.startBatch();
|
|
328
|
-
return __result({ started: true });
|
|
326
|
+
const script = buildToolScript(`
|
|
327
|
+
app.encoder.startBatch();
|
|
328
|
+
return __result({ started: true });
|
|
329
329
|
`);
|
|
330
330
|
return sendCommand(script, bridgeOptions);
|
|
331
331
|
},
|
|
@@ -351,9 +351,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
351
351
|
required: ["field_name", "field_label", "field_type"],
|
|
352
352
|
},
|
|
353
353
|
handler: async (args) => {
|
|
354
|
-
const script = buildToolScript(`
|
|
355
|
-
app.project.addPropertyToProjectMetadataSchema("${escapeForExtendScript(args.field_name)}", "${escapeForExtendScript(args.field_label)}", ${args.field_type});
|
|
356
|
-
return __result({ added: true, name: "${escapeForExtendScript(args.field_name)}", label: "${escapeForExtendScript(args.field_label)}" });
|
|
354
|
+
const script = buildToolScript(`
|
|
355
|
+
app.project.addPropertyToProjectMetadataSchema("${escapeForExtendScript(args.field_name)}", "${escapeForExtendScript(args.field_label)}", ${args.field_type});
|
|
356
|
+
return __result({ added: true, name: "${escapeForExtendScript(args.field_name)}", label: "${escapeForExtendScript(args.field_label)}" });
|
|
357
357
|
`);
|
|
358
358
|
return sendCommand(script, bridgeOptions);
|
|
359
359
|
},
|
|
@@ -377,16 +377,16 @@ export function getProjectTools(bridgeOptions) {
|
|
|
377
377
|
handler: async (args) => {
|
|
378
378
|
if (args.sequence_ids && args.sequence_ids.length > 0) {
|
|
379
379
|
const ids = args.sequence_ids.map(id => `"${escapeForExtendScript(id)}"`).join(", ");
|
|
380
|
-
const script = buildToolScript(`
|
|
381
|
-
app.project.importSequences("${escapeForExtendScript(args.project_path)}", [${ids}]);
|
|
382
|
-
return __result({ imported: true, sequenceIds: [${ids}] });
|
|
380
|
+
const script = buildToolScript(`
|
|
381
|
+
app.project.importSequences("${escapeForExtendScript(args.project_path)}", [${ids}]);
|
|
382
|
+
return __result({ imported: true, sequenceIds: [${ids}] });
|
|
383
383
|
`);
|
|
384
384
|
return sendCommand(script, bridgeOptions);
|
|
385
385
|
}
|
|
386
386
|
else {
|
|
387
|
-
const script = buildToolScript(`
|
|
388
|
-
app.project.importSequences("${escapeForExtendScript(args.project_path)}");
|
|
389
|
-
return __result({ imported: true, allSequences: true });
|
|
387
|
+
const script = buildToolScript(`
|
|
388
|
+
app.project.importSequences("${escapeForExtendScript(args.project_path)}");
|
|
389
|
+
return __result({ imported: true, allSequences: true });
|
|
390
390
|
`);
|
|
391
391
|
return sendCommand(script, bridgeOptions);
|
|
392
392
|
}
|
|
@@ -422,32 +422,32 @@ export function getProjectTools(bridgeOptions) {
|
|
|
422
422
|
const explicitTimebase = args.timebase
|
|
423
423
|
? `"${escapeForExtendScript(args.timebase)}"`
|
|
424
424
|
: "null";
|
|
425
|
-
const script = buildToolScript(`
|
|
426
|
-
try {
|
|
427
|
-
var explicitTimebase = ${explicitTimebase};
|
|
428
|
-
var timebase = explicitTimebase;
|
|
429
|
-
if (timebase === null) {
|
|
430
|
-
// Derive timebase from the active sequence, then any existing sequence,
|
|
431
|
-
// falling back to the standard TICKS_PER_SECOND default only if nothing
|
|
432
|
-
// else is available.
|
|
433
|
-
var seq = app.project.activeSequence;
|
|
434
|
-
if (seq && seq.timebase) {
|
|
435
|
-
timebase = String(seq.timebase);
|
|
436
|
-
} else if (app.project.sequences && app.project.sequences.numSequences > 0) {
|
|
437
|
-
var firstSeq = app.project.sequences[0];
|
|
438
|
-
if (firstSeq && firstSeq.timebase) {
|
|
439
|
-
timebase = String(firstSeq.timebase);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
if (timebase === null) {
|
|
443
|
-
timebase = String(TICKS_PER_SECOND);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
app.project.newBarsAndTone(${w}, ${h}, timebase, "${escapeForExtendScript(name)}");
|
|
447
|
-
return __result({ created: true, name: "${escapeForExtendScript(name)}", width: ${w}, height: ${h}, timebase: timebase });
|
|
448
|
-
} catch (e) {
|
|
449
|
-
return __error("Failed to create bars and tone: " + e.toString());
|
|
450
|
-
}
|
|
425
|
+
const script = buildToolScript(`
|
|
426
|
+
try {
|
|
427
|
+
var explicitTimebase = ${explicitTimebase};
|
|
428
|
+
var timebase = explicitTimebase;
|
|
429
|
+
if (timebase === null) {
|
|
430
|
+
// Derive timebase from the active sequence, then any existing sequence,
|
|
431
|
+
// falling back to the standard TICKS_PER_SECOND default only if nothing
|
|
432
|
+
// else is available.
|
|
433
|
+
var seq = app.project.activeSequence;
|
|
434
|
+
if (seq && seq.timebase) {
|
|
435
|
+
timebase = String(seq.timebase);
|
|
436
|
+
} else if (app.project.sequences && app.project.sequences.numSequences > 0) {
|
|
437
|
+
var firstSeq = app.project.sequences[0];
|
|
438
|
+
if (firstSeq && firstSeq.timebase) {
|
|
439
|
+
timebase = String(firstSeq.timebase);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (timebase === null) {
|
|
443
|
+
timebase = String(TICKS_PER_SECOND);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
app.project.newBarsAndTone(${w}, ${h}, timebase, "${escapeForExtendScript(name)}");
|
|
447
|
+
return __result({ created: true, name: "${escapeForExtendScript(name)}", width: ${w}, height: ${h}, timebase: timebase });
|
|
448
|
+
} catch (e) {
|
|
449
|
+
return __error("Failed to create bars and tone: " + e.toString());
|
|
450
|
+
}
|
|
451
451
|
`);
|
|
452
452
|
return sendCommand(script, bridgeOptions);
|
|
453
453
|
},
|
|
@@ -465,9 +465,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
465
465
|
required: ["path"],
|
|
466
466
|
},
|
|
467
467
|
handler: async (args) => {
|
|
468
|
-
const script = buildToolScript(`
|
|
469
|
-
app.openFCPXML("${escapeForExtendScript(args.path)}");
|
|
470
|
-
return __result({ imported: true, path: "${escapeForExtendScript(args.path)}" });
|
|
468
|
+
const script = buildToolScript(`
|
|
469
|
+
app.openFCPXML("${escapeForExtendScript(args.path)}");
|
|
470
|
+
return __result({ imported: true, path: "${escapeForExtendScript(args.path)}" });
|
|
471
471
|
`);
|
|
472
472
|
return sendCommand(script, bridgeOptions);
|
|
473
473
|
},
|
|
@@ -485,9 +485,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
485
485
|
required: ["enabled"],
|
|
486
486
|
},
|
|
487
487
|
handler: async (args) => {
|
|
488
|
-
const script = buildToolScript(`
|
|
489
|
-
app.project.setEnableTranscodeOnIngest(${args.enabled ? 1 : 0});
|
|
490
|
-
return __result({ set: true, transcodeOnIngest: ${args.enabled} });
|
|
488
|
+
const script = buildToolScript(`
|
|
489
|
+
app.project.setEnableTranscodeOnIngest(${args.enabled ? 1 : 0});
|
|
490
|
+
return __result({ set: true, transcodeOnIngest: ${args.enabled} });
|
|
491
491
|
`);
|
|
492
492
|
return sendCommand(script, bridgeOptions);
|
|
493
493
|
},
|
|
@@ -496,10 +496,10 @@ export function getProjectTools(bridgeOptions) {
|
|
|
496
496
|
description: "Get the current target bin for new imports (the bin that is currently focused in the Project panel)",
|
|
497
497
|
parameters: {},
|
|
498
498
|
handler: async () => {
|
|
499
|
-
const script = buildToolScript(`
|
|
500
|
-
var bin = app.project.getInsertionBin();
|
|
501
|
-
if (!bin) return __error("No insertion bin found");
|
|
502
|
-
return __result({ name: bin.name, nodeId: bin.nodeId, treePath: bin.treePath });
|
|
499
|
+
const script = buildToolScript(`
|
|
500
|
+
var bin = app.project.getInsertionBin();
|
|
501
|
+
if (!bin) return __error("No insertion bin found");
|
|
502
|
+
return __result({ name: bin.name, nodeId: bin.nodeId, treePath: bin.treePath });
|
|
503
503
|
`);
|
|
504
504
|
return sendCommand(script, bridgeOptions);
|
|
505
505
|
},
|
|
@@ -508,10 +508,10 @@ export function getProjectTools(bridgeOptions) {
|
|
|
508
508
|
description: "Get the current project panel metadata/column configuration as XML",
|
|
509
509
|
parameters: {},
|
|
510
510
|
handler: async () => {
|
|
511
|
-
const script = buildToolScript(`
|
|
512
|
-
var meta = app.project.getProjectPanelMetadata();
|
|
513
|
-
if (!meta) return __error("Could not retrieve project panel metadata");
|
|
514
|
-
return __result({ metadata: meta });
|
|
511
|
+
const script = buildToolScript(`
|
|
512
|
+
var meta = app.project.getProjectPanelMetadata();
|
|
513
|
+
if (!meta) return __error("Could not retrieve project panel metadata");
|
|
514
|
+
return __result({ metadata: meta });
|
|
515
515
|
`);
|
|
516
516
|
return sendCommand(script, bridgeOptions);
|
|
517
517
|
},
|
|
@@ -529,9 +529,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
529
529
|
required: ["metadata_xml"],
|
|
530
530
|
},
|
|
531
531
|
handler: async (args) => {
|
|
532
|
-
const script = buildToolScript(`
|
|
533
|
-
app.project.setProjectPanelMetadata("${escapeForExtendScript(args.metadata_xml)}");
|
|
534
|
-
return __result({ set: true });
|
|
532
|
+
const script = buildToolScript(`
|
|
533
|
+
app.project.setProjectPanelMetadata("${escapeForExtendScript(args.metadata_xml)}");
|
|
534
|
+
return __result({ set: true });
|
|
535
535
|
`);
|
|
536
536
|
return sendCommand(script, bridgeOptions);
|
|
537
537
|
},
|
|
@@ -540,9 +540,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
540
540
|
description: "Get the graphics white luminance value (HDR setting) for the project",
|
|
541
541
|
parameters: {},
|
|
542
542
|
handler: async () => {
|
|
543
|
-
const script = buildToolScript(`
|
|
544
|
-
var val = app.project.getGraphicsWhiteLuminance();
|
|
545
|
-
return __result({ graphicsWhiteLuminance: val });
|
|
543
|
+
const script = buildToolScript(`
|
|
544
|
+
var val = app.project.getGraphicsWhiteLuminance();
|
|
545
|
+
return __result({ graphicsWhiteLuminance: val });
|
|
546
546
|
`);
|
|
547
547
|
return sendCommand(script, bridgeOptions);
|
|
548
548
|
},
|
|
@@ -560,9 +560,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
560
560
|
required: ["luminance"],
|
|
561
561
|
},
|
|
562
562
|
handler: async (args) => {
|
|
563
|
-
const script = buildToolScript(`
|
|
564
|
-
app.project.setGraphicsWhiteLuminance(${args.luminance});
|
|
565
|
-
return __result({ set: true, graphicsWhiteLuminance: ${args.luminance} });
|
|
563
|
+
const script = buildToolScript(`
|
|
564
|
+
app.project.setGraphicsWhiteLuminance(${args.luminance});
|
|
565
|
+
return __result({ set: true, graphicsWhiteLuminance: ${args.luminance} });
|
|
566
566
|
`);
|
|
567
567
|
return sendCommand(script, bridgeOptions);
|
|
568
568
|
},
|
|
@@ -584,9 +584,9 @@ export function getProjectTools(bridgeOptions) {
|
|
|
584
584
|
required: ["scratch_disk_type", "path"],
|
|
585
585
|
},
|
|
586
586
|
handler: async (args) => {
|
|
587
|
-
const script = buildToolScript(`
|
|
588
|
-
app.setScratchDiskPath("${escapeForExtendScript(args.path)}", "${escapeForExtendScript(args.scratch_disk_type)}");
|
|
589
|
-
return __result({ set: true, type: "${escapeForExtendScript(args.scratch_disk_type)}", path: "${escapeForExtendScript(args.path)}" });
|
|
587
|
+
const script = buildToolScript(`
|
|
588
|
+
app.setScratchDiskPath("${escapeForExtendScript(args.path)}", "${escapeForExtendScript(args.scratch_disk_type)}");
|
|
589
|
+
return __result({ set: true, type: "${escapeForExtendScript(args.scratch_disk_type)}", path: "${escapeForExtendScript(args.path)}" });
|
|
590
590
|
`);
|
|
591
591
|
return sendCommand(script, bridgeOptions);
|
|
592
592
|
},
|