ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Anyone that can assist in revising a script?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Cabestany
Anyone that can assist in revising a script?
on Nov 2, 2017 at 3:09: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 &lt; curComp.selectedLayers.length; layerId++)
{
var layer = curComp.selectedLayers[layerId];

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

Sequencer();


Return to posts index

Dan Ebberts
Re: Anyone that can assist in revising a script?
on Nov 2, 2017 at 4:09:57 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



Return to posts index

David Cabestany
Re: Anyone that can assist in revising a script?
on Nov 2, 2017 at 7:53:18 pm

Didn't work Dan.


Return to posts index


Dan Ebberts
Re: Anyone that can assist in revising a script?
on Nov 2, 2017 at 9:42:15 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



Return to posts index

David Cabestany
Re: Anyone that can assist in revising a script?
on Nov 2, 2017 at 10:04:44 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]