Skip to main content
New Participant
July 31, 2025
Answered

Trouble with setValueAtKey and setInterpolationTypeAtKey for Scale Keyframes in Premiere Pro ExtendS

  • July 31, 2025
  • 1 reply
  • 363 views

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 🙂 

Correct answer Bruce Bullis

This snippet seems to work:

var seq = app.project.activeSequence;
if (seq) {
	var firstVideoTrack = seq.videoTracks[0];
	if (firstVideoTrack) {
		var firstClip = firstVideoTrack.clips[0];
		if (firstClip) {
			var clipComponents = firstClip.components;


			if (clipComponents) {

				var motionComp = clipComponents[1];
				if (motionComp){
					var motionProps = motionComp.properties;
					if (motionProps){
						var scaleProp = motionProps[1];
						if (scaleProp){
							var startingKeys = scaleProp.getKeys();
							
							var startFrame = 0;
							var endFrame = 100;
							var zoomStart = 100;
							var zoomEnd = 120;
							var interp = 5; // 5 = Bezier, 4 = Hold

							var isVarying = scaleProp.isTimeVarying();
							scaleProp.addKey(startFrame);
							scaleProp.setValueAtKey(startFrame, zoomStart);
							scaleProp.setInterpolationTypeAtKey(startFrame, interp, 1);

							// Add end keyframe
							scaleProp.addKey(endFrame);
							scaleProp.setValueAtKey(endFrame, zoomEnd);
							scaleProp.setInterpolationTypeAtKey(endFrame, interp, 1);

							var newKeys = scaleProp.getKeys();
						}
					}	
				}
			}
		}
	}
}

1 reply

Bruce Bullis
Community Manager
Community Manager
July 31, 2025

We'll have a look...

When you say "get the Scale property from the Transform effect", do you mean the Scale property that's part of every trackItem's intrinsic Motion, or do you mean an application of the Transform effect, independent of the intrinsic Scale property?


leo_vdbAuthor
New Participant
August 1, 2025

To be honest, I’ve tried both — the intrinsic Motion > Scale property and the Scale from the applied Transform effect. Neither throws an error, but in both cases, the keyframes just don’t appear. The curve stays flat at the zoomEnd value instead of animating.

Thank you for taking the time to look into this, sir. Much appreciated.

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
August 1, 2025

This snippet seems to work:

var seq = app.project.activeSequence;
if (seq) {
	var firstVideoTrack = seq.videoTracks[0];
	if (firstVideoTrack) {
		var firstClip = firstVideoTrack.clips[0];
		if (firstClip) {
			var clipComponents = firstClip.components;


			if (clipComponents) {

				var motionComp = clipComponents[1];
				if (motionComp){
					var motionProps = motionComp.properties;
					if (motionProps){
						var scaleProp = motionProps[1];
						if (scaleProp){
							var startingKeys = scaleProp.getKeys();
							
							var startFrame = 0;
							var endFrame = 100;
							var zoomStart = 100;
							var zoomEnd = 120;
							var interp = 5; // 5 = Bezier, 4 = Hold

							var isVarying = scaleProp.isTimeVarying();
							scaleProp.addKey(startFrame);
							scaleProp.setValueAtKey(startFrame, zoomStart);
							scaleProp.setInterpolationTypeAtKey(startFrame, interp, 1);

							// Add end keyframe
							scaleProp.addKey(endFrame);
							scaleProp.setValueAtKey(endFrame, zoomEnd);
							scaleProp.setInterpolationTypeAtKey(endFrame, interp, 1);

							var newKeys = scaleProp.getKeys();
						}
					}	
				}
			}
		}
	}
}