Skip to main content
Participating Frequently
April 2, 2019
Answered

How to add effects to clips in Premiere with CEP/ExtendScript?

  • April 2, 2019
  • 3 replies
  • 3395 views

I'm fairly new to CEP and ExtendScript, though a long-time old-school plug-in developer.

Looking at the APIs (http://ppro.aenhancers.com/), I don't see how to add an effect to a clip in Premiere Pro -- how would I do that?

And/or: how can I change the params of the built-in effects, e.g. motion position & scale via the API?

This topic has been closed for replies.
Correct answer Justin Taylor-Hyper Brew

I think adding an effect is only possible through the undocumented QE Dom, but not seeing the method. bbb_999 would know.

But modifying the params of an effect is totally doable with components

( e.g. app.project.activeSequence.videoTracks[0].clips[0].components[0].properties[0] )

3 replies

EWISE_Luuk
Participating Frequently
March 12, 2022

Since I had the same question and the time to figure it out, here are the broad steps and important methods. Watch out: transitions often don't stick to the clip and need to be placed and moved with care. QE dom is not ideal and they can start 'floating' around the timeline if you do a lot of editing afterwards... but still:

 

To get started qe.project.reflect.methods will show you some tools you maybe didn't know you had.

To find out what your effect should be named in the script you can run qe.project.getVideoEffectList and qe.project.getVideoTransitionList  and study this list in console.. Same for audioeffects.

 

When you found your desired effect, remember the name verbatim for use in the script.

To add it to a sequence you will first have to get the sequence using QE Dom. You get a QE sequence object using qe.project.getSequenceAt( i ).  Where i is a number. There can be gaps between the numbers if you deleted and added sequences, so watch out while iterating.There is no nodeId there, so you can only search by sequence name I believe.

 

When you have the correct QEdom sequence, you can get the video/audio track with getVideoTrackAt( i ) and finally your clip on that track with getItemAt( i )

On that QE-trackitem you can finally put your effect using addVideoEffect().   The first argument is the effect itself, you can now use qe.project.getVideoEffectByName() to enter it correctly. The second argument, in case of a transition, will put the transition either at the start (0) or at the end (1).. ,  the third argument's function is unknown to me, be putting another 1 seems to work.. maybe another 1 is needed (I am writing from memory). It should kinda look like this:

 

<<QE trackitem>>  .addVideoEffect(qe.project.getVideoEffectByName("crossfade"),1,1).

 

Good luck poineering!

Luuk

 

 

 

 

 

 

 

Bruce Bullis
Community Manager
Community Manager
April 5, 2019

Justin's right, it's a QE DOM thing for the moment.

Justin Taylor-Hyper Brew
Community Expert
Community Expert
April 4, 2019

I think adding an effect is only possible through the undocumented QE Dom, but not seeing the method. bbb_999 would know.

But modifying the params of an effect is totally doable with components

( e.g. app.project.activeSequence.videoTracks[0].clips[0].components[0].properties[0] )

andrewh92075852
Known Participant
April 4, 2019

Like justintaylor said you can try use app.project.activeSequence.videoTracks[0].clips[0].components[0].properties[0] with setValue(). I was playing around with this yesterday but it seemed quite slow at times. I was trying to set the Blend Mode to Screen. It seemed to change the UI but not change the view/look in the program monitor for a few seconds. Opacity and scale seemed to work. Position seems to only accept values between 0 (left and top edges) and 1 (right and bottom edges).
Components[0] - Opacity   
Properties[0] - Opacity   
Properties[1] - Blend Mode (Title/Label?)   
Properties[2] -  Blend Mode (Value)   
Components[1] - Motion   
Properties[0] - Position [x,y]   
Properties[1] - Scale   
Properties[2] -  Scale Width   
Properties[3] -   
Properties[4] - Rotation   
Properties[5] - Anchor Point   
Properties[6] - Anti Flicker Filter

Justin Taylor-Hyper Brew
Community Expert
Community Expert
April 5, 2019

Haven't tried in a while, but yea I do recall the Effect Panel UI not updating correctly until you clicked away and clicked back. It was sure tricky discovering how to set some of those properties. Only thing I remember not being able to set was enabling/disabling effects.