TimeLine에 올려 놓은 sequence나 movie file을 opacity를 이용하여 Layer 순서대로 교차로 보여질 수 있게 해주는 Expression
밑의 Expression은 movie file이 TimeLine에 2개의 Layer로 올려져 있을때임. 즉, 홀수,짝수 프레임으로 레이어를 번갈아가면서 보여주는 익스프레션.
짝수
opt = (thisComp.layer(thisLayer, 0).opacity);
currentFrame = time / this_comp.frame_duration;
currentSequence = Math.floor(currentFrame%2);
if (currentSequence == 0){
Opt = 100;
}
else{
Opt = 0;
}
홀수
opt = (thisComp.layer(thisLayer, 0).opacity);
currentFrame = time / this_comp.frame_duration;
currentSequence = Math.floor(currentFrame%2);
if (currentSequence == 1){
Opt = 100;
}
else{
Opt = 0;
}
opt = (thisComp.layer(thisLayer, 0).opacity); // opacity를 지칭하는 변수를 정의
currentFrame = time / this_comp.frame_duration; // 현재 프레임을 반환하는 변수를 정의
currentSequence = Math.floor(currentFrame%2); // 현재 프레임을 반환하는 변수의 소수점을 없애주는 변수를 정의(소수점을 없애주는 함수는 Math.floor)
if (currentSequence == 1){
Opt = 100;
}
else{
Opt = 0;
} // 조건문 (여기서 훌짝을 결정함.)
currentSequence 가 0이면 짝수이며
짝수프레임일때 opacity가 100
그렇지 않으면 opacity가 0 임을 결정
currentSequence 가 1이면 홀수
홀수프레임일때 opacity가 100
그렇지 않으면 opacity가 0 임을 결정
각각의 sequence의 opacity에 이 Expression을 적용하면 홀짝프레임에 따라서 두 Sequence가 교차로 보여짐.
frame_Duration나 Layer의 갯수에(나눠지는 값이 달라지므로) 따라서 값이 달라질 수 있는 문제는 아직 해결하지 못했음.
도와주신분 : 종재형님
예전 글 다시 가져왔습니다.
여러모로 필요한 부분이 있어서.ㅎㅎ
기대하십숑
두둥~!!!