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

[Premiere Pro SDK] add wiggle effect efficiently

Explorer ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

Hello,

I've been trying to make a wiggle effect by scripting just like in AE (example: ([position[0],wiggle(44,22)[1]])) and I've came to this demo:

//gather project/clip/effects properties for this demo
var activeSequence = app.project.activeSequence;
var trackOne = activeSequence.videoTracks[0];//first track for testing

var clip = trackOne.clips[0];//first clip for testing + His time Properties
    var start = clip.inPoint;
    var end = clip.outPoint;
    var duration = end.seconds-start.seconds;
    
var components = clip.components;
var transformComponent = components[2].properties[1];

//Represent how much the clip will Vertically move (increase value to move less)
var range = 80; 
//Represent gap in seconds
var gap = 0.04;
//how many times it needs to repeat
var loopTimes = (duration/gap).toString(); 

//Allow the changes
if (!transformComponent.isTime)  transformComponent.setTimeVarying(true);

for(var i = 1;i < loopTimes;i++){
    var time = new Time();
    time.seconds = gap *i ;
    var diff = (Math.random())/80;
    transformComponent.addKey(start.seconds+time.seconds);
    transformComponent.setValueAtKey(start.seconds+time.seconds,[0.5,0.5+diff],1 ); 
}

image_2021-03-08_160440.pngIt works fine but, as you can see it the screenshot, it is really demanding. for a 18second clip and the desired gap to make the desired look it can take around 30seconds or so (sadly I do not own a i9 & RTX3090). Just imagine for a 30min footage!

 

I tought about a solution in regard the ineficiency. It would be to make the effect for a 2second clip & repeat it multiple times to enhance the speed but I do not see how that could be possible since the projectItem.clone() does not seems in yet (DVAPR-4211779).

 

Any ideas of what alterate solution I could use?

 

thank you very much,

Maxime LP

TOPICS
Editing , Effects and Titles , Performance , SDK

Views

555

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 ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

>I do not see how that could be possible since the projectItem.clone() does not seems in yet (DVAPR-4211779).

I don't understand how sequence cloning is related, to keyframing speed...?

Also, to speed things up, you could re-use a time object, instead of making a new one each time through the loop...

 

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 ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

That would help because instead of creating the Keyframes for example on a 20 seconds clip it would only be 2seconds duplicated 10 times since the loop is the demanding part.

 

Also, I've removed the time object from the loop and, if it helps, it is only by 1second.

 

**does the dev team plan on adding the feature DVAPR-4211779? its seems like its getting nowhere since 1st post was in 2018... Same goes for DVAPR-4224243. I've tried multiples time to contact support and they just say they will contact me and they dont. I have emails where they gave me 3 days to anwser but closed it -8h later and a following chat logs saying a dev senior would contact me a few week back without any comeback..

 

 

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 ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

DVAPR-4211779 seems unlikely to get implemented, before we move from ExtendScript --> UXP. You could instead create a sub-clip of that 2 second region, right?
DVAPR-4224243 may eventually get attention, but there is a workaround; just catch() anything it throws, and it'll work.

 

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 ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

Sub-clips uses rootItems therefore effects should not follow if im not mistaken

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 ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

That could be.

 

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 ,
Mar 13, 2021 Mar 13, 2021

Copy link to clipboard

Copied

LATEST

sorry that is'nt the correct answer. it does not work

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