AE表達(dá)式:pointOnPath()控制路徑動(dòng)畫(huà)

//計(jì)算路徑上某一點(diǎn)坐標(biāo)
Path = 替換路徑橡皮筋;
i = 進(jìn)度橡皮筋/100;
Path . pointOnPath( i , time)
//計(jì)算路徑上某一點(diǎn)切角
Path = 替換路徑橡皮筋;
i = 進(jìn)度橡皮筋/100;
tan = Path.tangentOnPath( i , t= time); //計(jì)算正切
Rad = Math.atan2( tan[1] , tan[0] ); //正切轉(zhuǎn)弧度
value+radiansToDegrees(Rad); //弧度轉(zhuǎn)角度(原始滑塊可調(diào)整)
//某一點(diǎn)發(fā)射錨點(diǎn)組成路徑
p=點(diǎn)橡皮筋; //二維
Path=[]; //建立一個(gè)空數(shù)組
life=滑塊橡皮筋/thisComp.frameDuration;//發(fā)射錨點(diǎn)的生命時(shí)長(zhǎng)單位幀
sample = 滑塊橡皮筋;//越高越平滑點(diǎn)越多
for (i=0 ; i<life*sample ; i++) {
???Path[i]=p.valueAtTime(time-i*life/sample)
}//只要時(shí)間往后滾就一直發(fā)射每幀*sample個(gè)錨點(diǎn),并放在Path數(shù)組里
creatPath(Path,[],[],0)//把path里的錨點(diǎn)練成路徑不閉合其他默認(rèn)
//循環(huán)
for (開(kāi)始之前執(zhí)行; 定義運(yùn)行循環(huán)的條件; 每次被執(zhí)行后執(zhí)行) {
???要執(zhí)行的代碼塊;
}