Skip to content

Instantly share code, notes, and snippets.

@Hoikohroh
Last active February 19, 2016 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hoikohroh/457e223fd0e791fea1b3 to your computer and use it in GitHub Desktop.
Save Hoikohroh/457e223fd0e791fea1b3 to your computer and use it in GitHub Desktop.
Timeline_back_Keyflame_my
//概要
//https://forums.adobe.com/message/6077557
//上記スレッドで紹介されていたスクリプトの私家版
//
//変更点
//1:break入れてエラー対策
//2:フォルダ選択中にコマンド実行した際、フォルダ内の最上位レイヤーに実行
//
//履歴
//v1.0 2016/02/19
//
var doc = fl.getDocumentDOM();
var tl = doc.getTimeline();
var layers = tl.layers;
var layNum = tl.getSelectedLayers();
var srcLay = layers[layNum];
if (srcLay.layerType === "folder"){
for (var i = Number(layNum) + 1; i <= (tl.layerCount); i ++){
srcLay = layers[i];
if (srcLay.layerType !== "folder"){break;}
}
};
var frames = srcLay.frames;
var n = frames.length;
for(var i = Number(tl.currentFrame) - 1; i >= 0; i--){
if(i == frames[i].startFrame){
tl.currentFrame = i;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment