Ae通用表达式

Math.floor(time*n)*m

n代表每秒旋转的次数,m代表每次旋转的幅度。


回弹表达式

nearestKeyIndex = 0;

if (numKeys > 0){

  nearestKeyIndex = nearestKey(time).index;

  if (key(nearestKeyIndex).time > time){

    nearestKeyIndex--;

  }

}

if (nearestKeyIndex == 0) {

  currentTime = 0;

} else {

  currentTime = time - key(nearestKeyIndex).time;

}

if (nearestKeyIndex > 0 && currentTime < 1) {

  calculatedVelocity = velocityAtTime(key(nearestKeyIndex).time - thisComp.frameDuration / 10);

  amplitude = 0.04;// 反弹的力度&距离,值越大 反弹越强烈

  frequency = 2.0;// 频率,每秒反弹次数

  decay = 6.0;// 衰减,数值越大,越快停止

  value + calculatedVelocity * amplitude * Math.sin(frequency * currentTime * 2 * Math.PI) / Math.exp(decay * currentTime);

} else {

  value;

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容