Trouble with setValueAtKey and setInterpolationTypeAtKey for Scale Keyframes in Premiere Pro ExtendS
Hi everyone, I’m trying to automate the creation of keyframes for the “Scale” property of a clip using ExtendScript in Premiere Pro. I want to set two keyframes (start and end), assign them values, and set their interpolation to Bezier (or Hold, depending on the case). Here’s the relevant part of my code:
var scaleProperty = /* ... get the Scale property from the Transform effect ... */;
var startFrame = 0;
var endFrame = 100;
var zoomStart = 100;
var zoomEnd = 120;
var interp = 5; // 5 = Bezier, 4 = Hold
scaleProperty.setTimeVarying(true);
// Remove existing keyframes
if (scaleProperty.numKeys && scaleProperty.numKeys > 0) {
while (scaleProperty.numKeys > 0) {
scaleProperty.removeKey(0);
}
}
// Add start keyframe
scaleProperty.addKey(startFrame);
scaleProperty.setValueAtKey(startFrame, zoomStart);
scaleProperty.setInterpolationTypeAtKey(startFrame, interp, 1);
// Add end keyframe
scaleProperty.addKey(endFrame);
scaleProperty.setValueAtKey(endFrame, zoomEnd);
scaleProperty.setInterpolationTypeAtKey(endFrame, interp, 1);
My problem:
The stopwatch icon turns blue (so time-varying is enabled), but I don’t see any keyframe points on the curve.
The Scale curve stays flat at the zoomEnd value (e.g., 120 here in the example), instead of animating between the two values.
No error is thrown, but the keyframes just don’t appear or animate as expected.
Thank you for your help ! Have a nice day 🙂
