AE常用表达式,简单又好用。-PS/AI/AE教程-素材在线-灵犀素材库keepling-灵犀素材库keepling为大家提供网站模板、图片素材、脚本代码、办公素材、Adobe软件下载、Adobe插件、网页特效等资源建站服务。

您现在的位置是:首页>设计教程>PS/AI/AE教程

设计教程

AE常用表达式,简单又好用。

超级管理员2024-01-24本站1493
AE 表达式1.随机抖动wiggle(2,30)2.万能弹性freq = 3;decay = 5;n = 0;if (numKeys > 0){n = nearestKey(time).index;if (key(n).time > time) n--;}if (n > 0){t = time - key(n).time;amp = velocityAtTime(key(n).time - .001);w = f

AE 表达式

1. 随机抖动

wiggle(2,30)

2. 万能弹性

freq = 3;

decay = 5;

n = 0;

if (numKeys > 0){

  n = nearestKey(time).index;

  if (key(n).time > time) n--;

}

if (n > 0){

  t = time - key(n).time;

  amp = velocityAtTime(key(n).time - .001);

  w = freq*Math.PI*2;

  value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);

}else

  value

 

3. 挤压拉伸

spd =20;maxDev =10;

decay = 1;

t = time - inPoint;

offset = maxDev*Math.sin(t*spd)/Math.exp(t*decay);

scaleX = scale[0] + offset;scaleY = scale[1] - offset;

[scaleX,scaleY]

4. 循环运动

loopOut(type = "cycle", numKeyframes = 0)

 

5. 无限旋转

time*360

6. 小球回弹

e =0.7;//弹力

g =1000;//重力

nMax = 9;//最大弹跳次数

n = 0;

if (numKeys > 0){

n = nearestKey(time).index;

if (key(n).time > time) n--;

}

if (n > 0){

t = time - key(n).time;

v = -velocityAtTime(key(n).time - .001)*e;

vl = length(v);

if (value instanceof Array){

vu = (vl > 0) ? normalize(v) : [0,0,0];

}else{

vu = (v < 0) ? -1 : 1;

}

tCur = 0;

segDur = 2*vl/g;

tNext = segDur;

nb = 1; // number of bounces

while (tNext < t && nb <= nMax){

vl *= e;

segDur *= e;

tCur = tNext;

tNext += segDur;

nb++

}

if(nb <= nMax){

delta = t - tCur;

value +  vu*delta*(vl - g*delta/2);

}else{

value

}

}else  

value

7. 路径循环

valueAtTime(time%key(numKeys).time)

8. 双向循环

loopOut(type = "pingPong", numKeyframes = 0);

9. 随机循环

freq = 3; // 频率

amp = 100; // 幅度

loopTime =3; // 循环时间,单位为秒

t = time % loopTime;

wiggle1 = wiggle(freq, amp, 1, 0.5, t);

wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);

linear(t, 0, loopTime, wiggle1, wiggle2)