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?
Copy link to clipboard
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.clips.components.properties )
Like justintaylor said you can try use app.project.activeSequence.videoTracks.clips.components.properties 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 - Opacity
Properties - Opacity
Properties - Blend Mode (Title/Label?)
Properties - Blend Mode (Value)
Components - Motion
Properties - Position [x,y]
Properties - Scale
Properties - Scale Width
Properties - Rotation
Properties - Anchor Point
Properties - Anti Flicker Filter
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.
Justin's right, it's a QE DOM thing for the moment.
Copy link to clipboard
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!