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

add item to the layer at particular time

Contributor ,
Sep 05, 2021 Sep 05, 2021

Copy link to clipboard

Copied

Dear ae fellows,

I'm writing a simple script which imports a png sequence into the composition and adds it to the layers at a particular time (for example at the time where a time slider on a time track is positioned at the moment).

 

Is there a way to insert an item at a particulat time?

Right now, I'm only able to insert my sequence at t = 0

So far my code looks as follows

 

// ******** importing a sequence  into project**********************

var importOptions = new ImportOptions();
importOptions.file = new File(file);  // file is the first file in my png sequence
importOptions.sequence = true;
importOptions.forceAlphabetical = false;
var item = app.project.importFile(importOptions);

// ******** end of importing a sequence  into project**********************

 

var activeItem = app.project.activeItem;

//******** position of a time slider****************************

time = app.project.activeItem.time;

 

//************** here I add png sequence at time t = 0.
var solidLayer = activeItem.layers.add(item);

 

How would I add it at  t= time ?

Yaroslav.

TOPICS
Expressions , Scripting

Views

157

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 Expert , Sep 05, 2021 Sep 05, 2021

Like this:

var solidLayer = activeItem.layers.add(item);
solidLayer.startTime = t;

Votes

Translate

Translate
Community Expert ,
Sep 05, 2021 Sep 05, 2021

Copy link to clipboard

Copied

Like this:

var solidLayer = activeItem.layers.add(item);
solidLayer.startTime = t;

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
Contributor ,
Sep 05, 2021 Sep 05, 2021

Copy link to clipboard

Copied

LATEST

Thank you, Dan!

 

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