Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


add item to the layer at particular time

Participant ,
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

28

Likes

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

Guide , Sep 05, 2021 Sep 05, 2021
Like this:var solidLayer = activeItem.layers.add(item); solidLayer.startTime = t;

Likes

Translate

Translate
Guide ,
Sep 05, 2021 Sep 05, 2021

Copy link to clipboard

Copied

Like this:

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

Likes

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

Copy link to clipboard

Copied

LATEST

Thank you, Dan!

 

Likes

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