Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects QUESTION: how to affect shape layer skew value based on the velocity & direction of position property

  • QUESTION: how to affect shape layer skew value based on the velocity & direction of position property

    Posted by John Gardner on April 11, 2017 at 2:33 pm

    Hi,

    Long-time lurker. I have looked around for a solution to this question but I have not found anything, hence this post.

    Anybody know of a good expression that will take the position property info of a shape layer and have those values affect its skew property values?
    Basically looking for a simple squash & stretch effect, but using the skew property. So when a shape layer moves from A to B, the skew value will increase so that it appears to stretch a little, then once at location B, the skew will resolve back to 0.

    I researched Dan’s scripts, but I only found his squash/stretch script for the scale property.

    Any advice would be appreciated!

    Thanks,
    John

    John Gardner replied 9 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • John Cuevas

    April 12, 2017 at 1:39 pm

    You would want to use one of the ease expressions applied to the “Skew” property of Distort Transform effect. Something like this:

    myVel = transform.position.velocity[0];
    linear(myVel,0,500, 0, -18)

    Here’s a simple little project I made demonstrating the technique.
    11234_skew.aep.zip

    Johnny Cuevas, Editor
    ThinkCK

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • John Gardner

    April 12, 2017 at 3:55 pm

    Thanks, John!

  • John Gardner

    April 13, 2017 at 9:43 pm

    Hi John,

    In case you need additional reference… I hacked together this solution as well… My apologies for not providing credits, as I pulled info from many people, so its a bit like making Frankenstein…

    Anyway, I would like to figure out how to add in some anticipation to the Skew value, just before the 1st key frame, so the shape layer sort of flexes before it moves.

    Place the following expression at: Shape layer > Content > Transform > Skew

    freq = 5;
    decay = 5;
    p=transform.position;
    x=transform.position[0];
    n = 0;

    if (p.numKeys > 0){
    n =p.nearestKey(time).index;
    if (p.key(n).time > time) n–;
    }
    if (n > 0){
    t = time – p.key(n).time;
    amp = p.velocityAtTime(p.key(n).time – .001);
    w = freq*Math.PI*2;
    result = amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
    x=result[0];
    }else
    n;

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