Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Anyone that can assist in revising a script?

  • Anyone that can assist in revising a script?

    Posted by David Cabestany on November 2, 2017 at 3:09 pm

    I’m using the Sequencer script, provided by VideoCopilot for free many years ago.
    While very useful, the script has one mayor flaw in that it takes the layer start point and not the in point in consideration, so when working with trimmed comps used as layers it does not work.

    I tried revising it (code attached at the bottom) by changing startTime to inPoint, and it sort of worked. The layers slide in a somewhat expected way, but one of them gets trimmed to less than one frame and they don’t actually jump in time, but instead the contents get slid inside their own comps.

    screenshot2017-11-02at11.06.15am.png

    Thanks in advance.

    function Sequencer()
    {
    var curComp = app.project.activeItem;
    if (!curComp || !(curComp instanceof CompItem))
    {
    alert("Please select a Composition.");
    return;
    }

    var offsetFrames = parseInt(prompt("Number of frames to offset", "1"));

    for (var layerId = 0; layerId < curComp.selectedLayers.length; layerId++)
    {
    var layer = curComp.selectedLayers[layerId];

    layer.startTime = layerId * offsetFrames * curComp.frameDuration;
    }
    }

    Sequencer();

    David Cabestany replied 8 years, 9 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 2, 2017 at 4:09 pm

    Try it this way:


    function Sequencer()
    {
    var curComp = app.project.activeItem;
    if (!curComp || !(curComp instanceof CompItem))
    {
    alert("Please select a Composition.");
    return;
    }
    var offsetFrames = parseInt(prompt("Number of frames to offset", "1"));
    for (var layerId = 0; layerId < curComp.selectedLayers.length; layerId++)
    {
    var layer = curComp.selectedLayers[layerId];
    layer.startTime = layerId * offsetFrames * curComp.frameDuration - layer.inPoint;
    }
    }
    Sequencer();

    Dan

  • David Cabestany

    November 2, 2017 at 7:53 pm

    Didn’t work Dan.

  • Dan Ebberts

    November 2, 2017 at 9:42 pm

    Ah. Try this:


    function Sequencer()
    {
    var curComp = app.project.activeItem;
    if (!curComp || !(curComp instanceof CompItem))
    {
    alert("Please select a Composition.");
    return;
    }
    var offsetFrames = parseInt(prompt("Number of frames to offset", "1"));
    for (var layerId = 0; layerId < curComp.selectedLayers.length; layerId++)
    {
    var layer = curComp.selectedLayers[layerId];
    layer.startTime = layerId * offsetFrames * curComp.frameDuration - (layer.inPoint-layer.startTime);
    }
    }
    Sequencer();

    Dan

  • David Cabestany

    November 2, 2017 at 10:04 pm

    Yes, this one does the trick.
    Thanks a lot Dan.

    I have compiled a jsx file, so if anyone needs it it’s available here:

    https://f1.creativecow.net/11842/sequencer-for-layer-in-points-script

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