Skip to content

Instantly share code, notes, and snippets.

@deathponta
Created April 6, 2017 13:28
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 deathponta/f513d6e6024026594cce169fa9ae408d to your computer and use it in GitHub Desktop.
Save deathponta/f513d6e6024026594cce169fa9ae408d to your computer and use it in GitHub Desktop.
アクティブレイヤーの下のレイヤーをトグル。可視時は半透明。
/*
Created on 2017.4.5
現在のアクティブレイヤーの下のレイヤーをオン・オフ
不透明度は50%にする
■ 用途
アニメーション作業をする時に、下のレイヤーをオン・オフしながらやることが多いので
*/
l = activeDocument.layers;
al = activeDocument.activeLayer;
for( i=0;i<l.length;i++ ){
// 最終レイヤーでアレば処理しない
if( (l[i] == al) && (i != l.length-1) ){
ul = l[i+1]; // under layer 下のレイヤー
// 見えている時は不透明度50..visibleの順番が大事です。
if( ul.visible ){
ul.opacity = 100;
ul.visible = false;
}else{
ul.visible = true;
ul.opacity = 50;
}
}// end if
}// end for
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment