Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects velocity

  • Posted by Nicholas Toth on April 4, 2006 at 6:32 pm

    Already set up the rig, just trying to figure out how to calculate the velocity of a solid with a wiggler expression on it.

    I have numbers set to the x and y coordinates, but I can’t figure out how to figure out the velocity at each given moment.

    Colin Braley replied 20 years, 1 month ago 3 Members · 6 Replies
  • 6 Replies
  • Mylenium

    April 4, 2006 at 6:38 pm

    Fortunately AE already does this for you.

    thisLayer.velocity

    Mylenium

    [Pour Myl

  • Nicholas Toth

    April 4, 2006 at 6:46 pm

    Can’t get it to work properly.

    the name of the text layer is VELOCITY and the layer we’re tracking is called PARTICLE.
    I applied a numbers effect to velocity.

    The error that I’m getting is

    Error occured at line 1.
    Comp: ‘particle’
    Layer: 1(“velocity”)
    Property: “value/offset/random max’

  • Mylenium

    April 4, 2006 at 6:55 pm

    Yeah, sorry, my mistake. Just like position and scale, velocity is an array property with two separate components. Anyway, I think you’re just interested in the absolute speed, so thisComp.layer(“PARTICLE”).speed should work. You can attach this value directly to the text layer using concatenation, eleminating the need for the numbers effect:

    “VELOCITY” + thisComp.layer(“PARTICLE”).speed

    You may wanna use rounding, though, otherwise your text layer can get very long. So it could be

    “VELOCITY” + Math.round(thisComp.layer(“PARTICLE”).speed)

    Mylenium

    [Pour Myl

  • Nicholas Toth

    April 4, 2006 at 7:11 pm

    I just jumped into the manual (which is nice that v7 shipped with a manual…) and picked out the speed expression because it is 1D (so they say…)

    I set it up the same exact way thisComp.layer(“Particle”).speed to the source text of an empty text layer and I’m still erroring.
    Do I have to rewrite it along the lines of calculating the particle’s position speed?

    Nevermind, I just did that and it worked. I needed to track the transformation of the position with this:

    thisComp.layer(“Particle”).transform.position.speed

    Thanks Mylenium — I appreciate it.

  • Nicholas Toth

    April 4, 2006 at 7:21 pm

    anyway to insert text BEFORE the expression numbers?

    I was thinking:

    “Velocity = ” thisComp.layer(“Particle”).transform.position.speed

    doesn’t work though.

  • Colin Braley

    April 4, 2006 at 9:42 pm

    I think you just forgot the plus sign (the string concatenation operator if you want to get fancy)

    Try this:

    “Velocity = ” + thisComp.layer(“Particle”).transform.position.speed

    ~Colin

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