三个滑块分别控制影响因素、影响范围和紊乱程度。由于只是用作案例,里面关键帧部分、控制器部分都不算好用,有需求可以自行拓展、提升。
//大概的关键代码
seedRandom(index*20, timeless=true)
v1 = thisProperty.key(1).value;
v2 = thisProperty.key(2).value;
p1 = thisLayer.transform.position.value;
p2 = thisComp.layer("control").transform.position.value;
influence = Math.sqrt(Math.pow((p2[0]-p1[0]),2)+Math.pow((p2[1]-p1[1]),2));
size = thisComp.layer("control").effect("size")(1);
offset = thisComp.layer("control").effect("difference")(1);
r = random();
var plusOrMinus = random()<0.5?-1:1;
w = thisComp.layer("control").effect("wiggle/100")(1)/100;
easeOut(size/2,influence-offset+r*offset*plusOrMinus*w,influence+offset+r*offset*plusOrMinus*w,v2,v1);