TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua
标题:
[SAI]011_hakuouki2OP
[打印本页]
作者:
saiyaku
时间:
2011-10-22 18:34:06
标题:
[SAI]011_hakuouki2OP
預覽:
http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview
from tcaxPy import *
def tcaxPy_Init():
# Tips: initialize your global variables here
global _FontSize
global pyFont
_FontSize = GetVal(val_FontSize)
pyFont = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), GetVal(val_FontSize), GetVal(val_Spacing), GetVal(val_SpaceScale), 0x0000FF, 0, 0)
def tcaxPy_Main(_I, _J, _N, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
ASS_BUF = [] # used for saving ASS FX lines
global _FontSize
global pyFont
_FontSize = GetVal(val_FontSize)
pyFont = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), GetVal(val_FontSize), GetVal(val_Spacing), GetVal(val_SpaceScale), 0x0000FF, 0, 0)
if _I >4 and _I<11:
if _I%2 == 1:
ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,0)+pos(_X-360,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,1),bord(4)+blur(8)+color3("0080FF")+color1("FFFFFF")+pos(_X-360,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,2),fad(100,100)+pos(_X-360,_Y)+bord(2)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,3),fad(100,100)+pos(_X-360,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_N-_J)*8,1),pos(_X-360,_Y)+bord(3)+blur(3)+color1("FFFFFF")+color3("000000"), _TXT)
ass_main(ASS_BUF, SubL(_ET-_J*3,_ET-(_N-_J)*8+10,1),pos(_X-360,_Y)+fad(0,200)+bord(3)+blur(3)+color1("FFFFFF")+color3("000000"), _TXT)
else:
ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,100)+pos(_X+360,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,1),bord(4)+blur(8)+color3("0080FF")+color1("FFFFFF")+pos(_X+360,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,2),fad(100,100)+pos(_X+360,_Y)+bord(2)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,3),fad(100,100)+pos(_X+360,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_N-_J)*8,1),pos(_X+360,_Y)+bord(3)+blur(3)+color1("FFFFFF")+color3("000000"), _TXT)
ass_main(ASS_BUF, SubL(_ET-_J*3,_ET-(_N-_J)*8+10,1),pos(_X+360,_Y)+fad(0,200)+bord(3)+blur(3)+color1("FFFFFF")+color3("000000"), _TXT)
elif _I == 11 or _I==12:
PIX = TextPix(pyFont, _TXT)
InitPosX = _X - int(_A / 2 + 0.5) + PIX[0][0] # left most position of the pixels in PIX
InitPosY = _Y - int(_FontSize / 2 + 0.5) + PIX[0][1] # upper most position of the pixels in PIX
X_list = []
Y_list = []
for h in range(PIX[1][1]):
PosY = InitPosY + h # y-position of the current pixel
for w in range(PIX[1][0]):
PosX = InitPosX + w # x-position of the current pixel
X = PosX
Y = PosY
idx = 4 * (h * PIX[1][0] + w)
PixR = PIX[2][idx + 0]
PixG = PIX[2][idx + 1]
PixB = PIX[2][idx + 2]
PixA = PIX[2][idx + 3]
if PixA == 255:
if randint(0,5) == 1:
ass_main(ASS_BUF, SubL(_BT+_SK,_ET,4),pos(X,Y)+bord(2)+blur(3)+color3("FFFFFF")+color1("FFFFFF")+alpha1(50)+alpha3(50), PixPt())
for i in range (10):
for j in range(2):
ass_main(ASS_BUF, SubL(_BT+_SK+i*5+randint(-5,5),_BT+_SK+100+i*5+randint(-5,5),3),mov(_X+randint(-10,10),_Y+randint(-10,10),_X-90+randint(-20,20),_Y+60+randint(-20,20))+bord(2)+blur(3)+color3("FFFFFF")+color1("FFFFFF")+t1(0,1000,frx(randint(-720,720))+fry(randint(-720,720))+frz(randint(-720,720))), PixPt())
ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,0)+pos(_X,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_ET,1),fad(0,100)+pos(_X,_Y)+color1("FFFFFF"), _TXT)
elif _I== 13 or _I == 14:
ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,0)+pos(_X,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 30,1),pos(_X,_Y)+bord(2)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 30,2),pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 30,3),pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK+ 30,_ET,1),fad(0,100)+pos(_X,_Y)+color1("000000")+color3("FFFFFF")+blur(3)+bord(3), _TXT)
for i in range(int((_ET-_BT-_SK)/10)):
for j in range (5):
ass_main(ASS_BUF, SubL(_BT+_SK+i*10,_BT+_SK+40+i*10,0),mov(_X+8+randint(-35,35),_Y+7+randint(-35,35),_X+8,_Y+7)+color1("HDAD5EA")+bord(0)+be(10),"{\p2}m 3 9 b -6 9 -7 -7 2 -12 7 -8 6 1 3 9{\p0}")
if _I == 14:
for i in range(50):
ass_main(ASS_BUF, SubL(_ET+_J*10+randint(-10,10),_ET+100+randint(-10,10),2),fad(0,500)+mov(_X+randint(-10,10),_Y+randint(-10,10),_X+randint(-50,50),_Y-10+randint(-40,30))+color1("HDAD5EA")+bord(0)+t1(0,1000,frx(randint(-720,720))+fry(randint(-720,720))+frz(randint(-720,720))),"{\p2}m 3 9 b -6 9 -7 -7 2 -12 7 -8 6 1 3 9{\p0}")
else:
if _I !=4:
ass_main(ASS_BUF, SubL(_BT-55,_BT,1),fad(100,100)+pos(_X,_Y)+bord(2)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT-55,_BT,2),fad(100,100)+pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT-55,_BT,3),fad(100,100)+pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),pos(_X,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 20,2),bord(3)+blur(3)+color1("000000")+color3("FFFFFF")+pos(_X,_Y), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK+20,_ET,2),pos(_X,_Y)+bord(3)+blur(3)+color1("000000")+color3("FFFFFF"), _TXT)
for i in range(4):
ass_main(ASS_BUF, SubL(_ET+i*3,_ET+30+randint(-5,5),0),mov(_X,_Y,_X+100,_Y)+blur(3)+blur(5)+alpha1(100)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
ass_main(ASS_BUF, SubL(_ET+i*3,_ET+30+randint(-5,5),0),mov(_X,_Y,_X-100,_Y)+blur(3)+blur(5)+alpha1(100)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
for i in range(6):
ass_main(ASS_BUF, SubL(_BT+_SK+i*8,_BT+_SK+100+i*8,2),mov(_X+randint(-10,10),_Y+randint(-10,10),_X-60+randint(-10,10),_Y+60+randint(-10,10))+color1("HDAD5EA")+bord(0)+t1(0,1000,frx(randint(-720,720))+fry(randint(-720,720))+frz(randint(-720,720))),"{\p2}m 3 9 b -6 9 -7 -7 2 -12 7 -8 6 1 3 9{\p0}")
return (ASS_BUF, None)
def tcaxPy_Fin():
# Tips: finalize your global variables here
FinFont(pyFont)
复制代码
欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/)
Powered by Discuz! X2