[익스프레션4] 바의 위치에 따라 글자의 크기와 투명도 낮아짐

크기(Scale)값에 적용될 익스프레션

A = thisComp.layer("Shape Layer 1").toComp(anchorPoint)[1];
B = thisLayer.toComp(anchorPoint)[1];
C = length(A, B);
D = linear(C, 0, 110, 100, 90);
[D, D]


투명도(Opacity)에 적용될 익스프레션

A = thisComp.layer("Shape Layer 1").toComp(anchorPoint)[1];
B = thisLayer.toComp(anchorPoint)[1];
C = length(A, B);
D = linear(C, 0, 110, 100, 10);



[익스프레션3] sourceRectAtTime (텍스트에 Bar크기 맞추기)

텍스트의 크기에 따라 바의 크기가 자동으로 변형된다.

사각형의 Size에 본 값을 대입하고

m = thisComp.layer("ADIDOF").sourceRectAtTime(0).width;  //콤프 레이어에 "(해당텍스트레이어)"
b = thisComp.layer("ADIDOF").sourceRectAtTime(1).height;  
[m+20, b+20]


사각형의 Position 값에 아래 값을 대입한다.

a = thisComp.layer("ADIDOF").sourceRectAtTime(0).width/2;
b = thisComp.layer("ADIDOF").sourceRectAtTime(1).height/2;
c = thisComp.layer("ADIDOF").sourceRectAtTime(1).top;
d = thisComp.layer("ADIDOF").sourceRectAtTime(1).left;
[a+d, b+c]  // [가로길이+좌측, 높이+상단]



[익스프레션] Auto fadeIn+fadeOut(오토 페이드 인)

오펙시티(Opacity)에 대입하는 익스프레션으로

대입하면 자동적으로 페이드인이 시작된다.

따로 키프레임을 생성할 필요가 없다.

v = 1.0;   //v(fadeDuration)
F1 = linear(time, inPoint, inPoint+v , 0, 100);
F2 = linear(time, outPoint - v, outPoint, 0, 100);
F1 + F2 //F1(fadeIn), F2(fadeOut)



[사용법]

대입: Scale, Rotation, Position

사용법: 본 익스프레션을 애니메이션이 걸려진 스케일, 포지션, 로테이션 값에 대입할 수 있다.

애니메이션의 시작과 정지 시 부드럽게 시작하고 멈출 수 있다.

값이 조정은 초록색부분을 재설정하면 좀 더 다른 분위기의 연출이 가능하다.


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 && t < 1){

v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

amp = .05;

freq = 4.0;

decay = 8.0;

value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

value;

}

----------------------{하단] 포지션값에 대입하는 익스프레션으로 아웃점에서 통통튀는 효과를 줄 수 있다------------

e = .7;
g = 5000;
nMax = 9;

n = 0;
if (numKeys > 0){
 n = nearestKey(time).index;
 if (key(n).time > time) n--;
}
if (n > 0){
 t = time - key(n).time;
 v = -velocityAtTime(key(n).time - .001)*e;
 vl = length(v);
 if (value instanceof Array){
   vu = (vl > 0) ? normalize(v) : [0,0,0];
 }else{
   vu = (v < 0) ? -1 : 1;
 }
 tCur = 0;
 segDur = 2*vl/g;
 tNext = segDur;
 nb = 1; // number of bounces
 while (tNext < t && nb <= nMax){
   vl *= e;
   segDur *= e;
   tCur = tNext;
   tNext += segDur;
   nb++
 }
 if(nb <= nMax){
   delta = t - tCur;
   value +  vu*delta*(vl - g*delta/2);
 }else{
   value
 }
}else
 value


[익스프레션값] https://docs.google.com/document/d/12ymsMLNA0oiIZc8_iXS9zuEMUH1NGV1zbvwnHkm21DM/edit

[출처] https://www.youtube.com/watch?v=J6EEninU8g0

+ Recent posts