FORUMS: list search recent posts

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

FAQ   •   VIEW ALL QUESTION: how to affect shape layer skew value based on the velocity & direction of position property on Apr 11, 2017 at 2:33:35 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.

Thanks,
John Re: QUESTION: how to affect shape layer skew value based on the velocity & direction of position propertyon Apr 12, 2017 at 1:39:50 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; 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. Re: QUESTION: how to affect shape layer skew value based on the velocity & direction of position propertyon Apr 13, 2017 at 9:43:38 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;
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;
}else
n;