Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions remembering javascript values in AE7

  • remembering javascript values in AE7

    Posted by Anthony Thomas on December 24, 2006 at 5:04 pm

    I would like to keep an old zRotation value on a wheel (for instance) and compare it to the current zRotation on the wheel. I can then construct an expression to tell me how much vector blur to apply to the wheel while its rotating. In regular javascript I would use a class variable for remembering old values. Is there a construct in AE 7 for doing this.

    TONY T

    Mylenium replied 19 years, 8 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    December 25, 2006 at 7:23 pm

    There’s no construct for saving old values, but you can retrieve old values using valueAtTime(). For example:

    thisComp.layer(“wheel”).transform.zRotation.valueAtTime(time – 2.0); // value from 2 seconds ago

    Dan

  • Anthony Thomas

    December 26, 2006 at 11:04 pm

    Thanks, this should work as well

    TONY T

  • Mylenium

    December 27, 2006 at 3:52 pm

    If you need to store values temporaily, you can also use either expression controls or text layers. The disadvantage in the latter case is of course that you always have a lot of excess baggage for converting variables to strings and back.

    Mylenium

    [Pour Myl

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