Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Set Comp Start Time to Layer Start Time

  • Set Comp Start Time to Layer Start Time

    Posted by Ben Insler on January 19, 2015 at 10:31 pm

    For the life of me I cannot get my script to read/assign start times to an item – keeps returning “Undefined”. I’d like to read the start time from video item, and then set a comp’s start time to that same video item’s start time.

    I’d like to do something like this (keep in mind it’s pseudocode):

    Assuming first item in project is a video item and second item in project is a comp item.

    var myComp = app.project.item(1);
    var myVideo = app.project.item(2);
    var timeToSet = myVideo.startTime;
    myComp.startTime.setValue(timeToSet);

    Anyone out there have any clue on how to make this happen, or any thoughts that can push me forward? Thanks!

    Murat Atasoy replied 10 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 20, 2015 at 12:01 am

    Items don’t have a startTime–only layers have that attribute. Comps have a displayStartTime, but I don’t know if that gets you where you want to be. It seems like you would need access to what shows up in the Media Start column in the project panel, but as far as I know, scripting doesn’t have access to that.

    Dan

  • Murat Atasoy

    March 12, 2016 at 10:44 pm

    in this example you can see the

    var compone = curComp.layer(1);
    var comptwo = curComp.layer(2);
    comptwo.startTime = compone.outPoint;

    layer’s has startTime and outPoint. outPoint is endtime of layer.
    You make your first item(myComp)’s start time as timeToSet on your code.

    You should use startTime = 10; instead of startTime.setValue() function.

    You can find detailed informations about layers on ADOBE® AFTER EFFECTS® CS6 SCRIPTING GUIDEpdf page 86.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy