板 1- 前 次 新 レス
何でも質問箱
[78]hide - i:08/11/09 13:25:57 ID:6FAJ+U9c
p = 256;
coe = 1/p;
targetItem = app.project.item(1);
layObj = targetItem.layer(1);
setLayObj = targetItem.layer(2);
layObj.timeRemapEnabled = true;
setLayObj.timeRemapEnabled = true;
timeObj = layObj.property("timeRemap");
setTimeObj = setLayObj.property("timeRemap");
compStartframe = Math.round(targetItem.workAreaStart/targetItem.frameDuration);
compEndframe = Math.round((targetItem.workAreaStart + targetItem.workAreaDuration)/targetItem.frameDuration);
for(var f=compStartframe; f<compEndframe; f++){
//毎回タイムを生成しないとずれる
var t = f/targetItem.frameRate;
remapTime = timeObj.valueAtTime(t,false);
r = remapTime * layObj.source.frameRate;
fr = Math.floor(r);
//marginは必ずプラスにする
margin = fr+1 - r;
if(margin<=coe&&margin>0){
seqNum = Math.round(r);
}else{
seqNum = Math.floor(r);
}
setTime = setTimeObj.setValueAtTime(t,seqNum/layObj.source.frameRate);
}
alert("Fin");
前 次 新