AE篇-拿起来就用的AE表达式2
2019-11-24 本文已影响0人
redBlue_
![](https://img.haomeiwen.com/i2666102/4be2266cb000d3f6.jpg)
1表达式控制-滑块控制
//将旋转属性的表达式关联器链接到滑块控制器
//控制风扇旋转速度
s=effect("滑块控制")("滑块");
s*time;
2表达式控制-复选框控制
//将旋转属性的表达式关联器链接到复选框控制器
//控制风扇正反转
if (effect("复选框控制")("复选框") == true){
360*time;
} else{
-360*time;
}
![](https://img.haomeiwen.com/i2666102/9fc059b1b2b5d6c9.gif)
3原点重复缩放
//缩放属性
a=[100,100]
a*(time %
1);
![](https://img.haomeiwen.com/i2666102/8bd2f93ea7d3b865.gif)
4wiggle\seedRandom()
每秒抖动1次,每次抖动15个像素
seedRandom(0),wiggle(1,105)
![](https://img.haomeiwen.com/i2666102/19f6c2fcf389e786.gif)
5time应用在旋位移、透明、缩放等属性上
//物体不停地旋转,在旋转参数中输入time,物体每秒转动一度
//速度是之前的30倍
time*10
![](https://img.haomeiwen.com/i2666102/b3090fdbdc298e7d.gif)
//圆环用修建路径留取一部分
//圆环位移
[position[0],position[1]-time*150];
//圆环缩放
[scale[0]+(index*15)*time*5,scale[1]+(index*15)*time*5];
//圆环透明度
100-time*40
![](https://img.haomeiwen.com/i2666102/946d573d25bc0d95.gif)
6loopOut()
//物体以一秒为周期旋转一圈,添加loopOut表达式,会永无止境地重复
loopOut()
![](https://img.haomeiwen.com/i2666102/f9e6c3e68526a1ea.gif)
7三个小球依次循环缩放
//第一层round3、第二层round2 位移
x= thisComp.layer(index+1).transform.position[0]+150;
[x,value[1]]
//第一层round3、第二层round2 缩放
thisComp.layer(index+1).transform.scale.valueAtTime(time-.2)
//第三层round1 缩放需要key针
loopOut(type = "pingpong", numKeyframes = 0)
//第三层round1 位移
x= thisComp.layer(index).transform.position[0];
[x,value[1]]
![](https://img.haomeiwen.com/i2666102/9c5493dfa2e1c70f.gif)
8Valueattime(time-0.05)位移时间延迟
//球A 位移key帧
//球A 颜色 hsl颜色转换 用滑块和index控制颜色变化
hslToRgb( [(index-thisComp.layer("球F").effect("index")("滑块"))/thisComp.layer("球F").effect("颜色")("滑块"),1,0.5,1] ) ;
//衍生球 颜色 同上
hslToRgb( [(index-thisComp.layer("球F").effect("index")("滑块"))/thisComp.layer("球F").effect("颜色")("滑块"),1,0.5,1] ) ;
//衍生球 x位移 利用valueAtTime做x轴位移延迟
thisComp.layer("球A").transform.xPosition. valueAtTime(time-(index-thisComp.layer("球F").effect("index")("滑块"))*0.05);
//衍生球 y位移
transform.yPosition+(index-thisComp.layer("球F").effect("index")("滑块"))*100
![](https://img.haomeiwen.com/i2666102/4705ed4d3f0e2a87.gif)