premiere-cli 0.2.0__py3-none-any.whl
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.
- premiere_cli/__init__.py +11 -0
- premiere_cli/cli.py +3664 -0
- premiere_cli/log.py +66 -0
- premiere_cli/panel/.debug +8 -0
- premiere_cli/panel/CSXS/manifest.xml +52 -0
- premiere_cli/panel/css/style.css +53 -0
- premiere_cli/panel/host/commands/add-adjustment-layer.jsx +190 -0
- premiere_cli/panel/host/commands/add-audio-keyframes.jsx +176 -0
- premiere_cli/panel/host/commands/add-custom-metadata-field.jsx +63 -0
- premiere_cli/panel/host/commands/add-keyframe.jsx +181 -0
- premiere_cli/panel/host/commands/add-marker-to-project-item.jsx +194 -0
- premiere_cli/panel/host/commands/add-marker.jsx +129 -0
- premiere_cli/panel/host/commands/add-text-overlay.jsx +101 -0
- premiere_cli/panel/host/commands/add-to-render-queue.jsx +120 -0
- premiere_cli/panel/host/commands/add-to-timeline.jsx +300 -0
- premiere_cli/panel/host/commands/add-track.jsx +188 -0
- premiere_cli/panel/host/commands/add-transition.jsx +134 -0
- premiere_cli/panel/host/commands/adjust-audio-levels.jsx +132 -0
- premiere_cli/panel/host/commands/apply-audio-effect.jsx +118 -0
- premiere_cli/panel/host/commands/apply-effect.jsx +122 -0
- premiere_cli/panel/host/commands/apply-lut.jsx +107 -0
- premiere_cli/panel/host/commands/attach-custom-property.jsx +66 -0
- premiere_cli/panel/host/commands/auto-reframe-sequence.jsx +124 -0
- premiere_cli/panel/host/commands/batch-add-transitions.jsx +158 -0
- premiere_cli/panel/host/commands/batch-apply-effect.jsx +182 -0
- premiere_cli/panel/host/commands/batch-rename-clips.jsx +170 -0
- premiere_cli/panel/host/commands/batch-set-clips-enabled.jsx +145 -0
- premiere_cli/panel/host/commands/clear-item-in-out.jsx +117 -0
- premiere_cli/panel/host/commands/clear-sequence-in-out.jsx +100 -0
- premiere_cli/panel/host/commands/close-all-source-clips.jsx +32 -0
- premiere_cli/panel/host/commands/close-sequence.jsx +80 -0
- premiere_cli/panel/host/commands/close-source-monitor.jsx +32 -0
- premiere_cli/panel/host/commands/color-correct.jsx +164 -0
- premiere_cli/panel/host/commands/copy-effect-values.jsx +183 -0
- premiere_cli/panel/host/commands/copy-effects-between-clips.jsx +234 -0
- premiere_cli/panel/host/commands/create-bars-and-tone.jsx +152 -0
- premiere_cli/panel/host/commands/create-bin.jsx +76 -0
- premiere_cli/panel/host/commands/create-caption-track.jsx +159 -0
- premiere_cli/panel/host/commands/create-sequence-from-clips.jsx +170 -0
- premiere_cli/panel/host/commands/create-sequence-from-preset.jsx +90 -0
- premiere_cli/panel/host/commands/create-sequence.jsx +166 -0
- premiere_cli/panel/host/commands/create-smart-bin.jsx +80 -0
- premiere_cli/panel/host/commands/create-subclip.jsx +248 -0
- premiere_cli/panel/host/commands/create-subsequence.jsx +136 -0
- premiere_cli/panel/host/commands/debug-qe-inspect.jsx +248 -0
- premiere_cli/panel/host/commands/debug-qe-try-mutate.jsx +305 -0
- premiere_cli/panel/host/commands/delete-marker.jsx +178 -0
- premiere_cli/panel/host/commands/deselect-all-clips.jsx +98 -0
- premiere_cli/panel/host/commands/detach-proxy.jsx +116 -0
- premiere_cli/panel/host/commands/duplicate-clip.jsx +140 -0
- premiere_cli/panel/host/commands/duplicate-sequence.jsx +150 -0
- premiere_cli/panel/host/commands/encode-file.jsx +86 -0
- premiere_cli/panel/host/commands/encode-project-item.jsx +145 -0
- premiere_cli/panel/host/commands/export-aaf.jsx +77 -0
- premiere_cli/panel/host/commands/export-fcp-xml.jsx +65 -0
- premiere_cli/panel/host/commands/export-frame.jsx +381 -0
- premiere_cli/panel/host/commands/export-omf.jsx +95 -0
- premiere_cli/panel/host/commands/export-sequence-as-project.jsx +65 -0
- premiere_cli/panel/host/commands/export-sequence.jsx +100 -0
- premiere_cli/panel/host/commands/extract-audio-track.jsx +181 -0
- premiere_cli/panel/host/commands/extract-selection.jsx +113 -0
- premiere_cli/panel/host/commands/find-items-by-media-path.jsx +112 -0
- premiere_cli/panel/host/commands/freeze-frame.jsx +215 -0
- premiere_cli/panel/host/commands/get-active-sequence.jsx +103 -0
- premiere_cli/panel/host/commands/get-all-project-paths.jsx +72 -0
- premiere_cli/panel/host/commands/get-bin-contents.jsx +176 -0
- premiere_cli/panel/host/commands/get-clip-adjustment-layer.jsx +83 -0
- premiere_cli/panel/host/commands/get-clip-at-playhead.jsx +99 -0
- premiere_cli/panel/host/commands/get-clip-at-position.jsx +120 -0
- premiere_cli/panel/host/commands/get-clip-links.jsx +135 -0
- premiere_cli/panel/host/commands/get-clip-markers.jsx +144 -0
- premiere_cli/panel/host/commands/get-clip-speed.jsx +69 -0
- premiere_cli/panel/host/commands/get-color-label.jsx +89 -0
- premiere_cli/panel/host/commands/get-color-space.jsx +99 -0
- premiere_cli/panel/host/commands/get-duplicate-media.jsx +78 -0
- premiere_cli/panel/host/commands/get-effect-properties.jsx +129 -0
- premiere_cli/panel/host/commands/get-encoder-presets.jsx +131 -0
- premiere_cli/panel/host/commands/get-export-file-extension.jsx +56 -0
- premiere_cli/panel/host/commands/get-footage-interpretation.jsx +113 -0
- premiere_cli/panel/host/commands/get-full-clip-info.jsx +162 -0
- premiere_cli/panel/host/commands/get-full-project-overview.jsx +193 -0
- premiere_cli/panel/host/commands/get-full-sequence-info.jsx +184 -0
- premiere_cli/panel/host/commands/get-graphics-white-luminance.jsx +31 -0
- premiere_cli/panel/host/commands/get-insertion-bin.jsx +35 -0
- premiere_cli/panel/host/commands/get-item-metadata.jsx +94 -0
- premiere_cli/panel/host/commands/get-keyframes.jsx +158 -0
- premiere_cli/panel/host/commands/get-mogrt-component.jsx +111 -0
- premiere_cli/panel/host/commands/get-next-edit-point.jsx +131 -0
- premiere_cli/panel/host/commands/get-offline-media.jsx +67 -0
- premiere_cli/panel/host/commands/get-open-projects.jsx +50 -0
- premiere_cli/panel/host/commands/get-premiere-state.jsx +164 -0
- premiere_cli/panel/host/commands/get-project-info.jsx +63 -0
- premiere_cli/panel/host/commands/get-project-item-info.jsx +247 -0
- premiere_cli/panel/host/commands/get-project-panel-metadata.jsx +30 -0
- premiere_cli/panel/host/commands/get-qe-clip-info.jsx +198 -0
- premiere_cli/panel/host/commands/get-render-queue-status.jsx +35 -0
- premiere_cli/panel/host/commands/get-sequence-count.jsx +24 -0
- premiere_cli/panel/host/commands/get-sequence-in-out.jsx +76 -0
- premiere_cli/panel/host/commands/get-sequence-markers-by-type.jsx +89 -0
- premiere_cli/panel/host/commands/get-source-monitor-info.jsx +34 -0
- premiere_cli/panel/host/commands/get-source-monitor-position.jsx +30 -0
- premiere_cli/panel/host/commands/get-target-tracks.jsx +76 -0
- premiere_cli/panel/host/commands/get-timeline-gaps.jsx +124 -0
- premiere_cli/panel/host/commands/get-timeline-summary.jsx +154 -0
- premiere_cli/panel/host/commands/get-total-clip-count.jsx +67 -0
- premiere_cli/panel/host/commands/get-track-info.jsx +117 -0
- premiere_cli/panel/host/commands/get-unused-media.jsx +99 -0
- premiere_cli/panel/host/commands/get-used-media-report.jsx +125 -0
- premiere_cli/panel/host/commands/get-value-at-time.jsx +135 -0
- premiere_cli/panel/host/commands/get-version-info.jsx +33 -0
- premiere_cli/panel/host/commands/get-work-area.jsx +52 -0
- premiere_cli/panel/host/commands/get-workspaces.jsx +29 -0
- premiere_cli/panel/host/commands/get-xmp-metadata.jsx +107 -0
- premiere_cli/panel/host/commands/import-ae-comps.jsx +129 -0
- premiere_cli/panel/host/commands/import-fcp-xml.jsx +103 -0
- premiere_cli/panel/host/commands/import-folder.jsx +193 -0
- premiere_cli/panel/host/commands/import-image-sequence.jsx +171 -0
- premiere_cli/panel/host/commands/import-media.jsx +217 -0
- premiere_cli/panel/host/commands/import-mogrt-from-library.jsx +105 -0
- premiere_cli/panel/host/commands/import-mogrt.jsx +111 -0
- premiere_cli/panel/host/commands/import-sequences-from-project.jsx +80 -0
- premiere_cli/panel/host/commands/insert-from-source.jsx +162 -0
- premiere_cli/panel/host/commands/inspect-dom-object.jsx +162 -0
- premiere_cli/panel/host/commands/invert-selection.jsx +114 -0
- premiere_cli/panel/host/commands/is-work-area-enabled.jsx +88 -0
- premiere_cli/panel/host/commands/lift-selection.jsx +106 -0
- premiere_cli/panel/host/commands/link-selection.jsx +111 -0
- premiere_cli/panel/host/commands/list-available-audio-effects.jsx +33 -0
- premiere_cli/panel/host/commands/list-available-audio-transitions.jsx +35 -0
- premiere_cli/panel/host/commands/list-available-effects.jsx +33 -0
- premiere_cli/panel/host/commands/list-available-transitions.jsx +74 -0
- premiere_cli/panel/host/commands/list-markers.jsx +69 -0
- premiere_cli/panel/host/commands/list-project-items.jsx +105 -0
- premiere_cli/panel/host/commands/lock-track.jsx +114 -0
- premiere_cli/panel/host/commands/manage-proxies.jsx +176 -0
- premiere_cli/panel/host/commands/match-frame.jsx +141 -0
- premiere_cli/panel/host/commands/move-clip-to-track.jsx +220 -0
- premiere_cli/panel/host/commands/move-clip.jsx +97 -0
- premiere_cli/panel/host/commands/move-items-to-bin.jsx +194 -0
- premiere_cli/panel/host/commands/move-playhead-to-edit.jsx +174 -0
- premiere_cli/panel/host/commands/move-playhead.jsx +137 -0
- premiere_cli/panel/host/commands/nest-clips.jsx +179 -0
- premiere_cli/panel/host/commands/open-in-source.jsx +117 -0
- premiere_cli/panel/host/commands/open-project.jsx +61 -0
- premiere_cli/panel/host/commands/overwrite-clip-at.jsx +350 -0
- premiere_cli/panel/host/commands/overwrite-from-source.jsx +150 -0
- premiere_cli/panel/host/commands/play-source-monitor.jsx +36 -0
- premiere_cli/panel/host/commands/play-timeline.jsx +24 -0
- premiere_cli/panel/host/commands/razor-all-tracks.jsx +171 -0
- premiere_cli/panel/host/commands/redo.jsx +69 -0
- premiere_cli/panel/host/commands/refresh-media.jsx +101 -0
- premiere_cli/panel/host/commands/relink-media.jsx +132 -0
- premiere_cli/panel/host/commands/remove-all-effects.jsx +114 -0
- premiere_cli/panel/host/commands/remove-effect-by-name.jsx +143 -0
- premiere_cli/panel/host/commands/remove-effect.jsx +122 -0
- premiere_cli/panel/host/commands/remove-from-timeline.jsx +93 -0
- premiere_cli/panel/host/commands/remove-keyframe-range.jsx +173 -0
- premiere_cli/panel/host/commands/remove-keyframe.jsx +192 -0
- premiere_cli/panel/host/commands/remove-selected-clips.jsx +126 -0
- premiere_cli/panel/host/commands/remove-track-intervals.jsx +254 -0
- premiere_cli/panel/host/commands/remove-transition.jsx +164 -0
- premiere_cli/panel/host/commands/rename-bin.jsx +88 -0
- premiere_cli/panel/host/commands/rename-clip.jsx +127 -0
- premiere_cli/panel/host/commands/rename-project-item.jsx +111 -0
- premiere_cli/panel/host/commands/rename-track.jsx +84 -0
- premiere_cli/panel/host/commands/replace-clip-media.jsx +140 -0
- premiere_cli/panel/host/commands/replace-clip.jsx +188 -0
- premiere_cli/panel/host/commands/reverse-clip.jsx +187 -0
- premiere_cli/panel/host/commands/ripple-delete-clip.jsx +156 -0
- premiere_cli/panel/host/commands/roll-edit.jsx +162 -0
- premiere_cli/panel/host/commands/save-project-as.jsx +55 -0
- premiere_cli/panel/host/commands/save-project.jsx +57 -0
- premiere_cli/panel/host/commands/scene-edit-detection.jsx +128 -0
- premiere_cli/panel/host/commands/search-project-items.jsx +180 -0
- premiere_cli/panel/host/commands/select-all-clips.jsx +107 -0
- premiere_cli/panel/host/commands/select-clips-by-color.jsx +142 -0
- premiere_cli/panel/host/commands/select-clips-by-name.jsx +133 -0
- premiere_cli/panel/host/commands/select-clips-in-range.jsx +133 -0
- premiere_cli/panel/host/commands/select-disabled-clips.jsx +127 -0
- premiere_cli/panel/host/commands/select-project-item.jsx +115 -0
- premiere_cli/panel/host/commands/set-active-project.jsx +184 -0
- premiere_cli/panel/host/commands/set-active-sequence.jsx +87 -0
- premiere_cli/panel/host/commands/set-all-tracks-targeted.jsx +112 -0
- premiere_cli/panel/host/commands/set-anti-alias-quality.jsx +125 -0
- premiere_cli/panel/host/commands/set-blend-mode.jsx +111 -0
- premiere_cli/panel/host/commands/set-clip-anchor-point.jsx +102 -0
- premiere_cli/panel/host/commands/set-clip-enabled.jsx +127 -0
- premiere_cli/panel/host/commands/set-clip-opacity.jsx +102 -0
- premiere_cli/panel/host/commands/set-clip-pan.jsx +107 -0
- premiere_cli/panel/host/commands/set-clip-position.jsx +103 -0
- premiere_cli/panel/host/commands/set-clip-properties.jsx +221 -0
- premiere_cli/panel/host/commands/set-clip-rotation.jsx +102 -0
- premiere_cli/panel/host/commands/set-clip-scale.jsx +102 -0
- premiere_cli/panel/host/commands/set-clip-selection.jsx +144 -0
- premiere_cli/panel/host/commands/set-clip-speed.jsx +160 -0
- premiere_cli/panel/host/commands/set-clip-volume.jsx +128 -0
- premiere_cli/panel/host/commands/set-color-label.jsx +123 -0
- premiere_cli/panel/host/commands/set-color-value.jsx +155 -0
- premiere_cli/panel/host/commands/set-effect-property.jsx +124 -0
- premiere_cli/panel/host/commands/set-footage-interpretation.jsx +173 -0
- premiere_cli/panel/host/commands/set-frame-blend.jsx +145 -0
- premiere_cli/panel/host/commands/set-graphics-white-luminance.jsx +73 -0
- premiere_cli/panel/host/commands/set-item-in-out.jsx +180 -0
- premiere_cli/panel/host/commands/set-item-metadata.jsx +134 -0
- premiere_cli/panel/host/commands/set-item-offline.jsx +109 -0
- premiere_cli/panel/host/commands/set-item-start-time.jsx +139 -0
- premiere_cli/panel/host/commands/set-keyframe-interpolation.jsx +186 -0
- premiere_cli/panel/host/commands/set-override-frame-rate.jsx +123 -0
- premiere_cli/panel/host/commands/set-override-pixel-aspect-ratio.jsx +129 -0
- premiere_cli/panel/host/commands/set-poster-frame.jsx +192 -0
- premiere_cli/panel/host/commands/set-project-panel-metadata.jsx +69 -0
- premiere_cli/panel/host/commands/set-scale-to-frame-size.jsx +101 -0
- premiere_cli/panel/host/commands/set-scale-width-height.jsx +140 -0
- premiere_cli/panel/host/commands/set-sequence-in-out.jsx +65 -0
- premiere_cli/panel/host/commands/set-sequence-settings.jsx +184 -0
- premiere_cli/panel/host/commands/set-source-in-out.jsx +98 -0
- premiere_cli/panel/host/commands/set-target-track.jsx +91 -0
- premiere_cli/panel/host/commands/set-time-interpolation.jsx +141 -0
- premiere_cli/panel/host/commands/set-track-mute.jsx +91 -0
- premiere_cli/panel/host/commands/set-track-visibility.jsx +94 -0
- premiere_cli/panel/host/commands/set-transcode-on-ingest.jsx +78 -0
- premiere_cli/panel/host/commands/set-uniform-scale.jsx +104 -0
- premiere_cli/panel/host/commands/set-work-area.jsx +76 -0
- premiere_cli/panel/host/commands/set-workspace.jsx +35 -0
- premiere_cli/panel/host/commands/set-xmp-metadata.jsx +157 -0
- premiere_cli/panel/host/commands/slide-edit.jsx +162 -0
- premiere_cli/panel/host/commands/slip-edit.jsx +167 -0
- premiere_cli/panel/host/commands/split-clip.jsx +144 -0
- premiere_cli/panel/host/commands/stabilize-clip.jsx +139 -0
- premiere_cli/panel/host/commands/stop-playback.jsx +23 -0
- premiere_cli/panel/host/commands/trim-clip.jsx +111 -0
- premiere_cli/panel/host/commands/undo.jsx +114 -0
- premiere_cli/panel/host/commands/unlink-selection.jsx +106 -0
- premiere_cli/panel/host/commands/unnest-sequence.jsx +207 -0
- premiere_cli/panel/host/commands/update-marker.jsx +120 -0
- premiere_cli/panel/host/index.jsx +1227 -0
- premiere_cli/panel/host/presets/default-4k-25fps.sqpreset +63 -0
- premiere_cli/panel/index.html +16 -0
- premiere_cli/panel/js/cs-interface.js +11 -0
- premiere_cli/panel/js/main.js +409 -0
- premiere_cli/panel_install.py +220 -0
- premiere_cli-0.2.0.dist-info/METADATA +127 -0
- premiere_cli-0.2.0.dist-info/RECORD +247 -0
- premiere_cli-0.2.0.dist-info/WHEEL +5 -0
- premiere_cli-0.2.0.dist-info/entry_points.txt +3 -0
- premiere_cli-0.2.0.dist-info/licenses/LICENSE +428 -0
- premiere_cli-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Command: remove-effect-by-name → ppb_removeEffectByName
|
|
2
|
+
// Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
|
|
3
|
+
// same global ExtendScript context — shared helpers (findSequenceByName,
|
|
4
|
+
// resolveTimelineClip, serializeClipComponents,
|
|
5
|
+
// isProtectedBuiltinComponent, ...) are already defined there.
|
|
6
|
+
//
|
|
7
|
+
// Removes EVERY component on a clip whose displayName OR matchName exactly
|
|
8
|
+
// matches effectName (leancoderkavy's clipboard.ts remove_effect_by_name
|
|
9
|
+
// removes all matches too, not just the first). Iterates components
|
|
10
|
+
// backwards so removing one doesn't shift the indices of ones still to be
|
|
11
|
+
// checked. Motion/Opacity are still refused even if effectName happens to
|
|
12
|
+
// match them — see remove-effect's notes on why. Same disputed-API
|
|
13
|
+
// verification as remove-effect: judged by clip.components.numItems
|
|
14
|
+
// dropping, not by remove()'s return value.
|
|
15
|
+
function ppb_removeEffectByName(argsJson) {
|
|
16
|
+
try {
|
|
17
|
+
var args;
|
|
18
|
+
try {
|
|
19
|
+
args = JSON.parse(argsJson);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (args.trackType !== "video" && args.trackType !== "audio") {
|
|
25
|
+
return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
|
|
26
|
+
}
|
|
27
|
+
if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
|
|
28
|
+
return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
|
|
29
|
+
}
|
|
30
|
+
if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
|
|
31
|
+
return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
|
|
32
|
+
}
|
|
33
|
+
if (typeof args.effectName !== "string" || !args.effectName) {
|
|
34
|
+
return JSON.stringify({ ok: false, error: "effectName must be a non-empty string" });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!app.project) {
|
|
38
|
+
return JSON.stringify({ ok: false, error: "no project open" });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var seq = null;
|
|
42
|
+
if (args.sequenceName && typeof args.sequenceName === "string") {
|
|
43
|
+
seq = findSequenceByName(args.sequenceName);
|
|
44
|
+
if (!seq) {
|
|
45
|
+
return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
seq = app.project.activeSequence;
|
|
49
|
+
if (!seq) {
|
|
50
|
+
return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var resolvedClip = resolveTimelineClip(seq, args.trackType, args.trackIndex, args.clipIndex);
|
|
55
|
+
if (resolvedClip.error) {
|
|
56
|
+
return JSON.stringify({ ok: false, error: resolvedClip.error });
|
|
57
|
+
}
|
|
58
|
+
var clip = resolvedClip.clip;
|
|
59
|
+
var clipName = null;
|
|
60
|
+
try { clipName = clip.name; } catch (e) { clipName = null; }
|
|
61
|
+
|
|
62
|
+
var previousComponents = serializeClipComponents(clip);
|
|
63
|
+
var previousCount = previousComponents.length;
|
|
64
|
+
|
|
65
|
+
var matchingIndices = [];
|
|
66
|
+
for (var i = 0; i < previousCount; i++) {
|
|
67
|
+
var info = previousComponents[i];
|
|
68
|
+
if (info.displayName === args.effectName || info.matchName === args.effectName) {
|
|
69
|
+
matchingIndices.push(i);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (matchingIndices.length === 0) {
|
|
74
|
+
return JSON.stringify({ ok: false, error: "no component found on this clip matching displayName/matchName \"" + args.effectName + "\"" });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var attempts = [];
|
|
78
|
+
var removedCount = 0;
|
|
79
|
+
var skippedProtected = 0;
|
|
80
|
+
// Iterate backwards so an earlier removal never shifts a later index
|
|
81
|
+
// still queued for removal.
|
|
82
|
+
for (var m = matchingIndices.length - 1; m >= 0; m--) {
|
|
83
|
+
var idx = matchingIndices[m];
|
|
84
|
+
var comp = clip.components[idx];
|
|
85
|
+
if (isProtectedBuiltinComponent(comp)) {
|
|
86
|
+
skippedProtected++;
|
|
87
|
+
attempts.push({ componentIndex: idx, success: false, skipped: true, reason: "protected built-in component (Motion/Opacity)" });
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
comp.remove();
|
|
92
|
+
attempts.push({ componentIndex: idx, success: true });
|
|
93
|
+
removedCount++;
|
|
94
|
+
} catch (e) {
|
|
95
|
+
attempts.push({ componentIndex: idx, success: false, error: e.toString() });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var newComponents = serializeClipComponents(clip);
|
|
100
|
+
var newCount = newComponents.length;
|
|
101
|
+
var actualDropped = previousCount - newCount;
|
|
102
|
+
var verified = actualDropped === removedCount;
|
|
103
|
+
|
|
104
|
+
if (matchingIndices.length === skippedProtected) {
|
|
105
|
+
return JSON.stringify({
|
|
106
|
+
ok: false,
|
|
107
|
+
error: "every component matching \"" + args.effectName + "\" is a protected built-in (Motion/Opacity) — refusing to remove"
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var result = {
|
|
112
|
+
sequenceName: seq.name,
|
|
113
|
+
trackType: args.trackType,
|
|
114
|
+
trackIndex: args.trackIndex,
|
|
115
|
+
clipIndex: args.clipIndex,
|
|
116
|
+
clipName: clipName,
|
|
117
|
+
effectName: args.effectName,
|
|
118
|
+
matchedCount: matchingIndices.length,
|
|
119
|
+
removeCallsSucceeded: removedCount,
|
|
120
|
+
skippedProtected: skippedProtected,
|
|
121
|
+
verified: verified,
|
|
122
|
+
previousComponentCount: previousCount,
|
|
123
|
+
newComponentCount: newCount,
|
|
124
|
+
previousComponents: previousComponents,
|
|
125
|
+
newComponents: newComponents,
|
|
126
|
+
attempts: attempts
|
|
127
|
+
};
|
|
128
|
+
if (actualDropped === 0) {
|
|
129
|
+
// Live-confirmed 2026-07-17: component.remove() silently no-ops on
|
|
130
|
+
// this Premiere 2026 build — treat a zero drop as a hard failure,
|
|
131
|
+
// never a success.
|
|
132
|
+
result.note = "single-effect removal is NON-FUNCTIONAL on this Premiere build — component.remove() no-throws but removes nothing (live-confirmed). Try remove-all-effects (QE removeEffects strips SOME effects), or remove manually in Effect Controls.";
|
|
133
|
+
return JSON.stringify({ ok: false, error: "no components were actually removed (component.remove() is a silent no-op on this build)", result: result });
|
|
134
|
+
}
|
|
135
|
+
if (!verified) {
|
|
136
|
+
result.note = "components.numItems dropped, but not by the expected amount — partial removal.";
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return JSON.stringify({ ok: true, result: result });
|
|
140
|
+
} catch (e) {
|
|
141
|
+
return JSON.stringify({ ok: false, error: e.toString() });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Command: remove-effect → ppb_removeEffect
|
|
2
|
+
// Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
|
|
3
|
+
// same global ExtendScript context — shared helpers (findSequenceByName,
|
|
4
|
+
// resolveTimelineClip, serializeClipComponents,
|
|
5
|
+
// isProtectedBuiltinComponent, ...) are already defined there.
|
|
6
|
+
//
|
|
7
|
+
// Removes one component from a clip by its index into clip.components.
|
|
8
|
+
// comp.remove() is DISPUTED across the reference repos this panel ports
|
|
9
|
+
// from — one claims single-effect removal works, another claims it's
|
|
10
|
+
// impossible — so success here is judged ONLY by clip.components.numItems
|
|
11
|
+
// actually dropping by 1 afterward, never by whether remove() itself threw.
|
|
12
|
+
// Refuses outright to touch Motion/Opacity (see isProtectedBuiltinComponent)
|
|
13
|
+
// since undo is non-functional on this build and removing an intrinsic
|
|
14
|
+
// component has no path back. Given that, this command is the primary
|
|
15
|
+
// cleanup path for apply-effect/apply-audio-effect mistakes — it must be
|
|
16
|
+
// solid and honest about what actually happened.
|
|
17
|
+
function ppb_removeEffect(argsJson) {
|
|
18
|
+
try {
|
|
19
|
+
var args;
|
|
20
|
+
try {
|
|
21
|
+
args = JSON.parse(argsJson);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (args.trackType !== "video" && args.trackType !== "audio") {
|
|
27
|
+
return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
|
|
28
|
+
}
|
|
29
|
+
if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
|
|
30
|
+
return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
|
|
31
|
+
}
|
|
32
|
+
if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
|
|
33
|
+
return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
|
|
34
|
+
}
|
|
35
|
+
if (typeof args.componentIndex !== "number" || args.componentIndex < 0 || Math.floor(args.componentIndex) !== args.componentIndex) {
|
|
36
|
+
return JSON.stringify({ ok: false, error: "componentIndex must be a non-negative integer" });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!app.project) {
|
|
40
|
+
return JSON.stringify({ ok: false, error: "no project open" });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var seq = null;
|
|
44
|
+
if (args.sequenceName && typeof args.sequenceName === "string") {
|
|
45
|
+
seq = findSequenceByName(args.sequenceName);
|
|
46
|
+
if (!seq) {
|
|
47
|
+
return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
seq = app.project.activeSequence;
|
|
51
|
+
if (!seq) {
|
|
52
|
+
return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var resolvedClip = resolveTimelineClip(seq, args.trackType, args.trackIndex, args.clipIndex);
|
|
57
|
+
if (resolvedClip.error) {
|
|
58
|
+
return JSON.stringify({ ok: false, error: resolvedClip.error });
|
|
59
|
+
}
|
|
60
|
+
var clip = resolvedClip.clip;
|
|
61
|
+
var clipName = null;
|
|
62
|
+
try { clipName = clip.name; } catch (e) { clipName = null; }
|
|
63
|
+
|
|
64
|
+
var previousComponents = serializeClipComponents(clip);
|
|
65
|
+
var previousCount = previousComponents.length;
|
|
66
|
+
|
|
67
|
+
if (args.componentIndex >= previousCount) {
|
|
68
|
+
return JSON.stringify({
|
|
69
|
+
ok: false,
|
|
70
|
+
error: "componentIndex " + args.componentIndex + " is out of range — clip has " + previousCount + " component(s)"
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var targetComponent = clip.components[args.componentIndex];
|
|
75
|
+
if (isProtectedBuiltinComponent(targetComponent)) {
|
|
76
|
+
return JSON.stringify({
|
|
77
|
+
ok: false,
|
|
78
|
+
error: "refusing to remove a built-in component (Motion/Opacity) at componentIndex " + args.componentIndex + " — undo is non-functional on this build, so there is no path back"
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var targetInfo = previousComponents[args.componentIndex];
|
|
83
|
+
|
|
84
|
+
var attempts = [];
|
|
85
|
+
try {
|
|
86
|
+
targetComponent.remove();
|
|
87
|
+
attempts.push({ call: "component.remove()", success: true });
|
|
88
|
+
} catch (e) {
|
|
89
|
+
attempts.push({ call: "component.remove()", success: false, error: e.toString() });
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var newComponents = serializeClipComponents(clip);
|
|
93
|
+
var newCount = newComponents.length;
|
|
94
|
+
var verified = newCount === previousCount - 1;
|
|
95
|
+
|
|
96
|
+
var result = {
|
|
97
|
+
sequenceName: seq.name,
|
|
98
|
+
trackType: args.trackType,
|
|
99
|
+
trackIndex: args.trackIndex,
|
|
100
|
+
clipIndex: args.clipIndex,
|
|
101
|
+
clipName: clipName,
|
|
102
|
+
componentIndex: args.componentIndex,
|
|
103
|
+
removedComponent: targetInfo,
|
|
104
|
+
verified: verified,
|
|
105
|
+
previousComponentCount: previousCount,
|
|
106
|
+
newComponentCount: newCount,
|
|
107
|
+
previousComponents: previousComponents,
|
|
108
|
+
newComponents: newComponents,
|
|
109
|
+
attempts: attempts
|
|
110
|
+
};
|
|
111
|
+
if (!verified) {
|
|
112
|
+
// Live-confirmed 2026-07-17: component.remove() silently no-ops on
|
|
113
|
+
// this Premiere 2026 build.
|
|
114
|
+
result.note = "single-effect removal is NON-FUNCTIONAL on this Premiere build — component.remove() no-throws but removes nothing (live-confirmed). Try remove-all-effects (QE removeEffects strips SOME effects), or remove manually in Effect Controls.";
|
|
115
|
+
return JSON.stringify({ ok: false, error: "the component was not actually removed (component.remove() is a silent no-op on this build)", result: result });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return JSON.stringify({ ok: true, result: result });
|
|
119
|
+
} catch (e) {
|
|
120
|
+
return JSON.stringify({ ok: false, error: e.toString() });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Command: remove-from-timeline → ppb_removeFromTimeline
|
|
2
|
+
// Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
|
|
3
|
+
// same global ExtendScript context — shared helpers (findSequenceByName,
|
|
4
|
+
// resolveTimelineClip, serializeTrackItem, ...) are already defined
|
|
5
|
+
// there.
|
|
6
|
+
//
|
|
7
|
+
// DESTRUCTIVE: permanently removes a clip from the timeline via
|
|
8
|
+
// clip.remove(ripple, alignToVideo=false) (PREMIERE_API_NOTES.md's
|
|
9
|
+
// "Clips / TrackItems" section — ripple=true closes the gap, false lifts
|
|
10
|
+
// it in place). Undo is NON-FUNCTIONAL on this build — there is no path
|
|
11
|
+
// back once this succeeds. Ported from leancoderkavy's
|
|
12
|
+
// premiere-pro-mcp remove_from_timeline tool, re-addressed to this
|
|
13
|
+
// panel's trackType/trackIndex/clipIndex convention instead of node_id.
|
|
14
|
+
//
|
|
15
|
+
// MUTATION RULE: verified by a track.clips.numItems drop of exactly one,
|
|
16
|
+
// never by remove()'s own (undocumented) return value.
|
|
17
|
+
|
|
18
|
+
function ppb_removeFromTimeline(argsJson) {
|
|
19
|
+
try {
|
|
20
|
+
var args;
|
|
21
|
+
try {
|
|
22
|
+
args = JSON.parse(argsJson);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (args.trackType !== "video" && args.trackType !== "audio") {
|
|
28
|
+
return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
|
|
29
|
+
}
|
|
30
|
+
if (typeof args.trackIndex !== "number" || typeof args.clipIndex !== "number") {
|
|
31
|
+
return JSON.stringify({ ok: false, error: "trackIndex and clipIndex are required" });
|
|
32
|
+
}
|
|
33
|
+
if (typeof args.ripple !== "boolean") {
|
|
34
|
+
return JSON.stringify({ ok: false, error: "ripple (boolean) is required" });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!app.project) {
|
|
38
|
+
return JSON.stringify({ ok: false, error: "no project open" });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var seq = null;
|
|
42
|
+
if (args.sequenceName && typeof args.sequenceName === "string") {
|
|
43
|
+
seq = findSequenceByName(args.sequenceName);
|
|
44
|
+
if (!seq) {
|
|
45
|
+
return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
seq = app.project.activeSequence;
|
|
49
|
+
if (!seq) {
|
|
50
|
+
return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var resolved = resolveTimelineClip(seq, args.trackType, args.trackIndex, args.clipIndex);
|
|
55
|
+
if (resolved.error) {
|
|
56
|
+
return JSON.stringify({ ok: false, error: resolved.error });
|
|
57
|
+
}
|
|
58
|
+
var clip = resolved.clip;
|
|
59
|
+
var track = args.trackType === "video" ? seq.videoTracks[args.trackIndex] : seq.audioTracks[args.trackIndex];
|
|
60
|
+
|
|
61
|
+
var before = serializeTrackItem(clip, args.trackIndex, args.clipIndex);
|
|
62
|
+
var clipCountBefore = null;
|
|
63
|
+
try { clipCountBefore = track.clips.numItems; } catch (e2) { clipCountBefore = null; }
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
clip.remove(args.ripple, false);
|
|
67
|
+
} catch (e3) {
|
|
68
|
+
return JSON.stringify({ ok: false, error: "clip.remove() failed: " + e3.toString() });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var clipCountAfter = null;
|
|
72
|
+
try { clipCountAfter = track.clips.numItems; } catch (e4) { clipCountAfter = null; }
|
|
73
|
+
|
|
74
|
+
var verified = clipCountBefore !== null && clipCountAfter !== null && clipCountAfter === clipCountBefore - 1;
|
|
75
|
+
|
|
76
|
+
return JSON.stringify({
|
|
77
|
+
ok: true,
|
|
78
|
+
result: {
|
|
79
|
+
sequenceName: seq.name,
|
|
80
|
+
trackType: args.trackType,
|
|
81
|
+
trackIndex: args.trackIndex,
|
|
82
|
+
clipIndex: args.clipIndex,
|
|
83
|
+
ripple: args.ripple,
|
|
84
|
+
removedClip: before,
|
|
85
|
+
clipCountBefore: clipCountBefore,
|
|
86
|
+
clipCountAfter: clipCountAfter,
|
|
87
|
+
verified: verified
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
} catch (e) {
|
|
91
|
+
return JSON.stringify({ ok: false, error: e.toString() });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// Command: remove-keyframe-range → ppb_removeKeyframeRange
|
|
2
|
+
// Loaded lazily by ppb_dispatch (host/index.jsx) on first use, into the
|
|
3
|
+
// same global ExtendScript context — shared helpers (findSequenceByName,
|
|
4
|
+
// findClipComponent, findComponentProperty, timeValueToSeconds,
|
|
5
|
+
// secondsToTicksString, secondsToTimeObject, ...) are already defined
|
|
6
|
+
// there.
|
|
7
|
+
//
|
|
8
|
+
// Standard-DOM mutation. Ported from leancoderkavy's premiere-pro-mcp
|
|
9
|
+
// `remove_keyframe_range` tool (keyframes.ts), addressed here by
|
|
10
|
+
// trackType/trackIndex/clipIndex + componentName/propertyName.
|
|
11
|
+
// startSeconds/endSeconds are clip-relative, offset by clip.start to
|
|
12
|
+
// sequence time. removeKeyRange(t1, t2) takes two time arguments whose
|
|
13
|
+
// form is disputed per PREMIERE_API_NOTES.md — tries ticksString, then
|
|
14
|
+
// Time objects, then raw seconds numbers for BOTH arguments together (not
|
|
15
|
+
// mixed forms), recording every attempt. Verified via a getKeys() COUNT
|
|
16
|
+
// drop — this is the cleanup path for add-keyframe/add-audio-keyframes
|
|
17
|
+
// mistakes, since undo is non-functional on this build.
|
|
18
|
+
function ppb_removeKeyframeRange(argsJson) {
|
|
19
|
+
try {
|
|
20
|
+
var args;
|
|
21
|
+
try {
|
|
22
|
+
args = JSON.parse(argsJson);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return JSON.stringify({ ok: false, error: "invalid args JSON: " + e.toString() });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (args.trackType !== "video" && args.trackType !== "audio") {
|
|
28
|
+
return JSON.stringify({ ok: false, error: "trackType must be \"video\" or \"audio\"" });
|
|
29
|
+
}
|
|
30
|
+
if (typeof args.trackIndex !== "number" || args.trackIndex < 0 || Math.floor(args.trackIndex) !== args.trackIndex) {
|
|
31
|
+
return JSON.stringify({ ok: false, error: "trackIndex must be a non-negative integer" });
|
|
32
|
+
}
|
|
33
|
+
if (typeof args.clipIndex !== "number" || args.clipIndex < 0 || Math.floor(args.clipIndex) !== args.clipIndex) {
|
|
34
|
+
return JSON.stringify({ ok: false, error: "clipIndex must be a non-negative integer" });
|
|
35
|
+
}
|
|
36
|
+
if (typeof args.componentName !== "string" || !args.componentName) {
|
|
37
|
+
return JSON.stringify({ ok: false, error: "componentName is required" });
|
|
38
|
+
}
|
|
39
|
+
if (typeof args.propertyName !== "string" || !args.propertyName) {
|
|
40
|
+
return JSON.stringify({ ok: false, error: "propertyName is required" });
|
|
41
|
+
}
|
|
42
|
+
if (typeof args.startSeconds !== "number" || typeof args.endSeconds !== "number") {
|
|
43
|
+
return JSON.stringify({ ok: false, error: "startSeconds and endSeconds must both be numbers (clip-relative)" });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!app.project) {
|
|
47
|
+
return JSON.stringify({ ok: false, error: "no project open" });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var seq = null;
|
|
51
|
+
if (args.sequenceName && typeof args.sequenceName === "string") {
|
|
52
|
+
seq = findSequenceByName(args.sequenceName);
|
|
53
|
+
if (!seq) {
|
|
54
|
+
return JSON.stringify({ ok: false, error: "no sequence named \"" + args.sequenceName + "\" is open" });
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
seq = app.project.activeSequence;
|
|
58
|
+
if (!seq) {
|
|
59
|
+
return JSON.stringify({ ok: false, error: "no active sequence, and no sequenceName given" });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var trackCollection = args.trackType === "video" ? seq.videoTracks : seq.audioTracks;
|
|
64
|
+
var numTracks = trackCollection.numTracks;
|
|
65
|
+
if (args.trackIndex >= numTracks) {
|
|
66
|
+
return JSON.stringify({
|
|
67
|
+
ok: false,
|
|
68
|
+
error: "trackIndex " + args.trackIndex + " is out of range — sequence has " + numTracks + " " + args.trackType + " track(s)"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var track = trackCollection[args.trackIndex];
|
|
73
|
+
var numClips = track.clips.numItems;
|
|
74
|
+
if (args.clipIndex >= numClips) {
|
|
75
|
+
return JSON.stringify({
|
|
76
|
+
ok: false,
|
|
77
|
+
error: "clipIndex " + args.clipIndex + " is out of range — track " + args.trackIndex + " has " + numClips + " clip(s)"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var clip = track.clips[args.clipIndex];
|
|
82
|
+
var clipName = null;
|
|
83
|
+
try { clipName = clip.name; } catch (e) { clipName = null; }
|
|
84
|
+
|
|
85
|
+
var clipStartSeconds = 0;
|
|
86
|
+
try { clipStartSeconds = timeValueToSeconds(clip.start) || 0; } catch (e) { clipStartSeconds = 0; }
|
|
87
|
+
|
|
88
|
+
var comp = findClipComponent(clip, [args.componentName], [args.componentName]);
|
|
89
|
+
if (!comp) {
|
|
90
|
+
return JSON.stringify({
|
|
91
|
+
ok: false,
|
|
92
|
+
error: "component \"" + args.componentName + "\" not found on clip (matched against matchName and displayName)"
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
var compDisplayName = null;
|
|
96
|
+
try { compDisplayName = comp.displayName; } catch (e) { compDisplayName = null; }
|
|
97
|
+
|
|
98
|
+
var prop = findComponentProperty(comp, [args.propertyName]);
|
|
99
|
+
if (!prop) {
|
|
100
|
+
return JSON.stringify({
|
|
101
|
+
ok: false,
|
|
102
|
+
error: "property \"" + args.propertyName + "\" not found on component \"" + compDisplayName + "\""
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
var sequenceStartSeconds = clipStartSeconds + args.startSeconds;
|
|
107
|
+
var sequenceEndSeconds = clipStartSeconds + args.endSeconds;
|
|
108
|
+
|
|
109
|
+
var keyCountBefore = 0;
|
|
110
|
+
try {
|
|
111
|
+
var keysBefore = prop.getKeys();
|
|
112
|
+
keyCountBefore = keysBefore ? keysBefore.length : 0;
|
|
113
|
+
} catch (e) {
|
|
114
|
+
keyCountBefore = null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Two-argument sibling of tryTimeForms — both t1/t2 use the SAME form
|
|
118
|
+
// per attempt (not mixed), since removeKeyRange presumably expects
|
|
119
|
+
// matching argument types.
|
|
120
|
+
var removeAttempts = [];
|
|
121
|
+
var removed = false;
|
|
122
|
+
var forms = [
|
|
123
|
+
{ label: "ticksString", t1: secondsToTicksString(sequenceStartSeconds), t2: secondsToTicksString(sequenceEndSeconds) },
|
|
124
|
+
{ label: "TimeObject", t1: secondsToTimeObject(sequenceStartSeconds), t2: secondsToTimeObject(sequenceEndSeconds) },
|
|
125
|
+
{ label: "seconds", t1: sequenceStartSeconds, t2: sequenceEndSeconds }
|
|
126
|
+
];
|
|
127
|
+
for (var f = 0; f < forms.length; f++) {
|
|
128
|
+
try {
|
|
129
|
+
prop.removeKeyRange(forms[f].t1, forms[f].t2);
|
|
130
|
+
removeAttempts.push({ form: forms[f].label, success: true });
|
|
131
|
+
removed = true;
|
|
132
|
+
break;
|
|
133
|
+
} catch (e2) {
|
|
134
|
+
removeAttempts.push({ form: forms[f].label, success: false, error: e2.toString() });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var keyCountAfter = 0;
|
|
139
|
+
try {
|
|
140
|
+
var keysAfter = prop.getKeys();
|
|
141
|
+
keyCountAfter = keysAfter ? keysAfter.length : 0;
|
|
142
|
+
} catch (e3) {
|
|
143
|
+
keyCountAfter = null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var keysRemoved = (keyCountBefore !== null && keyCountAfter !== null) ? (keyCountBefore - keyCountAfter) : null;
|
|
147
|
+
var verified = (keysRemoved !== null && keysRemoved > 0);
|
|
148
|
+
|
|
149
|
+
return JSON.stringify({
|
|
150
|
+
ok: true,
|
|
151
|
+
result: {
|
|
152
|
+
sequenceName: seq.name,
|
|
153
|
+
trackType: args.trackType,
|
|
154
|
+
trackIndex: args.trackIndex,
|
|
155
|
+
clipIndex: args.clipIndex,
|
|
156
|
+
clipName: clipName,
|
|
157
|
+
componentName: compDisplayName,
|
|
158
|
+
propertyName: args.propertyName,
|
|
159
|
+
startSeconds: args.startSeconds,
|
|
160
|
+
endSeconds: args.endSeconds,
|
|
161
|
+
sequenceStartSeconds: sequenceStartSeconds,
|
|
162
|
+
sequenceEndSeconds: sequenceEndSeconds,
|
|
163
|
+
removeAttempts: removeAttempts,
|
|
164
|
+
keyCountBefore: keyCountBefore,
|
|
165
|
+
keyCountAfter: keyCountAfter,
|
|
166
|
+
keysRemoved: keysRemoved,
|
|
167
|
+
verified: verified
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
} catch (e) {
|
|
171
|
+
return JSON.stringify({ ok: false, error: e.toString() });
|
|
172
|
+
}
|
|
173
|
+
}
|