﻿//加载自定义函数集
var scriptPath = $.fileName;
var scriptFolder = new File(scriptPath).parent;
var scriptFolderAbsolutePath = scriptFolder.absoluteURI;
$.evalFile(File(scriptFolderAbsolutePath + "/jsonFunction.jsx"));

//重命名
layerRename();

// =====创建时间轴==================================================
newFrameTimeline();
//重置时间轴
resetTimeline()
// =======================================================



var layerslength = app.activeDocument.layers.length;
//为当前帧设置图层的隐藏显示
function layerHidden() {
    //每桢时间
    var t = 0.01;

    var k_0 = 0;
    for (layname = 1; layname <= layerslength; layname++) {
        k_0 = layname;
        for (layname_k = 1; layname_k <= layerslength; layname_k++) {
            layerclick(layname_k);
            if (layname_k == k_0 || layname_k == 1) {
                //图层透明度
                transparency(100);
            }
            else {
                //图层透明度
                transparency(0);
            }

        }
        kTime(t);
        if (layname < layerslength) {
            newK();
            kTime(t);
        }
    }

}
layerHidden();
