Copy link to clipboard
Copied
I have animation about 2 minutes long. It consists of 10 photo frames where each frame shows a simple animation. The camera moves from frame to frame and when the camera focuses on a frame, the animation is played for that frame. Is it possible to start playback of a pre-comp at a certain time in the main comp?
I think you'd just turn on time remapping for the pre-comps and use a simple time remapping expression like this to start the playback at a specific time (at 3 seconds, in this example):
tStart = 3;
time - tStart;
The trick is figuring out how the expression knows it's time to start playback. You could use a layer marker, like this:
if (marker.numKeys > 0){
tStart = marker.key(1).time;
time - tStart;
}else
0;
Copy link to clipboard
Copied
I suggest you read up on time-remapping and all that stuff in the online help if simply staggering the layers doesn't do it. Of course you're still gonna need extra keyframes and also account for the paly time in your camera movement.
Mylenium
Copy link to clipboard
Copied
Just drag the pre-comp forward or backward in the timeline. Pre-comps, or more accurately, nested compositions are just like footage. They have in point, out point, and duration. Where they are in the timeline determines when playback begins.
Copy link to clipboard
Copied
I was a little vague. The first frame should be visible at all times in each photo frame during the animation and then played at a certain time. If I move the animation along the timeline, they are not visible all the time.
Copy link to clipboard
Copied
I think you'd just turn on time remapping for the pre-comps and use a simple time remapping expression like this to start the playback at a specific time (at 3 seconds, in this example):
tStart = 3;
time - tStart;
The trick is figuring out how the expression knows it's time to start playback. You could use a layer marker, like this:
if (marker.numKeys > 0){
tStart = marker.key(1).time;
time - tStart;
}else
0;
Copy link to clipboard
Copied
You are a hero! I put the second code in each pre-comp and a Labelmarker where I want the animation to start playing.
Copy link to clipboard
Copied
Genious, thanks a lot!
Is there a way to start the compostion all over again with a second and third and fourth marker?
Copy link to clipboard
Copied
Try this:
t = 0;
m = marker;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time < m.key(n).time) n--;
if (n > 0){
t = time - m.key(n).time;
}
}
t
Copy link to clipboard
Copied
that works, awesome! Thanks a million :))