表达式术语:对象、属性、方法、参数、返回值
time
时间函数
time随着时间的变化,值也在变化
time*360
一分钟旋转360度
Math.floor(timen)m
时间函数
time随着时间的变化,值也在变化
Math.floor(time1)30
每秒动1次,一次30度
if(time<1) {time*120; } else {time*(-120); }
先顺时针转动,后逆时针转动
index
图层序列
取当前图层序列的值
x = thisComp.layer(“形状图层 1”).transform.position[0]+200;
y = thisComp.layer(“形状图层 1”).transform.position[1];
[x,y]
wiggle
摆动函数
wiggle(freq,amp,octaves=1,amp_mult=.5,t=time)
wiggle(m,n)
m是抖动的频率
n是抖动的范围
可以应用于一些UI的背景
random
随机函数
random(min,max)
在min与max之间随机取一个值
radom(100)
取0-100之间的任何一个数字
radom(100,200)
取100-200之间的任何一个数字
Math.round
取整函数
Math.round(value)数值的整数类型
Math.round(radom(100,200))
随机取100-200之间的整数
这个效果可以应用于抽奖场景
LoopOut
循环函数
loopout(type=“cycle“,numKeyframes=0)
定向运动
loopOut(type = “pingpong”, numKeyframes = 0)
定向往返运动
0的那个值代表着循环的贞
Linear
线性函数
linear(t,tMin,tMax,value1,value2)
图层之间的关联动画
- t相当于变量
- tMin最小值
- tMax最大值
- value1,value2(当前属性从value1变到value2)
⚠️如果属性是二维属性我们应该这样做
a=linearr(t,tMin,tMax,value1,value2)
[a,a]
公众号【设计前沿】