2017-09-26 11 views
4

세 가지 구성 (compFinal, compSlide1compSlide2)이 있습니다.After Effects 스크립트 : 컴포지션에 시작 시간 표시가있는 컴포지션을 추가하는 방법

compFinal 구성에 compSlide1compSlide2을 추가하는 스크립트를 사용했습니다. compFinal 모두 조성을를 삽입 할 때 compSlide1compSlide2이 같은 시작 시간이 "0"이됩니다

compFinal.layers.add(compSlide1); 
compFinal.layers.add(compSlide2); 

을하지만 :

나는 조성물을 추가하려면 다음 코드를 사용합니다. 구성 compSlide2를 추가 할 때 내가 조성물 (2)에 대해 표시되는 시작 시간을 설정할 수 있도록

나는 그것은 당신의 레이어의 복잡성에 부분적으로 의존한다 compSlide1

enter image description here

+0

스크립팅 가이드를 확인하십시오. 'startTime'검색 http://blogs.adobe.com/wp-content/blogs.dir/48/files/2012/06/After-Effects-CS6-Scripting-Guide.pdf?file=2012/06/After -Effects-CS6-Scripting-Guide.pdf – ProEvilz

답변

1

의 최종 시간을 동일 원하는 그러나 outPoint과 결합 된 현재 레이어의 startTime 속성을 사용하여 서로 이어지는 레이어를 조정할 수 있습니다. 모든 레이어 후에 실행 간단한 루프가 그런 측면에서 도움이 될 수 있습니다

은 (순서대로) 추가됩니다

// initial time (in seconds) 
var time = 0; 

// loop through all layers in comp 
for(var i = 1; i <= finalComp.layers.length; i++) { 

    // set layer startTime based on current time value 
    finalComp.layers[i].startTime = time; 

    // update time to hold outPoint time of this layer 
    // which will next layer's start time 
    time = finalComp.layers[i].outPoint; 
} 

당신이 두 개의 층이있는 경우 바로 이전 레이어의 OUT-에서 시작하도록 두 번째 레이어를 설정 지점 :

finalComp.layers[2].startTime = finalComp.layers[1].outPoint;