Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions defining fields

  • defining fields

  • Vojtěch Palme

    April 3, 2021 at 3:47 pm

    I’m making an animation of drawing hand. I have several photos (topLeft, topRight, Middle, bottomLeft..) one after another, each 1s long in a preComp “hand” and right now I have an expression on time_remap of the “hand” set so that when hand’s anchor point is in top left quarter of the main comp, it changes the value of the timeRemap -> and the photo inside of the hand comp. (and the same for other quarters)

    //time remap expressionx=transform.xPosition;y=transform.yPosition;

    if (x>850 && y>550) 3 // bottom right quarter
    else if(x<850 && y>550) 2 // top right quarter
    else if(x<850 && y<550) 0 // top left quarter
    else 1

    Problem is, when the hand’s trajectory crosses the threshold value back and forth too fast, it appears glitchy.
    So I was wondering if there is a way to define fields that, when entered, would change the value. (or any other solution)

  • Vojtěch Palme

    April 3, 2021 at 4:45 pm

    I have thought about it some more and the problem isn’t fields. I can define those using conditions as well. Problem is how to tell the value to remain unchanged after it leaves one area and until it enters another.

  • Dan Ebberts

    April 4, 2021 at 12:00 am

    You need more information than is available by simply looking at the position value. You need the history of where the layer was before it entered the in-between zone. You could use valueAtTime() to walk back, frame-by-frame, from the current time to the most recent time the layer was in one of the fields, and use that value to calculate your current time remapping value.

  • Vojtěch Palme

    April 4, 2021 at 6:43 am

    Thank you, that’s what I was thinking. I’ll try learning more about the method when I get back to computer tomorrow. But expressions aren’t my strong suit. <div>
    </div><div>I’ve already modified the expression to return 0-8 depending on field it’s in. So using this lookAtTime I’m assuming I could have the time remap to look at the value now and compare it to the values 4 frames ago and if one isn’t equal, use it as current time remap value? </div>

Viewing 1 - 4 of 4 posts

Log in to reply.

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