Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects stop expression and continue manually

  • stop expression and continue manually

    Posted by Susan Lan on August 19, 2015 at 3:56 pm

    I have a ligth linked to the camera move, and in some part, I want to stop the ligth following the posiution of the camera, and I want to move the ligth manually, with keyframes.

    I create a Null and put a “checbox control” and when it is ON the expression is on, and when the checbox is off the expression of the ligth linked to the camera, stops.

    I use this code for stop the expression (that the ligth is linked to the camera), but I don’t know how to add it in the second expression of the code (or anywhere) that when the expression stops, I want to continue moving the position manually, and I don’t want to write a second expression to ejecute when the first expression stops

    control = thisComp.layer("Null 1").effect("Checkbox Control")("Checkbox") ;

    if (control == 1)
    {
    thisComp.layer("Camera 1").transform.position;
    }
    else
    {
    [here how to tell I want move manuaklly without expression?];
    }

    Susan Lan replied 10 years, 8 months ago 2 Members · 6 Replies
  • 6 Replies
  • Walter Soyka

    August 19, 2015 at 4:01 pm

    I would approach this problem differently.

    I’d make the camera the parent of the light. Now, any animation you do will be relative to the camera.

    If you need to break that relationship, split the layer at the point where you want the light to be completely independent and remove the parenting on the new layer only.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Susan Lan

    August 19, 2015 at 4:11 pm

    I can’t linked the camera to the ligth, I only can linked the ligt (I mean, the null that is linked to the ligth) to the camera, because I have already donde the animatiom move of the position and rotation of the camera, and there are more elements effected but the animation of the camera, I simply can not deleted the camere movement…

    I linked the null of the ligth to the camera position and rotation because “among” the this that are animated, I want to create the sensation that the camera is pursuing the movement of the ligth

    First the camera is pursuing the ligth (which does the same movement but with offset) and in one point the camesa stops, and the ligth goes (manually with keyframes) to the inside of a flower, while the camera still stopped look at it

    Can you have any other idea please…?

  • Walter Soyka

    August 19, 2015 at 4:31 pm

    Got it.

    We need to do two things:
    1) Stop looking at the changing values at a specific time
    2) Allow additional keyframe animation

    offset = -.5;
    p = thisComp.layer("My Animated Layer");
    t = Math.min(time + offset,10); // stop following after 10 seconds
    value + p.rotation.valueAtTime(t);

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Susan Lan

    August 22, 2015 at 3:37 pm

    Thanks,
    “Math.min” means = “stop at this time”?

  • Walter Soyka

    August 24, 2015 at 12:46 pm

    [Susan Lan] “”Math.min” means = “stop at this time”?”

    No, Math.min takes multiple arguments (inputs) and returns (outputs) the smallest of them.

    This code:
    t = Math.min(time + offset,10); // stop following after 10 seconds
    … says “Let t equal time-plus-offset, or let t equal 10, whichever is smaller.

    So why does this stop at a given time? The next line of the expression:
    value + p.rotation.valueAtTime(t);
    … says, “Return the current value plus whatever the value of p.rotation was at time t. Since we’ve established a ceiling value for t (it can never be bigger than the constant 10 in the code above), we’ll never look beyond the value at time 10 in this expression.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Susan Lan

    August 26, 2015 at 9:22 am

    Thanks Walter! For all!

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