Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions wow! expressions are fun. so, another question…

  • wow! expressions are fun. so, another question…

    Posted by Michael Johnson on May 4, 2005 at 5:42 pm

    i have entered into a whole new world when i started playing with expressions. i’d always been a bit afraid of doing anything other than pickwhipping stuff, but now… i see all i could do, i’m just having trouble figuring it out. to those that helped me yesterday, my thanks. so:

    i’m in the same comp. 10 pics distributed in a circle, so we have a 10-sided room, so to speak. i have a light mapped/parented to each of the pics, in a wider circle, so its shining on the outside of our “room”. the camera starts off outside and tracks around it 180 dedgrees. basically following the wall. what i’d like or the lights to do is fade up as the camera approaches each one, and fade out as it goes away. my camera is attached to a null that rotates on its y axis. so i tried linking the intensity of a light to the rotationY of the null. but that doesn’t quite do it. i did some searches and found the distance to camera expressions. but how do i actually know the real position of my camera? i think i may have gotten in over my head. but i don’t want to animate every light when i know that there has to be a way to do this with expressions.

    anyone?

    thanks,
    mike

    Michael Johnson replied 21 years ago 2 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    May 4, 2005 at 6:18 pm

    To get the position of the camera, you’d need to use something like this:

    thisComp.activeCamera.toWorld([0,0,0])

    But I would think your first approach is easier. What did you try that didn’t work?

    Dan

  • Michael Johnson

    May 4, 2005 at 6:34 pm

    by “first way” do you mean linking the intensity to the y rotation of the null? if so:

    when i linked to the null, i made this expression on the intensity of one (of 10) light:

    [linear(thisComp.layer(“Null for Camera”).rotationY,90,-108,0,30)]

    this got the light to fade up as the camera/null swung around from 90 to -108 degrees. and thats fine for the one picture. but for the other pics, the camera hits them straight on a dif?ferent points in the nulls rotation. the total move is still 90 to -108. am i making any sense here? i basically want the effect of a spotlight moving dead on with the camera. so the lights will fade up on their respective pictures, reaching full as the camera gets to them, and then fading ut as the camera moves away……

    i’ll be glad to give more detail, but i’m not sure how to explain it.
    mike

  • Dan Ebberts

    May 4, 2005 at 6:50 pm

    There has to be a relationship between the layer index of the lights and the rotation of the null (it will make things easier if you can make the lights layers 1-10). So you just need to define that relationsip (eg, the camera lines up with Light 1 at layer index 1 when the null rotation is at ?? degrees, etc). Then we just need to know how far (in degrees) on either side of dead center you want the light to begin coming on and we can whip out an expression for it.

    Dan

  • Dan Ebberts

    May 4, 2005 at 6:52 pm

    Have you considered just parenting an arc of lights to the camera, with the outside ones dimmer than the ones nearer the camera?

    Dan

  • Michael Johnson

    May 4, 2005 at 7:10 pm

    i could do it that way. not quite what i want (lights fading up), but it could do the trick. but it’s more that i want real world reasons to learn expressions… if that makes sense.

    so, per your prior post:

    i’m not sure what you mean by indexes, but

    camera lines up with light 1 when null is at 72.2 degrees
    light 2 at 35.9
    light 3 at .2
    light 4 at -36.1
    light 5 at -71.7

    those are all of them. the camera is inside the room for the rest of the y rotation.
    thanks dan.

  • Dan Ebberts

    May 4, 2005 at 8:05 pm

    Here’s a rough attempt, based on the info you’ve provided:

    lightNumber = index;
    range = 30;

    center = 72 – (lightNumber – 1)*36
    angle = thisComp.layer(“Null for Camera”).rotationY;
    on = ease(angle,center + range,center,0,100);
    off = ease(angle,center,center – range,100,0);
    Math.min(on,off);

    The first line is where you need to establish a relationship between the light number and it’s layer index. As written, it will work if Light 1 is Layer 1 (top of the layer stack). If not, you’ll have to do a different calculation. Since you didn’t specify, I set the range of turn on/turn off to be +/- 30 degrees. I simplified by using 36 degrees as the angle between lights.

    Dan

  • Michael Johnson

    May 4, 2005 at 9:37 pm

    awesome. i’m pretty sure i understand how that works. i’ll be trying this out first thing in the morning. thanks very much!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy