Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions [HELP] Script – Sequence Layers based on the bottom (or TOP) selected layer’s

  • [HELP] Script – Sequence Layers based on the bottom (or TOP) selected layer’s

    Posted by Vincenzo Imbimbo on December 28, 2021 at 11:24 pm

    Hi, i’m trying to create a Script to sequence the layers and so far so good but i have a problem and it is that the layers get sequenced based on my CTI (Current Time Indicator – Playhead), and that’s NOT what i want, i want the layers to be sequenced based on the start of the BOTTOM layer if it’s going to be like an stairs going up, or based on the start of the TOP layer if it’s going to be like an stairs going down, anyone can help me?, here is the code:

     

    this.sequence = function (pal)

    {

    try

    {

    var comp = app.project.activeItem;

    var err = this.selErr;
    if (this.checkActiveItem(comp)) throw(err);

    var selLayers = comp.selectedLayers.reverse();

    if (selLayers.length < 1) throw(err);

    var offset = parseFloat(pal.gr.gr2.framesEt.text) * comp.frameDuration;

    app.beginUndoGroup(this.scriptTitle);

    for (var i = 0; i < selLayers.length; i++)

    {

    selLayers[i].startTime = comp.time + i * offset;

    }
    app.endUndoGroup();

    }

    catch(err)

    {

    utils.throwErr(err);

    }

    };

    this.run = function (thisObj)
    {
    this.buildUI(thisObj);

    };

    }

    Vincenzo Imbimbo replied 4 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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