Last active
March 6, 2019 12:01
-
-
Save FryPotato893/740cbf6fd6cff4ac0562a3f940bf6ef3 to your computer and use it in GitHub Desktop.
【After Effects】選択したレイヤーをタイムリマップでコマ打ち
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
// frameHittingWithTimeRemap | |
// タイムリマップでコマ打ち | |
// コマ打ちするコマ数 | |
var frameHit = 2; | |
// アクティブなコンポジションを取得 | |
var activeComp = app.project.activeItem; | |
// アクティブなレイヤー名を取得 | |
var selectedLayers = activeComp.selectedLayers; | |
// フレームレートを取得 | |
var frameDuration = 1/activeComp.frameDuration; | |
for (var i = 0; i < selectedLayers.length; i++) { | |
var curLayer = selectedLayers[i]; | |
// タイムリマップをON | |
curLayer.timeRemapEnabled = true; | |
// コンプのデュレーションを取得 | |
du = activeComp.duration; | |
for (var d = 0; d < du*frameDuration; d++){ | |
// 奇数の場合はリマップにキーを打つ | |
if(d%frameHit == 0){ | |
if(d<selectedLayers[i].outPoint*frameDuration){ | |
curLayer.timeRemap.setValueAtTime(d/frameDuration,d/frameDuration); | |
// キーの補間を停止に変更 | |
curLayer.timeRemap.setInterpolationTypeAtKey(1,KeyframeInterpolationType.HOLD); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment