秒コマ表示(テキストレイヤー)

コンポの判定にsourceを使用すると、テキストレイヤーでエラーが出ていたのを

try~catchで回避するようにした

//boldの数を算出

//コンポのレイヤーのinPointの一番大きい値がboldのoutPoint

bold = 0;

for(var i =1;i<=thisComp.numLayers;i++){

try{

if((bold < thisComp.layer(i).inPoint)&&(thisComp.layer(i).source instanceof Comp)){

bold = thisComp.layer(i).inPoint;

}

}catch(e){

}

}

bold = bold/thisComp.frameDuration;

//fpsの計算

fps  = 1/thisComp.frameDuration;

RenderFPS =  (bold==8) ? bold*3*1.25 : fps;

//メインの計算部分

sec = Math.floor((this_comp.duration*fps-bold)/fps) ;

koma = Math.floor((this_comp.duration*fps-bold)%fps*RenderFPS/fps);

//桁そろえる

zero = "";

for(var i=0;i<2-koma.toString().length;i++){

zero +="0";

}

//表示

sec + "        " +zero +  koma;