-
Notifications
You must be signed in to change notification settings - Fork 0
/
全隐藏图层AllLayersInVisible.jsfl
86 lines (58 loc) · 2.23 KB
/
全隐藏图层AllLayersInVisible.jsfl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// AllLayersInVisible
//
// This command was recorded by Adobe Animate.
// This plugin was made by Endlin Boeingstein 2024/6/28
//遍历library的文件,记录library的文件
var itemArray = an.getDocumentDOM().library.items;
//循环获取库内容
for(i in itemArray){
//输出文件名称
an.trace("library item's name:"+itemArray[i].name);
//输出文件类型
//an.trace(itemArray[i].itemType);
//判定是否为元件(影片剪辑/图形)
if(itemArray[i].itemType=="movie clip"||itemArray[i].itemType=="graphic"){
// 打开库中的元件
an.getDocumentDOM().library.editItem(itemArray[i].name);
//获取时间轴
var symboltl=itemArray[i].timeline;
//获取时间轴内的图层
var symbollayers=symboltl.layers;
//循环得到图层内容
for(var ly=0;ly< symbollayers.length;ly++){
an.trace("layer name:"+symbollayers[ly].name);
//定位到当前层
an.getDocumentDOM().getTimeline().currentLayer=ly;
//检测是否被隐藏
if(an.getDocumentDOM().getTimeline().getLayerProperty("visible")){
// 显示图层: false
an.getDocumentDOM().getTimeline().setLayerProperty('visible', false);
an.trace("Layer is Invisible");
}
}
// 返回到主场景
an.getDocumentDOM().exitEditMode();
//获取libaryitem名,否则返回场景名
//var it = symboltl.libraryItem;
//if (it)
//fl.trace("libraryItem name: " + it.name);
//else
//fl.trace("scene name: " + an.getDocumentDOM().getTimeline().name);
}
}
alert("AllLayersInVisible Done");
// 选择库项目: Symbol 35
//var lib=an.getDocumentDOM().library;
//for (item in lib) {
//an.trace(lib[item].name);
//}
//an.getDocumentDOM().library.selectItem('Symbol 35');
// 编辑库项目
//an.getDocumentDOM().library.editItem();
// 更改选择: {x:17, y:29.1}, false, true
//an.getDocumentDOM().mouseClick({x:17, y:29.1}, false, true);
// 更改选择: {x:17, y:29.1}, false, true
//an.getDocumentDOM().mouseClick({x:17, y:29.1}, false, true);
// 转换为位图
//an.getDocumentDOM().convertSelectionToBitmap()