Copy link to clipboard
Copied
I am using a script to change the source of my layers and different source files have different lengths.
In the composition I am using an automatic volume fade-in fade-out with the following expression:
if (time< (this_layer.in_point +0.5)) { (1.0 - ((time-this_layer.in_point)/.5)) * [-32.0,-32.0]; }
else if (time> (this_layer.out_point - 0.5)) { ( (time-(this_layer.out_point-.5))/.5) * [-32.0,-32.0]; }
else { [0.0, 0.0] }
g (for a .5 second fade at the beginning and the end of the layer ). However, when I replace the footage with a different one by script, the OutPoint is not updated and therefore the expression doesn't produce the desired fade-out at the end of the layer.
When I reload the project/purge the cache, or close and reopen AE the outPoint is not changed and holds an incorrect value.
ONLY when I grab the end and extend or shorten the layer a couple of frames, the value gets updated correctly and the fade is perfect.
The inPoint, ie the Fade-In works nicely. I've tried other expressions from the forum, same problem.
Could anybody give me a pointer how I can get around this issue?
Thanks in advance.
yp
Copy link to clipboard
Copied
Hi yp
You could use your script to update the outpoint too.
Just use the ".duration" of the item you imported to set the outpoint of the layer in
the composition. Does that make sense?
Cheers
Henrique
Copy link to clipboard
Copied
Hi Henrique,
source.duration worked miracles! Thank you very much for the tip.
cheers,
yp
Copy link to clipboard
Copied
This is still a bug! where .outPoint is not respected.
Copy link to clipboard
Copied
Are you sure it's a bug? I've been using Dan Ebberts expression for years without an issue:
fadetime = 0.2;
st = thisLayer.startTime;
ed = thisLayer.outPoint;
if (time > st+fadetime) {
linear(time,ed-fadetime,ed,100,0);
} else {
linear(time,st,st+fadetime,0,100);
}
Or is it only a bug with scripts?
And these days would Responsive Design - Time solve the problem more elegantly?