Skip to content

Instantly share code, notes, and snippets.

@swifee
Created May 10, 2012 14:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swifee/2653304 to your computer and use it in GitHub Desktop.
Save swifee/2653304 to your computer and use it in GitHub Desktop.
AfterEffectsでiPhone用アニメーションイメージ生成
//created by @swifee
#target "aftereffects"
var activeItem = app.project.activeItem;
if ((activeItem == null) || !(activeItem instanceof CompItem)) {
alert("コンポジションを選択した状態でスクリプトを実行して下さい。");
}else{
var comp_x = activeItem.width;
var comp_y = activeItem.height;
var comp_fDur = activeItem.frameDuration;
var comp_dur = activeItem.duration/comp_fDur;
var newComp = app.project.items.addComp("CombinedImage", comp_x, comp_y*comp_dur, 1, 1, 1);
var t;
for(i=0;i<comp_dur;i++){
t = newComp.layers.add(activeItem);
t.anchorPoint.setValue([0, 0, 0]);
t.position.setValue([0, comp_y*i, 0]);
t.timeRemapEnabled = true;
t.timeRemap.setValueAtTime(0, i*comp_fDur);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment