forked from M1A2C/AviutlDevelopingScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppea.anm
More file actions
218 lines (193 loc) · 6.8 KB
/
Appea.anm
File metadata and controls
218 lines (193 loc) · 6.8 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
--track0:type,0,20,0,1
--track1:付属layer,0,100,0,1
--check0:INFO,0
--dialog:添え字,local st="T";指定配列,local n=1;付属:添え字,local lst="";付属DT不可/chk,local isnotuseDT=0;
local tl=obj.track1
local Appea={}
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------- ここより先定義 ---------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
local error_message = function(tx)
obj.setfont("メイリオ",50)
obj.load("ERROR\n"..tx)
end
local message = function(tx)
obj.setfont("メイリオ",50)
obj.load(tx)
end
local gv = function(l,type)
return obj.getvalue("layer"..l.."."..type)
end
-- dofile('C:\\Users\\Aodaruma\\Desktop\\aviutl\\plugins\\script\\my scripts\\CHAP-aodaruma.lua')
local addAffectorDelayT = function(n,st,l,lst) -- n==指定配列、st==添え字
--[[
Appeaに必要なAffectを用意する関数。
DelayTrackが必要。
]]--
local af={}
local d=DT[(type(st)=="string" and st) or tostring(st)]
local i,j,d2
for i=1,#d do
af[i] = {t=d[i][n]}
if(tl==0) then
af[i]["x"] = d[i].x
af[i]["y"] = d[i].y
af[i]["z"] = d[i].z
af[i]["rx"] = d[i].rx
af[i]["ry"] = d[i].ry
af[i]["rz"] = d[i].rz
af[i]["zoom"] = d[i].zoom
af[i]["alpha"] = d[i].alpha
af[i]["aspect"] = d[i].aspect
else
if(lst and DT[lst]) and (isnotuseDT==0) then
d2 = DT[lst]
af[i]["x"] = d2[i].x
af[i]["y"] = d2[i].y
af[i]["z"] = d2[i].z
af[i]["rx"] = d2[i].rx
af[i]["ry"] = d2[i].ry
af[i]["rz"] = d2[i].rz
af[i]["zoom"] = d2[i].zoom
af[i]["alpha"] = d2[i].alpha
af[i]["aspect"] = d2[i].aspect
else
af[i]["x"] = gv(l,"x")
af[i]["y"] = gv(l,"y")
af[i]["z"] = gv(l,"z")
af[i]["rx"] = gv(l,"rx")
af[i]["ry"] = gv(l,"ry")
af[i]["rz"] = gv(l,"rz")
af[i]["zoom"] = gv(l,"zoom")
af[i]["alpha"] = gv(l,"alpha")
af[i]["aspect"] = gv(l,"aspect")
end
end
end
if(l==0) then
af["x"] = d[1].x
af["y"] = d[1].y
af["z"] = d[1].z
af["rx"] = d[1].rx
af["ry"] = d[1].ry
af["rz"] = d[1].rz
af["zoom"] = d[1].zoom
af["alpha"] = d[1].alpha
af["aspect"] = d[1].aspect
else
af["x"] = gv(l,"x")
af["y"] = gv(l,"y")
af["z"] = gv(l,"z")
af["rx"] = gv(l,"rx")
af["ry"] = gv(l,"ry")
af["rz"] = gv(l,"rz")
af["zoom"] = gv(l,"zoom")
af["alpha"] = gv(l,"alpha")
af["aspect"] = gv(l,"aspect")
end
af["n"] = #d
return af
end
-----------------------------------------------------------------------
Appea[1] = function(st,k,tl,lst) -- st==添え字
--[[
DelayTrackが必要。
指定配列は「1」、numは4です。
]]--
local af = addAffectorDelayT(k,st,tl,lst)
local n,uf = af.n,{}
local i
local w,h=obj.w,obj.h
local x,y
local dif=0.2
local ang=math.deg(math.atan(h/w))*-1
if(n==4) then
for i=1,n do
af[i]["t"] = af[i].t/100
table.insert(uf,(1-af[i].t))
end
obj.copybuffer("cache:back","obj")
-- obj.setoption("dst","tmp",obj.w,obj.h)
-- obj.load("framebuffer")
-- obj.draw(-1*obj.x,-1*obj.y)
-- obj.setoption("dst","tmp")
-- obj.copybuffer("obj","cache:back-"..obj.layer)
-- obj.setoption("blend","alpha_sub")
-- obj.draw()
-- obj.load("tempbuffer")
-- obj.effect("反転","透明度反転",1)
-- obj.effect("ぼかし","サイズ固定",30)
-- -- obj.effect("透明度","透明度",0)
-- obj.effect("斜めクリッピング","角度",90,"幅",obj.h*af[1].t+1)
-- obj.effect("単色化","輝度を保持する",0,"color",0x000000,"強さ",40)
-- -- obj.draw()
-- obj.copybuffer("cache:backblur","obj")
obj.setoption("dst","tmp",obj.w,obj.h)
obj.copybuffer("obj","cache:back")
obj.effect("単色化","輝度を保持する",0,"color",0x00d0ff,"強さ",40)
obj.effect("斜めクリッピング","角度",0)
obj.effect("斜めクリッピング","角度",90)
obj.effect("斜めクリッピング","角度",ang*uf[4]*uf[1]-180, "中心X",w/2,"中心Y",h/2*-1)
obj.effect("斜めクリッピング","角度",ang*uf[4]*uf[1]-90*af[4].t*af[1].t,"中心X",w/2,"中心Y",h/2*-1)
obj.copybuffer("cache:clip","obj")
for i=1,4 do
x,y=obj.ox,obj.oy
obj.copybuffer("obj","cache:clip")
if(i>2)then obj.effect("反転","上下反転",1) y=y-dif else y=y+dif end
if(i%2==0) then obj.effect("反転","左右反転",1) x=x+dif else x=x-dif end
obj.setoption("dst","tmp")
obj.draw(x,y,0,1,0.2)
end
obj.setoption("dst","tmp")
obj.setoption("blend",0)
obj.copybuffer("obj","cache:back")
obj.effect("透明度","透明度",80)
obj.effect("単色化","輝度を保持する",0,"color",0x000000,"強さ",50)
obj.effect("斜めクリッピング","角度",90*uf[2]*uf[1],"幅",h*af[2].t*af[1].t+1)
obj.effect("斜めクリッピング","角度",90,"幅",w*af[1].t+1)
obj.draw(0,0,0,1,0.3)
obj.setoption("dst","tmp")
obj.copybuffer("obj","cache:back")
obj.effect("透明度","透明度",90)
obj.effect("単色化","輝度を保持する",0,"color",0x000000,"強さ",80)
obj.effect("斜めクリッピング","角度",90*uf[3]*uf[1],"幅",h*af[3].t*af[1].t+1)
obj.effect("斜めクリッピング","角度",90,"幅",w*af[1].t+1)
obj.draw(0,0,0,1,0.4)
obj.setoption("dst","tmp")
obj.copybuffer("obj","cache:back")
obj.effect("エッジ抽出")
obj.effect("リサイズ","X",100*af[1].t)
obj.draw()
obj.setoption("dst","tmp")
obj.copybuffer("obj","cache:backblur")
obj.draw()
obj.load("tempbuffer")
obj.draw()
end
end
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------- 本体 -------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
local type,info = obj.track0,obj.check0
if(not info) and (type~=0) then
if(Appea[type]) then
Appea[type](st,n,obj.track1,lst)
else
error_message()
end
elseif (not info) and (type==0) then
message(
"現在"..#Appea.."のtype数が使用できます。"
)
else
message(
"DT状況:\n"
.."添え字:"..st.."; 存在:"..((DT[st] and "yes") or "no")..";\n"
.."付属添え字:"..st.."; 存在:"..((DT[lst] and "yes") or "no")..";\n\n"
.."type:"..type..";"..(DT[st] and (" AF:"..DT[st][1][n].."%;")) or ""
)
end