Created
May 10, 2012 14:20
-
-
Save swifee/2653304 to your computer and use it in GitHub Desktop.
AfterEffectsでiPhone用アニメーションイメージ生成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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