• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Premiere Pro scripting keyframe interpolation

Community Beginner ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

Hi to all.
I'm struggling with adding keyframe interpolation in PP.

here is simplyfied code below, I want to interpolate a keyfreme, there are several types of interpolation, but I can't make it work with any of them.

var position = app.project.activeSequence.getSelection()[1].components[1].properties[0];
var currentTime = app.project.activeSequence.getPlayerPosition();
position.setTimeVarying(true);
position.addKey(currentTime);
position.setValueAtKey(currentTime, [0.5,0.5]);
position.setInterpolationTypeAtKey(currentTime, kfInterpMode_Bezier,1);

this script adding a keyframe but at last line it gives me an error.
HELP!!!

TOPICS
SDK

Views

540

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jan 02, 2024 Jan 02, 2024

Thank you, Brusce, that helped.
Here is code which gave me eased key:

var position = app.project.activeSequence.getSelection()[0].components[1].properties[0];
var currentTime = app.project.activeSequence.getPlayerPosition();
position.setTimeVarying(true);
position.addKey(currentTime);
position.setValueAtKey(currentTime, [0.5,0.5]);
var interpol = 5;
position.setInterpolationTypeAtKey(currentTime, interpol,1);


Also if I set var interpol = 4; it give me hold keyframe.
interpolation 1, 2, 3, marked as

...

Votes

Translate

Translate
Adobe Employee ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

Probably a documentation bug. [Mea culpa.]

In the PProPanel sample, I see:

var KF_Interp_Mode_Bezier = 5;
Try passing '5' instead of "kfInterpMode_Bezier".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

Thank you, Brusce, that helped.
Here is code which gave me eased key:

var position = app.project.activeSequence.getSelection()[0].components[1].properties[0];
var currentTime = app.project.activeSequence.getPlayerPosition();
position.setTimeVarying(true);
position.addKey(currentTime);
position.setValueAtKey(currentTime, [0.5,0.5]);
var interpol = 5;
position.setInterpolationTypeAtKey(currentTime, interpol,1);


Also if I set var interpol = 4; it give me hold keyframe.
interpolation 1, 2, 3, marked as obsolete didn't work for me.

MrDruz_0-1704220781950.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

Here are valid values, defined in PProPanel (I also cheated, and looked at our source; these are used):

kf.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

Amazing, thank you!
Can you tell what #6 (time mode) is doing? When I tried it, my PP crashed)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

6 = Auto crash mode? 😉 

I'll have a look...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 28, 2025 Jan 28, 2025

Copy link to clipboard

Copied

Hey @Bruce Bullis ! Just following up here. Is there a way to provide a custom bezier curve instead of just setting the interp mode?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 28, 2025 Jan 28, 2025

Copy link to clipboard

Copied

LATEST

No.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines