当前位置:网站首页>AE common expression summary "suggestions collection"
AE common expression summary "suggestions collection"
2022-07-23 07:13:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
AE The order of expressions is from 0 Start calculating , Such as location (x,y,z,) The corresponding is (0,1,,2)
See how to add expressions
Expression tools
A. Expression switch B. Expression chart C. Expression correlator D. Expression language menu
because AE The parameters of different attributes are different , The commonly used ones can be divided into : The number ( rotate / The opacity )、 Array ( Location / The zoom )、 Boolean value (true It means true 、false On behalf of false /0 On behalf of false 、1 It means true ) These three forms are used to write expressions . For the expression AE There are also many built-in function commands , You can call it directly in the expression language menu .
Next, let's take a look at the commonly used expressions !
1. time expression
principle :
time Time , In seconds ,time*n = Time ( Number of seconds )*n ( If applied to rotation attribute , be n Show angle )
give an example :
If you set time Expression for time*60, Then the layer will pass 1 Second time rotation 60 degree ,2 Seconds to 120 Degrees and so on ( Rotate clockwise when the value is positive , Rotate counterclockwise when negative )
matters needing attention :
time Data that can only be given one-dimensional attributes .( The position attribute can be separated by individual dimensions , Thus, it can be set separately X or Y Upper time)
2. shake / Swing expression
wiggle(freq, amp, octaves = 1, amp_mult = 0.5, t = time)
principle :
freq= frequency ( Set the frequency of jitter per second );amp= The amplitude ( The amplitude of each jitter );octaves= Amplitude ( On the basis of each amplitude, a certain amplitude will be carried out , Rarely used );amp_mult= Frequency doubling ( The default value is ok , The closer the value is 0, The less detail ; The closer the 1, The more details );t= The duration of the ( The jitter time is the synthesis time , Generally, there is no need to modify ); Generally, just write the first two values
give an example :
If in one-dimensional attribute , Add wiggle(10,20), It means that the layer jitters every second 10 Time , The amplitude of each random fluctuation is 20; If in the two-dimensional attribute , Add n=wiggle(1,10);[n[0],n[0]], Represents the scaling of the layer XY Jitter every second 10 Time , The amplitude of each random fluctuation is 20; If in the two-dimensional attribute , Want to shake alone in a single dimension , You need to set the attribute to a separate size and add wiggle(10,20), Represents the scaling of the layer X The axis vibrates every second 10 Time , The amplitude of each random fluctuation is 20.
matters needing attention :
You can run directly on existing properties , Include any keyframes
3. index expression ( Index expression )
principle :
For how many values per interval to produce how many changes
give an example :
If it is a layer 1 Add an expression to the rotation attribute of index*5 , Then the first layer will rotate 5 degree , Then press Ctrl+D When copying multiple layers , The first 2 Layers will rotate 10 degree , And so on ; If you want to keep the normal shape without rotation on the first layer , The copied figure is represented by 5 Degree increment , The expression can be written as (index-1)*5
4. value expression
principle :
Output the current attribute value at the current time
give an example :
If the expression added to the position attribute is value+100, Then the position will be aligned on the basis of the key frame value X Axial right offset 100( Positive numbers to the right , Negative numbers are like left ); If you want to control Y Position attribute of axis , Then the position attribute can be divided by a separate size , Thus, it can control Y Axis ( A positive number goes down , Negative number up )
matters needing attention :
More usage scenarios are applied together with other expressions
5. random expression ( Random expressions )
principle :
random(x,y) In numbers x To y Random sampling , The minimum value is x, The maximum value is y
give an example :
If you add an expression to the numeric source text random(20), Then the data will change randomly , The maximum value will not exceed 20;
If you add an expression to the numeric source text random(10,100), Then the data will be in 10< The number <100 Between random changes ; If you add an expression to the numeric source text seedRandom(5, timeless = false),random(50), Then the data will be in 50 Change randomly within ( Ahead 5 It's the number of seeds , For example, it is necessary to make random changes in the values of multiple identical intervals in a picture , We need to add different seed numbers for them , Prevent the two random changes from being the same ), If you want the number to change randomly into an integer, you should add the expression Math.round(random(2,50)), It means that 2 and 50 Between random changes without decimals
matters needing attention :
Random expressions are not limited to the use of data , Other attributes can also be applied , If the value is an integer Math Of M Use capital letters
6. loopOut expression ( Loop expression )
principle :
- loopOut(type=” type ”,numkeyframes=0) Cycle a set of actions
- loopOut(type=”pingpong”,numkeyframes=0) It's like a round-trip cycle like table tennis ;
- loopOut(type=”cycle”,numkeyframes=0) It's a cycle ;
- loopOut(type=”continue”) Last speed of continuous attribute change ,
- loopOut(type=”offset”,numkeyframes=0) Is to repeat the specified period of time for a cycle ;
- numkeyframes=0 Is the number of cycles ,0 For infinite cycles ,1 Is the last two keyframes infinite loop ,2 Is the last three keyframes infinite loop ,
And so on
give an example :
Here's the picture gif
7. timeRemap expression ( Frame extraction )
principle :
timeRemap*n,n In frames
give an example :
Set the layer to timeRemap*10, Represents every 10 The frame is removed 1 frame ,( It depends on the rate of extraction )
matters needing attention :
Use timeRemap Time remapping should be enabled before expression , Otherwise, you cannot use this expression
8. linear expression ( Linear expression )
principle :
- linear(t, tMin, tMax, value1, value2) Express linear(time, The time when the change began , Time to end the change , The value at the beginning of the change , End the changed value );
- linear(t, value1, value2) Said when time stay 0 To 1 Between time , from value1 Change to value2;
- ease(t, tMin, tMax, value1, value2) Meaning and linear equally , The difference is tMin and tMax point , Slow in and slow out , Make the data smoother ;
- easeIn(t, tMin, tMax, value1, value2) And linear It means the same thing , The difference is tMin It's about , Slow in , Make the data smoother ;
- easeOut(t, tMin, tMax, value1, value2) And linear It means the same thing , The difference is tMax point , Slow out , Make the data smoother
give an example :
See the figure below, all with (time,0,3,131,1000) For example , If you add this expression to the source text attribute of the number, you can make the countdown effect n=linear(time, 0, 3, 3, 0) From 0-3 The number of seconds is from 3 To 0, If you want the number as a whole, you need to add Math.floor()
matters needing attention :
The usage of countdown is quite common , Integers M Use capital letters
9. Other Math( Angle, radian )
principle :
degreesToRadians(degrees) Turn to radian (degrees Variable or expression of degree )radiansToDegrees(radians) Radian to angle (radians Variables or expressions of radians )
give an example :
Some calculations in Mathematics sin,cos,tan,sec,csc,cot etc.
10. layer expression
principle :
layer(index) in index Numerical value , Retrieve layers by number ;layer(name) in name Is a string , Retrieve layers by name ( If there is no layer name , Then according to the source name );layer(otherLayer, relIndex) in otherLayer Represents a layer object ,relIndex Represents the value , Retrieve numeric layers belonging to layer objects
give an example :
- layer(index)—thisComp.layer(1).position;
- layer(name)—thisComp.layer(“ Shape layer 1”);
- layer(otherLayer, relIndex)—thisComp.layer(thisLayer, 1).active Will return true
11. marker expression
principle :
marker.key(index) in index Numerical value ;marker.key(name) in name Is a string
give an example :
thisComp.marker.key(1).time Indicates the time when the first composite tag is returned ;thisComp.marker.key(“ My name is annotation name ”).time Indicates that the return has a name ” My name is annotation name ” The time of the composite marker
12. comp( Composite properties and methods )width And height expression
principle :
width Represents the return composite width ;height Indicates that the composite height is returned
give an example :
[thisComp.width/2, thisComp.height/2] It means that the width and height are half of the composite, that is, the middle position
13. param expression
principle :
param(name) in name Representation string ;param(index) Represents the value
give an example :
effect(“ Gaussian blur ”).param(“ Ambiguity ”) Effect control points are always in layer space
14. Elastic expression
principle :
Copy and paste expressions can be used ,amp It means amplitude ,freq Frequency ,decay Indicates attenuation ( Make different adjustments according to different needs )
give an example :
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); amp = .03; freq = 2.5; decay = 4.0; value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); }else{value;}
Copy and paste the above content to use
Be careful :motion2 Scripts also have this function , There's not only one way
15. Bounce expression
principle :
k Indicates the final result of the rebound ,a Indicates rebound resistance ,b Indicates the rebound change time
give an example :
k=500; a=8; b=30; x=k*(1-Math.exp(-a*time)*Math.cos(b*time));[x,x]( Adjust according to different situations kab The value of )
16. Numeric increment expression
principle :
StartNumber Indicates the starting value ,EndNumber Represents the value at the end ,StartTime Indicates the start time ,EndTime Indicates the end time , And the one in front linear The expression corresponds to
give an example :
StartNumber=1; EndNumber=20; StartTime=0; EndTime=3; t=linear(time,StartTime,EndTime,StartNumber,EndNumber);Math.floor(t)
17. Squeeze and stretch
principle :
spd Indicates the speed of extrusion and stretching ,maxDev Indicates the size of extrusion ,decay Indicates attenuation
give an example :
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]
18. Sports tail
principle :
delay Indicates the number of frames to delay
give an example :
Add an expression for the location attribute delay = 0.5;
d = delay*thisComp.frameDuration*(index – 1);
thisComp.layer(1).position.valueAtTime(time – d);
If you want to achieve opacity tailing, you need to add an expression for the opacity attribute opacityFactor =.80;
Math.pow(opacityFactor,index – 1)*100( After adjusting a layer, copy multiple )
19、 Conditional expression
The way of writing :if( Conditions ) result else result
representative if( When certain conditions are met ) Get a result else Otherwise, it is another result
give an example : Give layers 1 Input the expression on the opacity of
x=thisComp.layer(“ Shape layer 2”).transform.position[1];
if (x>540) 100 else 0
It means layer 1 The opacity of is associated with the layer 2 Of y On the shaft ,([1] It stands for 、 Axis ) As a variable x
That's the expression if( When the above variable is x Greater than 540 when ) Layers 1 The opacity of is 100 else Otherwise, the opacity is 0
remarks , Write expressions if (x>540) 100 else 0 There should be a space in the middle of each, that is if Space ( Conditions ) Space result space else Space result
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/126123.html Link to the original text :https://javaforall.cn
边栏推荐
- 龙芯掌门人吐苦水:我们有世界第一性能的CPU,但可惜没人用!
- 小黑leetcode之旅:100 相同的树
- 对线程池的了解与应用你掌握多少
- 新浪微博头像右下角红色五角星是什么意思?如何成为新浪微博达人?
- What does DNS mean? What is the function of DNS
- 怎么看电脑是64位还是32位 电脑32位和64位的区别
- 实现OPC UA publish/subscribe单次发送
- Pikachu shooting range SQL injection search injection clearance steps
- How to get administrator permissions on the computer tutorial on setting administrator permissions on the computer
- How to connect two computers with one network cable? How to connect two computers with one network cable
猜你喜欢

Design of boiler drum temperature control system (process control course design matlab/simulink)

How to embed the monitoring image into wechat official account for live broadcast

中年危机,不敢离职的职场爸爸,该如何面对生活的苟且

ESP32:Arduino教程汇总

小程序wx.setStorageSync后,在用getStorageSync获取数据有时会获取不到

在项目开发中的Logback日志框架技术

Combing the docking process between the integration base and the business system

图像处理解决方案 veImageX 技术演进之路

LUR caching algorithm

什么程序员在35岁依然被公司抢着要?打破程序员“中年危机”
随机推荐
动作活体检测能力,构建安全可靠的支付级“刷脸”体验
常见的跨域问题
无法打开代理服务器提示代理服务器没有设置为完全访问该怎么办?
How to add a website as a trusted trusted site setup tutorial
局域网SDN技术硬核内幕 - 3 前传 突破多核的瓶颈——虚拟化
Iterators and generators in JS (detailed explanation)
ESP32:Arduino教程汇总
How to embed the monitoring image into wechat official account for live broadcast
小程序wx.setStorageSync后,在用getStorageSync获取数据有时会获取不到
What key should I press to release the computer from sleep mode when the computer is standby
CAN总线详解
电脑如何快速关机 电脑关机命令分享
dns是什么意思 dns作用是什么介绍
Realize OPC UA publish/subscribe single send
AE常用表达式汇总「建议收藏」
ipv4无internet访问权限怎么办?ipv4无internet访问权限解决方法(图文详解)
Uric acid detection and precautions
AIRIOT答疑第5期|如何使用低代码业务流引擎?
OWA动态密码短信认证方案,解决outlook邮件双因子认证问题
GB28181流媒体服务LiveGBS使用和二次开发中常见问题总结