
1弹性动画
amp = .1;
freq = 5;
decay = 7;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
2旋转不停
s=0.05;360*time*s;
3循环
loopOut(type = "pingpong", numKeyframes = 0)

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


loopOut("offset")

4时钟旋转


//秒针
time*720
//分针
thisComp.layer("秒针").transform.rotation/12
5index

//连续复制n次,得到n+1个图层,由于每个图层的index不同,旋转角度也不同
(index-1)*30;
6参数
value
//即[不加表达式情况下]当前该属性的值
-----------
wiggle(freq, amp)
//摆动函数,第一个参数freq指的是摆动的频率,第二个参数amp指的是摆动的幅度。
-----------
random()
//随机函数,通过调用random(),我们可以得到一个介于0和1之间的随机值,利用随机值,我们可以做出各种随机的效果。
//Math.round();去四舍五入的函数
//加在文字的源文本
Math.round(random()*100);
//加在旋转上
random()*100
-----------
valueAtTime(t)
//这是一个常见的函数,我们可以调用这个函数得到对应时间的值。

7Math.round()取整数
Math.round(thisComp.layer("A圆").transform.position[0])

8一个有尾巴的小球围着一个圈转
//小球1的位置
center=[thisComp.height/2,thisComp.width/2];
x=Math.sin(time*5)*此处填圆圈的直径;
y=Math.cos(time*5)*此处填圆圈的直径;
[x,y]+center;
//小球23456的位置
thisComp.layer("小球1").transform.position.valueAtTime(time-0.04*(index-1))
//小球23456的缩放
s = 100-(index-1)*10;
[s,s];
////小球23456的透明度
s = 100-(index-1)*30;

[图片上传中...(6666.gif-1c2f77-1575197021206-0)]
网友评论