@synthetic-ai/premiere-mcp 2.0.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +21 -0
  3. package/README.md +242 -0
  4. package/cep-plugin/.debug +8 -0
  5. package/cep-plugin/CSInterface.js +70 -0
  6. package/cep-plugin/CSXS/manifest.xml +49 -0
  7. package/cep-plugin/host.jsx +7 -0
  8. package/cep-plugin/index.html +419 -0
  9. package/cep-plugin/main.js +327 -0
  10. package/cep-plugin/premiere.jsx +24947 -0
  11. package/cep-plugin/synthetic-logo.png +0 -0
  12. package/dist/bridge/file-bridge.d.ts +29 -0
  13. package/dist/bridge/file-bridge.js +145 -0
  14. package/dist/bridge/script-builder.d.ts +19 -0
  15. package/dist/bridge/script-builder.js +408 -0
  16. package/dist/http-server.d.ts +21 -0
  17. package/dist/http-server.js +140 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.js +70 -0
  20. package/dist/resources/extendscript-reference.d.ts +2 -0
  21. package/dist/resources/extendscript-reference.js +219 -0
  22. package/dist/server.d.ts +4 -0
  23. package/dist/server.js +276 -0
  24. package/dist/tools/advanced.d.ts +530 -0
  25. package/dist/tools/advanced.js +923 -0
  26. package/dist/tools/audio-advanced.d.ts +847 -0
  27. package/dist/tools/audio-advanced.js +1653 -0
  28. package/dist/tools/audio.d.ts +84 -0
  29. package/dist/tools/audio.js +123 -0
  30. package/dist/tools/captions.d.ts +30 -0
  31. package/dist/tools/captions.js +73 -0
  32. package/dist/tools/clipboard.d.ts +153 -0
  33. package/dist/tools/clipboard.js +381 -0
  34. package/dist/tools/color-advanced.d.ts +821 -0
  35. package/dist/tools/color-advanced.js +772 -0
  36. package/dist/tools/discovery.d.ts +128 -0
  37. package/dist/tools/discovery.js +445 -0
  38. package/dist/tools/effects.d.ts +211 -0
  39. package/dist/tools/effects.js +554 -0
  40. package/dist/tools/export-presets.d.ts +333 -0
  41. package/dist/tools/export-presets.js +490 -0
  42. package/dist/tools/export.d.ts +320 -0
  43. package/dist/tools/export.js +618 -0
  44. package/dist/tools/health.d.ts +9 -0
  45. package/dist/tools/health.js +25 -0
  46. package/dist/tools/inspection.d.ts +179 -0
  47. package/dist/tools/inspection.js +1089 -0
  48. package/dist/tools/keyframes.d.ts +253 -0
  49. package/dist/tools/keyframes.js +611 -0
  50. package/dist/tools/markers.d.ts +117 -0
  51. package/dist/tools/markers.js +206 -0
  52. package/dist/tools/media.d.ts +297 -0
  53. package/dist/tools/media.js +493 -0
  54. package/dist/tools/metadata.d.ts +178 -0
  55. package/dist/tools/metadata.js +278 -0
  56. package/dist/tools/multicam.d.ts +199 -0
  57. package/dist/tools/multicam.js +212 -0
  58. package/dist/tools/playback.d.ts +34 -0
  59. package/dist/tools/playback.js +63 -0
  60. package/dist/tools/playhead.d.ts +77 -0
  61. package/dist/tools/playhead.js +185 -0
  62. package/dist/tools/project-manager.d.ts +65 -0
  63. package/dist/tools/project-manager.js +81 -0
  64. package/dist/tools/project.d.ts +390 -0
  65. package/dist/tools/project.js +596 -0
  66. package/dist/tools/scripting.d.ts +98 -0
  67. package/dist/tools/scripting.js +434 -0
  68. package/dist/tools/selection.d.ts +120 -0
  69. package/dist/tools/selection.js +334 -0
  70. package/dist/tools/sequence-advanced.d.ts +84 -0
  71. package/dist/tools/sequence-advanced.js +471 -0
  72. package/dist/tools/sequence-settings.d.ts +397 -0
  73. package/dist/tools/sequence-settings.js +967 -0
  74. package/dist/tools/sequence.d.ts +211 -0
  75. package/dist/tools/sequence.js +378 -0
  76. package/dist/tools/source-monitor.d.ts +95 -0
  77. package/dist/tools/source-monitor.js +180 -0
  78. package/dist/tools/text.d.ts +97 -0
  79. package/dist/tools/text.js +159 -0
  80. package/dist/tools/timeline.d.ts +265 -0
  81. package/dist/tools/timeline.js +575 -0
  82. package/dist/tools/track-management.d.ts +482 -0
  83. package/dist/tools/track-management.js +787 -0
  84. package/dist/tools/track-targeting.d.ts +666 -0
  85. package/dist/tools/track-targeting.js +1318 -0
  86. package/dist/tools/tracks.d.ts +90 -0
  87. package/dist/tools/tracks.js +183 -0
  88. package/dist/tools/transitions-motion.d.ts +788 -0
  89. package/dist/tools/transitions-motion.js +680 -0
  90. package/dist/tools/transitions.d.ts +124 -0
  91. package/dist/tools/transitions.js +267 -0
  92. package/dist/tools/utility.d.ts +469 -0
  93. package/dist/tools/utility.js +1118 -0
  94. package/dist/tools/workspace.d.ts +25 -0
  95. package/dist/tools/workspace.js +61 -0
  96. package/package.json +66 -0
  97. package/scripts/build-chat-dmg.sh +210 -0
  98. package/scripts/build-chat-zip.sh +291 -0
  99. package/scripts/install-cep-windows.ps1 +99 -0
  100. package/scripts/install-cep.sh +66 -0
  101. package/scripts/install-chat-plugin.bat +67 -0
  102. package/scripts/install-chat-plugin.sh +85 -0
  103. package/scripts/install-windows.bat +95 -0
  104. package/scripts/package.mjs +218 -0
@@ -0,0 +1,772 @@
1
+ import { buildToolScript } from "../bridge/script-builder.js";
2
+ import { sendCommand } from "../bridge/file-bridge.js";
3
+ export function getColorAdvancedTools(bridgeOptions) {
4
+ return {
5
+ lumetri_get_all: {
6
+ description: "Get all Lumetri Color parameter values for a clip. Returns exposure, contrast, highlights, shadows, whites, blacks, temperature, tint, saturation, vibrance, vignette, and all other parameters.",
7
+ parameters: {
8
+ type: "object",
9
+ properties: {
10
+ track_index: { type: "number", description: "Video track index (0-based)" },
11
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
12
+ },
13
+ required: ["track_index", "clip_index"],
14
+ },
15
+ handler: async (args) => {
16
+ const script = buildToolScript(`
17
+ var result = lumetriGetAll(${args.track_index}, ${args.clip_index});
18
+ var parsed = JSON.parse(result);
19
+ if (!parsed.success) return __error(parsed.error);
20
+ return __result(parsed.data);
21
+ `);
22
+ return sendCommand(script, bridgeOptions);
23
+ },
24
+ },
25
+ lumetri_set_exposure: {
26
+ description: "Set Lumetri Color exposure for a clip. Range: -4.0 (very dark) to +4.0 (very bright). 0 = no change.",
27
+ parameters: {
28
+ type: "object",
29
+ properties: {
30
+ track_index: { type: "number", description: "Video track index (0-based)" },
31
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
32
+ value: { type: "number", description: "Exposure value from -4.0 to +4.0" },
33
+ },
34
+ required: ["track_index", "clip_index", "value"],
35
+ },
36
+ handler: async (args) => {
37
+ const script = buildToolScript(`
38
+ var result = lumetriSetExposure(${args.track_index}, ${args.clip_index}, ${args.value});
39
+ var parsed = JSON.parse(result);
40
+ if (!parsed.success) return __error(parsed.error);
41
+ return __result(parsed.data);
42
+ `);
43
+ return sendCommand(script, bridgeOptions);
44
+ },
45
+ },
46
+ lumetri_set_contrast: {
47
+ description: "Set Lumetri Color contrast for a clip. Range: -100 to +100. 0 = no change.",
48
+ parameters: {
49
+ type: "object",
50
+ properties: {
51
+ track_index: { type: "number", description: "Video track index (0-based)" },
52
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
53
+ value: { type: "number", description: "Contrast value from -100 to +100" },
54
+ },
55
+ required: ["track_index", "clip_index", "value"],
56
+ },
57
+ handler: async (args) => {
58
+ const script = buildToolScript(`
59
+ var result = lumetriSetContrast(${args.track_index}, ${args.clip_index}, ${args.value});
60
+ var parsed = JSON.parse(result);
61
+ if (!parsed.success) return __error(parsed.error);
62
+ return __result(parsed.data);
63
+ `);
64
+ return sendCommand(script, bridgeOptions);
65
+ },
66
+ },
67
+ lumetri_set_highlights: {
68
+ description: "Set Lumetri Color highlights for a clip. Range: -100 to +100. Positive values recover highlight detail.",
69
+ parameters: {
70
+ type: "object",
71
+ properties: {
72
+ track_index: { type: "number", description: "Video track index (0-based)" },
73
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
74
+ value: { type: "number", description: "Highlights value from -100 to +100" },
75
+ },
76
+ required: ["track_index", "clip_index", "value"],
77
+ },
78
+ handler: async (args) => {
79
+ const script = buildToolScript(`
80
+ var result = lumetriSetHighlights(${args.track_index}, ${args.clip_index}, ${args.value});
81
+ var parsed = JSON.parse(result);
82
+ if (!parsed.success) return __error(parsed.error);
83
+ return __result(parsed.data);
84
+ `);
85
+ return sendCommand(script, bridgeOptions);
86
+ },
87
+ },
88
+ lumetri_set_shadows: {
89
+ description: "Set Lumetri Color shadows for a clip. Range: -100 to +100. Positive values lift shadows.",
90
+ parameters: {
91
+ type: "object",
92
+ properties: {
93
+ track_index: { type: "number", description: "Video track index (0-based)" },
94
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
95
+ value: { type: "number", description: "Shadows value from -100 to +100" },
96
+ },
97
+ required: ["track_index", "clip_index", "value"],
98
+ },
99
+ handler: async (args) => {
100
+ const script = buildToolScript(`
101
+ var result = lumetriSetShadows(${args.track_index}, ${args.clip_index}, ${args.value});
102
+ var parsed = JSON.parse(result);
103
+ if (!parsed.success) return __error(parsed.error);
104
+ return __result(parsed.data);
105
+ `);
106
+ return sendCommand(script, bridgeOptions);
107
+ },
108
+ },
109
+ lumetri_set_whites: {
110
+ description: "Set Lumetri Color whites for a clip. Range: -100 to +100. Affects the brightest whites.",
111
+ parameters: {
112
+ type: "object",
113
+ properties: {
114
+ track_index: { type: "number", description: "Video track index (0-based)" },
115
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
116
+ value: { type: "number", description: "Whites value from -100 to +100" },
117
+ },
118
+ required: ["track_index", "clip_index", "value"],
119
+ },
120
+ handler: async (args) => {
121
+ const script = buildToolScript(`
122
+ var result = lumetriSetWhites(${args.track_index}, ${args.clip_index}, ${args.value});
123
+ var parsed = JSON.parse(result);
124
+ if (!parsed.success) return __error(parsed.error);
125
+ return __result(parsed.data);
126
+ `);
127
+ return sendCommand(script, bridgeOptions);
128
+ },
129
+ },
130
+ lumetri_set_blacks: {
131
+ description: "Set Lumetri Color blacks for a clip. Range: -100 to +100. Negative values crush the blacks.",
132
+ parameters: {
133
+ type: "object",
134
+ properties: {
135
+ track_index: { type: "number", description: "Video track index (0-based)" },
136
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
137
+ value: { type: "number", description: "Blacks value from -100 to +100" },
138
+ },
139
+ required: ["track_index", "clip_index", "value"],
140
+ },
141
+ handler: async (args) => {
142
+ const script = buildToolScript(`
143
+ var result = lumetriSetBlacks(${args.track_index}, ${args.clip_index}, ${args.value});
144
+ var parsed = JSON.parse(result);
145
+ if (!parsed.success) return __error(parsed.error);
146
+ return __result(parsed.data);
147
+ `);
148
+ return sendCommand(script, bridgeOptions);
149
+ },
150
+ },
151
+ lumetri_set_temperature: {
152
+ description: "Set Lumetri Color white balance temperature for a clip. Negative values are cooler (blue), positive values are warmer (orange).",
153
+ parameters: {
154
+ type: "object",
155
+ properties: {
156
+ track_index: { type: "number", description: "Video track index (0-based)" },
157
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
158
+ value: { type: "number", description: "Temperature value (negative = cool/blue, positive = warm/orange)" },
159
+ },
160
+ required: ["track_index", "clip_index", "value"],
161
+ },
162
+ handler: async (args) => {
163
+ const script = buildToolScript(`
164
+ var result = lumetriSetTemperature(${args.track_index}, ${args.clip_index}, ${args.value});
165
+ var parsed = JSON.parse(result);
166
+ if (!parsed.success) return __error(parsed.error);
167
+ return __result(parsed.data);
168
+ `);
169
+ return sendCommand(script, bridgeOptions);
170
+ },
171
+ },
172
+ lumetri_set_tint: {
173
+ description: "Set Lumetri Color white balance tint for a clip. Negative values are green, positive values are magenta.",
174
+ parameters: {
175
+ type: "object",
176
+ properties: {
177
+ track_index: { type: "number", description: "Video track index (0-based)" },
178
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
179
+ value: { type: "number", description: "Tint value (negative = green, positive = magenta)" },
180
+ },
181
+ required: ["track_index", "clip_index", "value"],
182
+ },
183
+ handler: async (args) => {
184
+ const script = buildToolScript(`
185
+ var result = lumetriSetTint(${args.track_index}, ${args.clip_index}, ${args.value});
186
+ var parsed = JSON.parse(result);
187
+ if (!parsed.success) return __error(parsed.error);
188
+ return __result(parsed.data);
189
+ `);
190
+ return sendCommand(script, bridgeOptions);
191
+ },
192
+ },
193
+ lumetri_set_saturation: {
194
+ description: "Set Lumetri Color saturation for a clip. Range: 0 (black and white) to 200 (double saturation). 100 = no change.",
195
+ parameters: {
196
+ type: "object",
197
+ properties: {
198
+ track_index: { type: "number", description: "Video track index (0-based)" },
199
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
200
+ value: { type: "number", description: "Saturation value from 0 to 200. 100 = original." },
201
+ },
202
+ required: ["track_index", "clip_index", "value"],
203
+ },
204
+ handler: async (args) => {
205
+ const script = buildToolScript(`
206
+ var result = lumetriSetSaturation(${args.track_index}, ${args.clip_index}, ${args.value});
207
+ var parsed = JSON.parse(result);
208
+ if (!parsed.success) return __error(parsed.error);
209
+ return __result(parsed.data);
210
+ `);
211
+ return sendCommand(script, bridgeOptions);
212
+ },
213
+ },
214
+ lumetri_set_vibrance: {
215
+ description: "Set Lumetri Color vibrance for a clip. Range: -100 to +100. Vibrance selectively boosts less-saturated colors.",
216
+ parameters: {
217
+ type: "object",
218
+ properties: {
219
+ track_index: { type: "number", description: "Video track index (0-based)" },
220
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
221
+ value: { type: "number", description: "Vibrance value from -100 to +100" },
222
+ },
223
+ required: ["track_index", "clip_index", "value"],
224
+ },
225
+ handler: async (args) => {
226
+ const script = buildToolScript(`
227
+ var result = lumetriSetVibrance(${args.track_index}, ${args.clip_index}, ${args.value});
228
+ var parsed = JSON.parse(result);
229
+ if (!parsed.success) return __error(parsed.error);
230
+ return __result(parsed.data);
231
+ `);
232
+ return sendCommand(script, bridgeOptions);
233
+ },
234
+ },
235
+ lumetri_set_faded_film: {
236
+ description: "Set Lumetri Color faded film amount for a clip. Range: 0 to 100. Creates a filmic fade/matte look.",
237
+ parameters: {
238
+ type: "object",
239
+ properties: {
240
+ track_index: { type: "number", description: "Video track index (0-based)" },
241
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
242
+ value: { type: "number", description: "Faded film amount from 0 to 100" },
243
+ },
244
+ required: ["track_index", "clip_index", "value"],
245
+ },
246
+ handler: async (args) => {
247
+ const script = buildToolScript(`
248
+ var result = lumetriSetFadedFilm(${args.track_index}, ${args.clip_index}, ${args.value});
249
+ var parsed = JSON.parse(result);
250
+ if (!parsed.success) return __error(parsed.error);
251
+ return __result(parsed.data);
252
+ `);
253
+ return sendCommand(script, bridgeOptions);
254
+ },
255
+ },
256
+ lumetri_set_sharpen: {
257
+ description: "Set Lumetri Color sharpening for a clip. Range: 0 to 200. 0 = no sharpening.",
258
+ parameters: {
259
+ type: "object",
260
+ properties: {
261
+ track_index: { type: "number", description: "Video track index (0-based)" },
262
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
263
+ value: { type: "number", description: "Sharpen amount from 0 to 200" },
264
+ },
265
+ required: ["track_index", "clip_index", "value"],
266
+ },
267
+ handler: async (args) => {
268
+ const script = buildToolScript(`
269
+ var result = lumetriSetSharpen(${args.track_index}, ${args.clip_index}, ${args.value});
270
+ var parsed = JSON.parse(result);
271
+ if (!parsed.success) return __error(parsed.error);
272
+ return __result(parsed.data);
273
+ `);
274
+ return sendCommand(script, bridgeOptions);
275
+ },
276
+ },
277
+ lumetri_set_curve_point: {
278
+ description: "Set a point on the RGB/Luma tone curve for Lumetri Color. Channel: 'luma', 'red', 'green', or 'blue'. Input/output values are 0-255.",
279
+ parameters: {
280
+ type: "object",
281
+ properties: {
282
+ track_index: { type: "number", description: "Video track index (0-based)" },
283
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
284
+ channel: { type: "string", description: "Curve channel: 'luma', 'red', 'green', or 'blue'" },
285
+ input_value: { type: "number", description: "Input (x-axis) value from 0 to 255" },
286
+ output_value: { type: "number", description: "Output (y-axis) value from 0 to 255" },
287
+ },
288
+ required: ["track_index", "clip_index", "channel", "input_value", "output_value"],
289
+ },
290
+ handler: async (args) => {
291
+ const safeChannel = args.channel.replace(/"/g, '\\"');
292
+ const script = buildToolScript(`
293
+ var seq = app.project.activeSequence;
294
+ if (!seq) return __error("No active sequence");
295
+ var track = seq.videoTracks[${args.track_index}];
296
+ if (!track || ${args.clip_index} >= track.clips.numItems) return __error("Track or clip not found");
297
+ var clip = track.clips[${args.clip_index}];
298
+ var lumetri = null;
299
+ for (var i = 0; i < clip.components.numItems; i++) {
300
+ if (clip.components[i].displayName === "Lumetri Color" || clip.components[i].matchName === "AE.ADBE Lumetri") {
301
+ lumetri = clip.components[i]; break;
302
+ }
303
+ }
304
+ if (!lumetri) {
305
+ app.enableQE();
306
+ clip.addVideoEffect(qe.project.getVideoEffectByName("Lumetri Color"));
307
+ for (var i = 0; i < clip.components.numItems; i++) {
308
+ if (clip.components[i].displayName === "Lumetri Color") { lumetri = clip.components[i]; break; }
309
+ }
310
+ if (!lumetri) return __error("Could not find or add Lumetri Color to clip");
311
+ }
312
+ var channelMap = { luma: "Luma Curve", red: "Red Curve", green: "Green Curve", blue: "Blue Curve" };
313
+ var curvePropName = channelMap["${safeChannel}"] || "Luma Curve";
314
+ var curveProp = null;
315
+ for (var p = 0; p < lumetri.properties.numItems; p++) {
316
+ var group = lumetri.properties[p];
317
+ if (group.properties) {
318
+ for (var sp = 0; sp < group.properties.numItems; sp++) {
319
+ if (group.properties[sp].displayName === curvePropName) {
320
+ curveProp = group.properties[sp]; break;
321
+ }
322
+ }
323
+ }
324
+ if (group.displayName === curvePropName) { curveProp = group; break; }
325
+ if (curveProp) break;
326
+ }
327
+ if (!curveProp) return __error("Could not find curve property: " + curvePropName + ". Ensure Lumetri Color is applied.");
328
+ var normIn = ${args.input_value} / 255;
329
+ var normOut = ${args.output_value} / 255;
330
+ try {
331
+ var currentVal = curveProp.getValue(0, 0);
332
+ if (Array.isArray(currentVal)) {
333
+ currentVal.push(normIn, normOut);
334
+ curveProp.setValue(currentVal, true);
335
+ } else {
336
+ curveProp.setValue([0, 0, normIn, normOut, 1, 1], true);
337
+ }
338
+ return __result({ set: true, channel: "${safeChannel}", input: ${args.input_value}, output: ${args.output_value}, normalized: { in: normIn, out: normOut } });
339
+ } catch(e) {
340
+ return __error("Could not set curve point: " + e.toString() + ". Try using lumetri_auto_color or setting curves manually.");
341
+ }
342
+ `);
343
+ return sendCommand(script, bridgeOptions);
344
+ },
345
+ },
346
+ lumetri_set_shadow_color: {
347
+ description: "Set the shadow color wheel in Lumetri Color. Adjusts hue, saturation, and brightness of shadows.",
348
+ parameters: {
349
+ type: "object",
350
+ properties: {
351
+ track_index: { type: "number", description: "Video track index (0-based)" },
352
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
353
+ hue: { type: "number", description: "Hue angle in degrees (0-360)" },
354
+ saturation: { type: "number", description: "Saturation amount (0-100)" },
355
+ brightness: { type: "number", description: "Brightness adjustment (-100 to +100)" },
356
+ },
357
+ required: ["track_index", "clip_index", "hue", "saturation", "brightness"],
358
+ },
359
+ handler: async (args) => {
360
+ const script = buildToolScript(`
361
+ var result = lumetriSetShadowColor(${args.track_index}, ${args.clip_index}, ${args.hue}, ${args.saturation}, ${args.brightness});
362
+ var parsed = JSON.parse(result);
363
+ if (!parsed.success) return __error(parsed.error);
364
+ return __result(parsed.data);
365
+ `);
366
+ return sendCommand(script, bridgeOptions);
367
+ },
368
+ },
369
+ lumetri_set_midtone_color: {
370
+ description: "Set the midtone color wheel in Lumetri Color. Adjusts hue, saturation, and brightness of midtones.",
371
+ parameters: {
372
+ type: "object",
373
+ properties: {
374
+ track_index: { type: "number", description: "Video track index (0-based)" },
375
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
376
+ hue: { type: "number", description: "Hue angle in degrees (0-360)" },
377
+ saturation: { type: "number", description: "Saturation amount (0-100)" },
378
+ brightness: { type: "number", description: "Brightness adjustment (-100 to +100)" },
379
+ },
380
+ required: ["track_index", "clip_index", "hue", "saturation", "brightness"],
381
+ },
382
+ handler: async (args) => {
383
+ const script = buildToolScript(`
384
+ var result = lumetriSetMidtoneColor(${args.track_index}, ${args.clip_index}, ${args.hue}, ${args.saturation}, ${args.brightness});
385
+ var parsed = JSON.parse(result);
386
+ if (!parsed.success) return __error(parsed.error);
387
+ return __result(parsed.data);
388
+ `);
389
+ return sendCommand(script, bridgeOptions);
390
+ },
391
+ },
392
+ lumetri_set_highlight_color: {
393
+ description: "Set the highlight color wheel in Lumetri Color. Adjusts hue, saturation, and brightness of highlights.",
394
+ parameters: {
395
+ type: "object",
396
+ properties: {
397
+ track_index: { type: "number", description: "Video track index (0-based)" },
398
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
399
+ hue: { type: "number", description: "Hue angle in degrees (0-360)" },
400
+ saturation: { type: "number", description: "Saturation amount (0-100)" },
401
+ brightness: { type: "number", description: "Brightness adjustment (-100 to +100)" },
402
+ },
403
+ required: ["track_index", "clip_index", "hue", "saturation", "brightness"],
404
+ },
405
+ handler: async (args) => {
406
+ const script = buildToolScript(`
407
+ var result = lumetriSetHighlightColor(${args.track_index}, ${args.clip_index}, ${args.hue}, ${args.saturation}, ${args.brightness});
408
+ var parsed = JSON.parse(result);
409
+ if (!parsed.success) return __error(parsed.error);
410
+ return __result(parsed.data);
411
+ `);
412
+ return sendCommand(script, bridgeOptions);
413
+ },
414
+ },
415
+ lumetri_set_vignette_amount: {
416
+ description: "Set Lumetri Color vignette amount. Range: -5 (dark vignette) to +5 (light vignette). 0 = no vignette.",
417
+ parameters: {
418
+ type: "object",
419
+ properties: {
420
+ track_index: { type: "number", description: "Video track index (0-based)" },
421
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
422
+ value: { type: "number", description: "Vignette amount from -5 to +5" },
423
+ },
424
+ required: ["track_index", "clip_index", "value"],
425
+ },
426
+ handler: async (args) => {
427
+ const script = buildToolScript(`
428
+ var result = lumetriSetVignetteAmount(${args.track_index}, ${args.clip_index}, ${args.value});
429
+ var parsed = JSON.parse(result);
430
+ if (!parsed.success) return __error(parsed.error);
431
+ return __result(parsed.data);
432
+ `);
433
+ return sendCommand(script, bridgeOptions);
434
+ },
435
+ },
436
+ lumetri_set_vignette_midpoint: {
437
+ description: "Set Lumetri Color vignette midpoint (size). Range: 0 to 100. Higher values move the vignette edge outward (smaller vignette).",
438
+ parameters: {
439
+ type: "object",
440
+ properties: {
441
+ track_index: { type: "number", description: "Video track index (0-based)" },
442
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
443
+ value: { type: "number", description: "Vignette midpoint from 0 to 100" },
444
+ },
445
+ required: ["track_index", "clip_index", "value"],
446
+ },
447
+ handler: async (args) => {
448
+ const script = buildToolScript(`
449
+ var result = lumetriSetVignetteMidpoint(${args.track_index}, ${args.clip_index}, ${args.value});
450
+ var parsed = JSON.parse(result);
451
+ if (!parsed.success) return __error(parsed.error);
452
+ return __result(parsed.data);
453
+ `);
454
+ return sendCommand(script, bridgeOptions);
455
+ },
456
+ },
457
+ lumetri_set_vignette_roundness: {
458
+ description: "Set Lumetri Color vignette roundness. Range: -100 (rectangular) to +100 (circular). 0 = square corners.",
459
+ parameters: {
460
+ type: "object",
461
+ properties: {
462
+ track_index: { type: "number", description: "Video track index (0-based)" },
463
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
464
+ value: { type: "number", description: "Vignette roundness from -100 to +100" },
465
+ },
466
+ required: ["track_index", "clip_index", "value"],
467
+ },
468
+ handler: async (args) => {
469
+ const script = buildToolScript(`
470
+ var result = lumetriSetVignetteRoundness(${args.track_index}, ${args.clip_index}, ${args.value});
471
+ var parsed = JSON.parse(result);
472
+ if (!parsed.success) return __error(parsed.error);
473
+ return __result(parsed.data);
474
+ `);
475
+ return sendCommand(script, bridgeOptions);
476
+ },
477
+ },
478
+ lumetri_set_vignette_feather: {
479
+ description: "Set Lumetri Color vignette feather (softness). Range: 0 to 100. Higher values create a softer vignette edge.",
480
+ parameters: {
481
+ type: "object",
482
+ properties: {
483
+ track_index: { type: "number", description: "Video track index (0-based)" },
484
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
485
+ value: { type: "number", description: "Vignette feather from 0 to 100" },
486
+ },
487
+ required: ["track_index", "clip_index", "value"],
488
+ },
489
+ handler: async (args) => {
490
+ const script = buildToolScript(`
491
+ var result = lumetriSetVignetteFeather(${args.track_index}, ${args.clip_index}, ${args.value});
492
+ var parsed = JSON.parse(result);
493
+ if (!parsed.success) return __error(parsed.error);
494
+ return __result(parsed.data);
495
+ `);
496
+ return sendCommand(script, bridgeOptions);
497
+ },
498
+ },
499
+ lumetri_apply_lut: {
500
+ description: "Apply a LUT (.cube or .3dl file) to a clip via Lumetri Color. The LUT file must be accessible on disk.",
501
+ parameters: {
502
+ type: "object",
503
+ properties: {
504
+ track_index: { type: "number", description: "Video track index (0-based)" },
505
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
506
+ lut_path: { type: "string", description: "Full path to the LUT file (.cube or .3dl)" },
507
+ },
508
+ required: ["track_index", "clip_index", "lut_path"],
509
+ },
510
+ handler: async (args) => {
511
+ const lutPathEsc = args.lut_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
512
+ const script = buildToolScript(`
513
+ var result = lumetriApplyLUT(${args.track_index}, ${args.clip_index}, "${lutPathEsc}");
514
+ var parsed = JSON.parse(result);
515
+ if (!parsed.success) return __error(parsed.error);
516
+ return __result(parsed.data);
517
+ `);
518
+ return sendCommand(script, bridgeOptions);
519
+ },
520
+ },
521
+ lumetri_remove_lut: {
522
+ description: "Remove the applied LUT from a clip's Lumetri Color effect.",
523
+ parameters: {
524
+ type: "object",
525
+ properties: {
526
+ track_index: { type: "number", description: "Video track index (0-based)" },
527
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
528
+ },
529
+ required: ["track_index", "clip_index"],
530
+ },
531
+ handler: async (args) => {
532
+ const script = buildToolScript(`
533
+ var result = lumetriRemoveLUT(${args.track_index}, ${args.clip_index});
534
+ var parsed = JSON.parse(result);
535
+ if (!parsed.success) return __error(parsed.error);
536
+ return __result(parsed.data);
537
+ `);
538
+ return sendCommand(script, bridgeOptions);
539
+ },
540
+ },
541
+ lumetri_auto_color: {
542
+ description: "Apply automatic color correction to a clip using Lumetri Color. Sets reasonable default values for exposure and white balance.",
543
+ parameters: {
544
+ type: "object",
545
+ properties: {
546
+ track_index: { type: "number", description: "Video track index (0-based)" },
547
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
548
+ },
549
+ required: ["track_index", "clip_index"],
550
+ },
551
+ handler: async (args) => {
552
+ const script = buildToolScript(`
553
+ var result = lumetriAutoColor(${args.track_index}, ${args.clip_index});
554
+ var parsed = JSON.parse(result);
555
+ if (!parsed.success) return __error(parsed.error);
556
+ return __result(parsed.data);
557
+ `);
558
+ return sendCommand(script, bridgeOptions);
559
+ },
560
+ },
561
+ lumetri_reset: {
562
+ description: "Reset all Lumetri Color parameters to their default (neutral) values for a clip.",
563
+ parameters: {
564
+ type: "object",
565
+ properties: {
566
+ track_index: { type: "number", description: "Video track index (0-based)" },
567
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
568
+ },
569
+ required: ["track_index", "clip_index"],
570
+ },
571
+ handler: async (args) => {
572
+ const script = buildToolScript(`
573
+ var result = lumetriReset(${args.track_index}, ${args.clip_index});
574
+ var parsed = JSON.parse(result);
575
+ if (!parsed.success) return __error(parsed.error);
576
+ return __result(parsed.data);
577
+ `);
578
+ return sendCommand(script, bridgeOptions);
579
+ },
580
+ },
581
+ lumetri_auto_white_balance: {
582
+ description: "Apply automatic white balance to a clip using Lumetri Color. Analyzes the clip and adjusts temperature and tint.",
583
+ parameters: {
584
+ type: "object",
585
+ properties: {
586
+ track_index: { type: "number", description: "Video track index (0-based)" },
587
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
588
+ },
589
+ required: ["track_index", "clip_index"],
590
+ },
591
+ handler: async (args) => {
592
+ const script = buildToolScript(`
593
+ var result = lumetriAutoWhiteBalance(${args.track_index}, ${args.clip_index});
594
+ var parsed = JSON.parse(result);
595
+ if (!parsed.success) return __error(parsed.error);
596
+ return __result(parsed.data);
597
+ `);
598
+ return sendCommand(script, bridgeOptions);
599
+ },
600
+ },
601
+ copy_color_grade: {
602
+ description: "Copy the Lumetri Color grade from a source clip. Use paste_color_grade afterward to apply it to other clips.",
603
+ parameters: {
604
+ type: "object",
605
+ properties: {
606
+ track_index: { type: "number", description: "Source video track index (0-based)" },
607
+ clip_index: { type: "number", description: "Source clip index on the track (0-based)" },
608
+ },
609
+ required: ["track_index", "clip_index"],
610
+ },
611
+ handler: async (args) => {
612
+ const script = buildToolScript(`
613
+ var result = copyColorGrade(${args.track_index}, ${args.clip_index});
614
+ var parsed = JSON.parse(result);
615
+ if (!parsed.success) return __error(parsed.error);
616
+ return __result(parsed.data);
617
+ `);
618
+ return sendCommand(script, bridgeOptions);
619
+ },
620
+ },
621
+ paste_color_grade: {
622
+ description: "Paste the previously copied Lumetri Color grade to a destination clip. Call copy_color_grade first.",
623
+ parameters: {
624
+ type: "object",
625
+ properties: {
626
+ track_index: { type: "number", description: "Destination video track index (0-based)" },
627
+ clip_index: { type: "number", description: "Destination clip index on the track (0-based)" },
628
+ },
629
+ required: ["track_index", "clip_index"],
630
+ },
631
+ handler: async (args) => {
632
+ const script = buildToolScript(`
633
+ var result = pasteColorGrade(${args.track_index}, ${args.clip_index});
634
+ var parsed = JSON.parse(result);
635
+ if (!parsed.success) return __error(parsed.error);
636
+ return __result(parsed.data);
637
+ `);
638
+ return sendCommand(script, bridgeOptions);
639
+ },
640
+ },
641
+ apply_color_grade_to_all: {
642
+ description: "Copy a color grade from one clip and apply it to all clips on a specified track.",
643
+ parameters: {
644
+ type: "object",
645
+ properties: {
646
+ src_track_index: { type: "number", description: "Source clip video track index (0-based)" },
647
+ src_clip_index: { type: "number", description: "Source clip index (0-based)" },
648
+ dest_track_index: { type: "number", description: "Destination track index where all clips will receive the grade" },
649
+ },
650
+ required: ["src_track_index", "src_clip_index", "dest_track_index"],
651
+ },
652
+ handler: async (args) => {
653
+ const script = buildToolScript(`
654
+ var result = applyColorGradeToAll(${args.src_track_index}, ${args.src_clip_index}, ${args.dest_track_index});
655
+ var parsed = JSON.parse(result);
656
+ if (!parsed.success) return __error(parsed.error);
657
+ return __result(parsed.data);
658
+ `);
659
+ return sendCommand(script, bridgeOptions);
660
+ },
661
+ },
662
+ apply_lut_to_all_clips: {
663
+ description: "Apply a LUT file to all clips on a video track via Lumetri Color.",
664
+ parameters: {
665
+ type: "object",
666
+ properties: {
667
+ track_index: { type: "number", description: "Video track index (0-based)" },
668
+ lut_path: { type: "string", description: "Full path to the LUT file (.cube or .3dl)" },
669
+ },
670
+ required: ["track_index", "lut_path"],
671
+ },
672
+ handler: async (args) => {
673
+ const lutPathEsc = args.lut_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
674
+ const script = buildToolScript(`
675
+ var seq = app.project.activeSequence;
676
+ if (!seq) return __error("No active sequence");
677
+ var track = seq.videoTracks[${args.track_index}];
678
+ if (!track) return __error("Video track not found at index ${args.track_index}");
679
+ var lutPath = "${lutPathEsc}";
680
+ var lutFile = new File(lutPath);
681
+ if (!lutFile.exists) return __error("LUT file not found: " + lutPath);
682
+ app.enableQE();
683
+ var applied = 0;
684
+ var errors = [];
685
+ for (var c = 0; c < track.clips.numItems; c++) {
686
+ var clip = track.clips[c];
687
+ try {
688
+ var lumetri = null;
689
+ for (var i = 0; i < clip.components.numItems; i++) {
690
+ if (clip.components[i].displayName === "Lumetri Color" || clip.components[i].matchName === "AE.ADBE Lumetri") {
691
+ lumetri = clip.components[i]; break;
692
+ }
693
+ }
694
+ if (!lumetri) {
695
+ clip.addVideoEffect(qe.project.getVideoEffectByName("Lumetri Color"));
696
+ for (var i = 0; i < clip.components.numItems; i++) {
697
+ if (clip.components[i].displayName === "Lumetri Color") { lumetri = clip.components[i]; break; }
698
+ }
699
+ }
700
+ if (!lumetri) { errors.push("Clip " + c + ": could not add Lumetri"); continue; }
701
+ var lutProp = null;
702
+ for (var p = 0; p < lumetri.properties.numItems; p++) {
703
+ var grp = lumetri.properties[p];
704
+ if (grp.properties) {
705
+ for (var sp = 0; sp < grp.properties.numItems; sp++) {
706
+ if (grp.properties[sp].displayName === "Input LUT" || grp.properties[sp].displayName === "Creative Look") {
707
+ lutProp = grp.properties[sp]; break;
708
+ }
709
+ }
710
+ }
711
+ if (lutProp) break;
712
+ }
713
+ if (lutProp) { lutProp.setValue(lutPath, true); applied++; }
714
+ else { errors.push("Clip " + c + ": LUT property not found"); }
715
+ } catch(e) { errors.push("Clip " + c + ": " + e.toString()); }
716
+ }
717
+ return __result({ applied: applied, total: track.clips.numItems, errors: errors, lutPath: lutPath });
718
+ `);
719
+ return sendCommand(script, bridgeOptions);
720
+ },
721
+ },
722
+ reset_color_on_all_clips: {
723
+ description: "Reset Lumetri Color to default values on all clips on a video track.",
724
+ parameters: {
725
+ type: "object",
726
+ properties: {
727
+ track_index: { type: "number", description: "Video track index (0-based)" },
728
+ },
729
+ required: ["track_index"],
730
+ },
731
+ handler: async (args) => {
732
+ const script = buildToolScript(`
733
+ var seq = app.project.activeSequence;
734
+ if (!seq) return __error("No active sequence");
735
+ var track = seq.videoTracks[${args.track_index}];
736
+ if (!track) return __error("Video track not found at index ${args.track_index}");
737
+ var count = 0;
738
+ for (var c = 0; c < track.clips.numItems; c++) {
739
+ var clip = track.clips[c];
740
+ var lumetri = __findIntrinsic(clip, "lumetri");
741
+ if (lumetri) {
742
+ try { lumetri.remove(); count++; } catch(e) {}
743
+ }
744
+ }
745
+ return __result({ reset: count, total: track.clips.numItems });
746
+ `);
747
+ return sendCommand(script, bridgeOptions);
748
+ },
749
+ },
750
+ get_color_info: {
751
+ description: "Get color information and Lumetri Color settings for a clip.",
752
+ parameters: {
753
+ type: "object",
754
+ properties: {
755
+ track_index: { type: "number", description: "Video track index (0-based)" },
756
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
757
+ },
758
+ required: ["track_index", "clip_index"],
759
+ },
760
+ handler: async (args) => {
761
+ const script = buildToolScript(`
762
+ var result = getColorInfo(${args.track_index}, ${args.clip_index});
763
+ var parsed = JSON.parse(result);
764
+ if (!parsed.success) return __error(parsed.error);
765
+ return __result(parsed.data);
766
+ `);
767
+ return sendCommand(script, bridgeOptions);
768
+ },
769
+ },
770
+ };
771
+ }
772
+ //# sourceMappingURL=color-advanced.js.map