-
Notifications
You must be signed in to change notification settings - Fork 0
/
NextPass.jsfl
159 lines (134 loc) · 5.44 KB
/
NextPass.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
var fdoc = fl.getDocumentDOM();
var fltl = fdoc.getTimeline();
var myLayerArray = fltl.getSelectedLayers();
var myFrameArray = fltl.getSelectedFrames();
var countLA = myLayerArray.length;
var countFA = myFrameArray.length;
var KLayer = fltl.currentLayer;
var KFrame = fltl.currentFrame;
var cLayerNum = fdoc.getTimeline().currentLayer;
var curLayer = fl.getDocumentDOM().getTimeline().currentLayer;
fl.getDocumentDOM().getTimeline().setSelectedLayers(curLayer);
fl.getDocumentDOM().getTimeline().copyFrames();
fltl.layers[cLayerNum].locked = true;
var cLayerN = fltl.layers[cLayerNum].name;
// レイヤー名加工
if((n = cLayerN.indexOf("tm"))!= -1) cLayerN = cLayerN.charAt(n-1);
if((n = cLayerN.indexOf("%")) != -1) cLayerN = cLayerN.slice(0, n);
if((n = cLayerN.indexOf("&")) != -1) cLayerN = cLayerN.slice(0, n);
if((n = cLayerN.indexOf("_")) != -1) cLayerN = cLayerN.slice(1);
if((n = cLayerN.indexOf("=")) != -1) cLayerN = cLayerN.slice(1);
// 平面レイヤー作成
fltl.addNewLayer("----");
var fill = fdoc.getCustomFill("toolbar");
var iro = fill.color;
var style = fill.style;
fill.style = "solid";
fill.color = "#FFFFFFdd";
fdoc.setCustomFill(fill);
fdoc.addNewRectangle({left:0, top:200, right:fdoc.width, bottom:fdoc.height}, 0, false, true);
//fl.getDocumentDOM().exitEditMode();
fill.style = style;
fill.color = iro;
fdoc.setCustomFill(fill);
// 後処理
var cLayerNum = fltl.currentLayer;
fltl.layers[cLayerNum].locked = true;
fltl.addNewLayer("" +cLayerN+ "");
fl.getDocumentDOM().getTimeline().setSelectedLayers(curLayer);
fl.getDocumentDOM().getTimeline().pasteFrames();
var fdoc = fl.getDocumentDOM();
var fltl = fdoc.getTimeline();
var myLayerArray = fltl.getSelectedLayers();
var myFrameArray = fltl.getSelectedFrames();
var countLA = myLayerArray.length;
var countFA = myFrameArray.length;
var KLayer = fltl.currentLayer;
var KFrame = fltl.currentFrame;
//1フレームのみ選択
if(countLA == 1 && myFrameArray[2]-myFrameArray[1] == 1 && countFA == 3)
{
func();
}
//フレームを選択していない
else if(countFA == 0)
{
//現在のフレームを選択
fltl.setSelectedFrames(KFrame,KFrame + 1);
func();
fdoc.selectNone();
fltl.setSelectedFrames([]);
}
//フレームを複数選択している
else
{
var prePosition = fltl.getSelectedFrames();
var hozonKFrame = fltl.currentFrame;
var FS = fltl.layers[KLayer].frames[KFrame].duration;
//条件追加選択1以上でも1フレーム全選択の場合軽量処理。
if (FS == [myFrameArray[2] - myFrameArray[1]])
func();
else
{
for (var i = 0; i < countFA; i++)
{
if (i % 3 == 0)
{
var FAhani = myFrameArray[i + 2] - myFrameArray[i + 1];
//選択範囲のみ適応
for (var j = 0; j < FAhani; j++)
{
//作業箇所選択
fltl.setSelectedLayers(myFrameArray[i]);
//現在のレイヤーのフレーム数を取得
var KLayerFcount = fltl.layers[myFrameArray[i]].frameCount;
//選択時のキーフレームこぼし拾い
if((myFrameArray[i + 1] + j) < KLayerFcount && j == 0
&& myFrameArray[i + 1] + j != fltl.layers[myFrameArray[i]].frames[myFrameArray[i + 1] + j].startFrame)
{
KFrameSF = fltl.layers[myFrameArray[i]].frames[myFrameArray[i + 1]].startFrame
fltl.setSelectedFrames(KFrameSF, KFrameSF + 1);
KLayer = myFrameArray[i];
KFrame = KFrameSF;
func();
}
//フレームのないエリアは処理しない。キーフレームのみ処理
if ((myFrameArray[i + 1] + j) < KLayerFcount
&& myFrameArray[i + 1] + j == fltl.layers[myFrameArray[i]].frames[myFrameArray[i + 1] + j].startFrame)
{
fltl.setSelectedFrames(myFrameArray[i + 1] + j, myFrameArray[i + 1] + j + 1);
KLayer = myFrameArray[i];
KFrame = myFrameArray[i + 1] + j;
func();
}
}
}
}
//保存された選択範囲を再現
fltl.setSelectedFrames(prePosition);
fltl.currentFrame = hozonKFrame;
}
}
var LayerSUU = fl.getDocumentDOM().getTimeline().layerCount;
var layerArray = fl.getDocumentDOM().getTimeline().getSelectedLayers();
var KLayer = fl.getDocumentDOM().getTimeline().currentLayer;
for(var x = 0; x < LayerSUU; x++)
{
if(x == KLayer){fl.getDocumentDOM().getTimeline().layers[KLayer].locked = false;}
else{fl.getDocumentDOM().getTimeline().layers[x].locked = true;}
}
fl.getDocumentDOM().getTimeline().layers[KLayer].locked = false;
for(var i = 0; i < layerArray.length; i++)
{
var myValue = layerArray[i];
var myLayer = fl.getDocumentDOM().getTimeline().layers[myValue];
myLayer.visible = true;
}
//函数
function func()
{
fdoc.deleteSelection();}
// if(OK1 + OK2 == 2){fdoc.deleteSelection();}
//}
var orenjiiro = '#6600FF';
fltl.layers[fl.getDocumentDOM().getTimeline().currentLayer].color = orenjiiro;