feat: preparado teste incremental do gancho com inserção de adjust
- preparado teste incremental do gancho com inserção de adjustment layer na faixa superior - integrado o teste de adjustment layer ao checkbox da montagem incremental do painel Resumo: - 6 arquivos alterados - 2 novos - 4 modificados - 0 removidos 4 files changed, 80 insertions(+) Arquivos: - .jhonny/analises.db - code/cep-plugin/main.js - code/engine/aplicar_montagem_incremental_prototipo.py - code/src/tools/timeline.ts - code/engine/editor/plano_teste_gancho_adjustment.json - code/engine/editor/plano_teste_zooms_plano_6.json
This commit is contained in:
@@ -542,6 +542,58 @@ export function getTimelineTools(bridgeOptions: BridgeOptions) {
|
||||
},
|
||||
},
|
||||
|
||||
insert_adjustment_layer_range: {
|
||||
description:
|
||||
"Insert an existing Adjustment Layer project item on a video track and extend the timeline instance to an exact bounded range.",
|
||||
parameters: {
|
||||
type: "object" as const,
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
item_id: { type: "string", minLength: 1, description: "Project item node ID of an existing Adjustment Layer." },
|
||||
track_index: { type: "integer", minimum: 0, description: "Video track index." },
|
||||
start_seconds: { type: "number", minimum: 0, description: "Exact timeline start in seconds." },
|
||||
end_seconds: { type: "number", minimum: 0, description: "Exact timeline end in seconds." },
|
||||
},
|
||||
required: ["item_id", "track_index", "start_seconds", "end_seconds"],
|
||||
},
|
||||
handler: async (args: { item_id: string; track_index: number; start_seconds: number; end_seconds: number }) => {
|
||||
if (!Number.isFinite(args.start_seconds) || !Number.isFinite(args.end_seconds) || args.end_seconds <= args.start_seconds) {
|
||||
return { success: false, error: "The adjustment-layer range must have finite start/end values and positive duration." };
|
||||
}
|
||||
const script = buildToolScript(`
|
||||
var seq = app.project.activeSequence;
|
||||
if (!seq) return __error("No active sequence");
|
||||
var item = __findProjectItem("${escapeForExtendScript(args.item_id)}");
|
||||
if (!item) return __error("Adjustment Layer project item not found");
|
||||
var track = seq.videoTracks[${args.track_index}];
|
||||
if (!track) return __error("Video track not found: ${args.track_index}");
|
||||
var startTicks = __secondsToTicks(${args.start_seconds}).toString();
|
||||
var endTicks = __secondsToTicks(${args.end_seconds}).toString();
|
||||
var beforeIds = {};
|
||||
for (var b = 0; b < track.clips.numItems; b++) beforeIds[String(track.clips[b].nodeId)] = true;
|
||||
seq.insertClip(item, startTicks, ${args.track_index}, 0);
|
||||
var inserted = null;
|
||||
for (var i = 0; i < track.clips.numItems; i++) {
|
||||
var candidate = track.clips[i];
|
||||
if (!beforeIds[String(candidate.nodeId)] && Math.abs(parseFloat(candidate.start.ticks) - parseFloat(startTicks)) < 1) { inserted = candidate; break; }
|
||||
}
|
||||
if (!inserted) return __error("Premiere inserted the Adjustment Layer but it could not be identified");
|
||||
try { inserted.end = endTicks; } catch (e) { return __error("Could not extend the Adjustment Layer to the requested end: " + e.toString()); }
|
||||
var actualStart = __ticksToSeconds(inserted.start.ticks);
|
||||
var actualEnd = __ticksToSeconds(inserted.end.ticks);
|
||||
var frameTicks = seq.timebase ? parseFloat(seq.timebase) : TICKS_PER_SECOND / 24;
|
||||
var tolerance = __ticksToSeconds(frameTicks);
|
||||
if (Math.abs(actualStart - ${args.start_seconds}) > tolerance || Math.abs(actualEnd - ${args.end_seconds}) > tolerance) {
|
||||
return __error("Adjustment Layer range read back as " + actualStart + "-" + actualEnd + "s, not the requested range");
|
||||
}
|
||||
var isAdjustment = false;
|
||||
try { isAdjustment = inserted.isAdjustmentLayer(); } catch (eCheck) {}
|
||||
return __result({ inserted: true, verified: true, nodeId: String(inserted.nodeId), trackIndex: ${args.track_index}, startSeconds: actualStart, endSeconds: actualEnd, isAdjustmentLayer: isAdjustment });
|
||||
`);
|
||||
return sendCommand(script, bridgeOptions);
|
||||
},
|
||||
},
|
||||
|
||||
move_clip: {
|
||||
description: "Move a clip to a new position on the timeline",
|
||||
parameters: {
|
||||
|
||||
Reference in New Issue
Block a user