ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Trigger composition to play from inpoint

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mackie john
Trigger composition to play from inpoint
on Feb 10, 2019 at 10:07:23 am

I have a have composition which has some text layers with animations (like opacity, position etc.). This comp has an opening (beginning of comp) and a closing (end of comp). The comp is 30sec long. But I might need to play the closing sometimes at 15sec's, depending on the counter I will be using. What I have done so far:

1. Split this comp in two comp's.
2. Using the following expression on comp1 on the opacity so it bring's it down to 0% while the counter it's 0: (opening)

clockStart = parseInt(comp("main").layer(5).text.sourceText.value);

clockTime = clockStart-1*(time-inPoint);
if (clockTime < 0) doWork = -clockTime;
else doWork = 0;
valueAtTime(doWork+key(1).time)


3. On the duplicate comp (closure comp), I change the inpoint to where the closure begins, and use the same above script to bring the opacity from 0%to100%.

So far so good, but now my next step is to trigger the playback from the inpoint of the closure comp. So I can see the closure animation. As in point 3 I did a keyframe on the inpoint on the closure comp and used expression in point 2. But this only helps turn on the opacity for the composition and doesnt trigger the closure composition to play. Which property should I use (with keyframe) to trigger the playback from the inpoint of the closure composition.


Return to posts index

Mackie john
Re: Trigger composition to play from inpoint
on Feb 10, 2019 at 4:58:06 pm

Here is some updates:

I tried using linear with the script as follows:

clockStart = parseInt(comp("main").layer(5).text.sourceText.value);
clockTime = clockStart-1*(time);

sIn = key(2).time - key(1).time;
sOut = key(4).time - key(3).time;

if (time < clockStart)
linear(time,sIn,key(2).time,key(1).value,key(2).value)
else if (time >clockStart)
{
linear(time,key(3).time,sOut,key(3).value,key(4).value);
}>


I'm using this on the time remap propertery with 4 keyframes. One issue I have here is, if I change the clockStart to some value 14 seconds for example, I need to adjust the keyframe4 manually to get the fadeout properly on the closure, otherwise it does a cut.

Any Other solution to this problem please.


Return to posts index

Mackie john
Re: Trigger composition to play from inpoint
on Feb 12, 2019 at 7:05:05 am

Any updatew on this pls. DAN or someone can help me with this as i have reached a wall on this after multiple tries. Thanks in advance


Return to posts index


Mackie john
Re: Trigger composition to play from inpoint
on Feb 12, 2019 at 8:21:49 am

I have tried one of Dan's expressions as below:

newDuration = effect("Slider Control")("Slider");
t = linear(time,0,newDuration,0,key(numKeys).time);
valueAtTime(t);


Modified it as follows:

clockStart = parseInt(comp("main").layer(5).text.sourceText.value);

t = linear(time,0,clockStart+1,0,key(1).value+time);
valueAtTime(t);


This seems to be working as what I want on the Time Remap property. It plays the keyframe and continues playing it. But the layer goes black. I can't seem to see any output. If I remove the expression the layer works fine. And the time remap keyframe works exactly as I want.

This expression holds onto 14secs, which is the first keyframe value. Then when it hits's clockStart, it continues to play from 14secs. But the output is black. What ami doing wrong here ?


Return to posts index

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