FORUMS: list search recent posts

Trigger a sequence by camera position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bopi bopi
Trigger a sequence by camera position
on Jun 29, 2014 at 5:21:50 pm

Hello,

I want to make an effect but i can't find how to do it properly.

To simplify, i want to fly over the map of the Paris metro (subway-underground), and when the camera is less than a certain distance value, i want to start an animation sequence that displays the name of the station.

I think that i must use expressions and conditions but i don't see how. I have over 200 stations, i want the solution could be automatic/scripted when I'm follow a subway line path.

Ideas?

Thank you for your help

Sorry, i'm french :)


Return to posts index

Dan Ebberts
Re: Trigger a sequence by camera position
on Jun 29, 2014 at 8:55:56 pm

You could apply something like this to each station animation (set triggerDist as necessary):


triggerDist = 200.0;

C = thisComp.layer("Camera 1").transform.position;

below = false;
frame = timeToFrames(time);
while (frame >= 0){
t = framesToTime(frame);
d = length(C.valueAtTime(t),position.valueAtTime(t))
if (below){
if (d >= triggerDist){
frame++;
break;
}
}else if (d < triggerDist){
below = true;
}
frame--;
}
t = below ? time - framesToTime(frame) : 0;
valueAtTime(t);


If it's a time-remapped animation, you can eliminate the last line.


Dan



Return to posts index

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