Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Finding the time when a prop reaches a specific value

  • Dan Ebberts

    June 2, 2017 at 12:55 pm

    There are a number of ways to approach it, all of which are messy and involve a frame-by-frame search. The best solution depends on whether you need the first occurrence, the most recent occurrence, or all occurrences, and whether the value will be coming from above the target value, below the target value, or either.

    Dan

  • Roland R. kahlenberg

    June 2, 2017 at 1:08 pm

    But Dan, we mostly love only messy stuff. ☺

    I think based on all occurrences and from both above or below (the value) will provide an ideal/robust solution. I feel that the robustness of the solution will more than make up for the slow compute times of the Expressions.

    Cheers
    – Roland

    TypeGEMs – the Definitive Type Gizmo for AE
    https://broadcastgems.com/typegems/

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations
    Adobe After Effects CC ACE/ACI
    Imagineer Systems (mocha) Certified Instructor

    https://www.broadcastgems.com/mographintensity_shapestext/

  • Dan Ebberts

    June 2, 2017 at 1:24 pm

    Ugh. So what would the result look like?

    Dan

  • Roland R. kahlenberg

    June 2, 2017 at 1:53 pm

    This is what I have now. It’s of course incomplete.
    I want a layer to inherit specific colors based on the value of a rotation prop. I don’t want the color values to pop (change immediately) but instead to have a slow change of the colors. Hence, I thought I would use the Interpolation Method.

    targetProp = thisComp.layer(“Hand”).transform.rotation;
    targetVal1 = linear(time,0,1,effect(“Color Control”)(“Color”),effect(“Color Control 2”)(“Color”));
    targetVal2 = linear(time,0,1,effect(“Color Control 2”)(“Color”),effect(“Color Control 3”)(“Color”));
    targetVal3 = linear(time,0,1,effect(“Color Control 3”)(“Color”),effect(“Color Control 4”)(“Color”));

    if (targetProp >=0 && targetProp<1001)
    { targetVal1 }
    else if (targetProp >= 1001 && targetProp<2001)
    { targetVal2 }
    else if(targetProp< 0)
    { targetVal3 }
    else {effect(“Color Control 4”)(“Color”)}

    Sense make?

    TypeGEMs – the Definitive Type Gizmo for AE
    https://broadcastgems.com/typegems/

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations
    Adobe After Effects CC ACE/ACI
    Imagineer Systems (mocha) Certified Instructor

    https://www.broadcastgems.com/mographintensity_shapestext/

  • Dan Ebberts

    June 2, 2017 at 4:12 pm

    Wouldn’t something like this work?


    targetProp = thisComp.layer("Hand").transform.rotation;
    c1 = effect("Color Control")("Color");
    c2 = effect("Color Control 2")("Color");
    c3 = effect("Color Control 3")("Color");
    c4 = effect("Color Control 4")("Color");

    if (targetProp < 50)
    ease(targetProp,-50,50,c1,c2)
    else if (targetProp < 1050)
    ease(targetProp,950,1050,c2,c3)
    else
    ease(targetProp,1950,2050,c3,c4);

    Dan

  • Roland R. kahlenberg

    June 2, 2017 at 6:20 pm

    HAH!!!
    I knew my problem solving was a major issue. I’ve not written Expressions for a while – and it shows.

    Thanks Dan!

    TypeGEMs – the Definitive Type Gizmo for AE
    https://broadcastgems.com/typegems/

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations
    Adobe After Effects CC ACE/ACI
    Imagineer Systems (mocha) Certified Instructor

    https://www.broadcastgems.com/mographintensity_shapestext/

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