TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua
标题:
[kk]05_Sword_Art_Online_OP1
[打印本页]
作者:
kk123456
时间:
2012-11-28 13:12:06
标题:
[kk]05_Sword_Art_Online_OP1
本帖最后由 kk123456 于 2012-11-28 13:12 编辑
from tcaxPy import *
def tcaxPy_Init():
global _Fs
global _FD # 一帧的持续时间, 约40毫秒
global _Spacing # 字体间距
global _TextLength
global Font # 首要字体
_Fs = GetVal(val_FontSize)
_FD = 1000 / GetVal(val_FXFPS)
_FontFileName = GetVal(val_FontFileName)
_FaceID = GetVal(val_FaceID)
_Spacing = GetVal(val_Spacing)
_TextLength = GetVal(val_TextLength)
Font = InitFont(_FontFileName, _FaceID, _Fs, _Spacing, GetVal(val_SpaceScale), MakeRGB(255, 255, 255), 0, False)
def fsc(x):
X = randint(0,x)
return fscx(X)+fscy(X)
def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
ASS_BUF = []
dx = _x - int(_a / 2 + 0.5)
dy = _y - int(_Fs / 2 + 0.5)
clo = ("9EDADC","F8FB96")
if _i == 0 or _i == 2 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,180,CLIP)+t(180,200,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_ET),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(2)+color3('000000')+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('FFFFFF')+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+bord(2)+fs(_Fs))+t((_SK+1)*10,(_SK+_KT/3)*10,color3('FFFFFF')+be(0))+t((_SK+_KT/3)*10,(_SK+_KT)*10+50,color3('000000')+be(3)), _txt)
for i in range(4):
ass_main(ASS_BUF,SubL(_BT+_SK-10+i*8,_BT+_SK+_KT+i*8),fad(100,200)+pos(_x-_a/2+_a/3*i,_y+randint(20,30))+frx(78)+alpha1(256)+alpha3(0)+alpha2(0)+be(2)+color3("FFFFFF")+bord(2)+fscx(0)+fscy(0)+t(0,_KT*10,fscx(80)+fscy(80)),"●")
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
if _i == 1 or _i == 3 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,200,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_ET-10),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(1)+color3('808080')+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('FFFFFF')+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+color3('000000')+bord(2)+be(1)+fs(_Fs)), _txt)
for i in range(15):
ass_main(ASS_BUF,SubL(_BT+_SK-15+randint(0,_KT)*0.7,_BT+_SK+_KT+30),fad(100,300)+pos(_x+randint(-5,5)*6,_y+randint(-4,4)*5)+alpha1(randint(0,5)*8)+color1("FFFFFF")+be(1)+blur(0)+bord(0)+t(color1("57C6EA")+blur(3))+fscx(50)+fscy(50),"*")
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
if _i == 4 or _i == 5 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,250,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_ET-10),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(1)+color3('000000')+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('FFFFFF')+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+color3('000000')+bord(2)+be(1)+fs(_Fs)), _txt)
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
if _i == 6 or _i == 7 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
col = ("DBFCCF", "FEFCF8", "685131")
PIX = TextPix(Font, _txt)
n = len(PIX)
l = randint(0,n+1)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,250,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_BT+_SK+5),pos(_x,_y)+bord(2)+blur(0)+be(1)+color3('0000000')+t(_SK-100,(_SK)*10,color1("FEFCF8")+color3("516C35")+bord(4)+blur(6.1)), _txt)
for i in range(25):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
for i in range(40):
PIX = TextPix(Font, _txt)
points = PixPoints(PIX)
n = len(points)
pt = points[randint(0, n - 1)]
x = dx+pt[0]+randint(-4,5)
y = dy+pt[1]+randint(-4,5)
tp = ("{\p3}m 0 0 l0 20 0 l 10 20 {\p0}","{\p3}m 0 0 l 0 14 0 l -14 -14 {\p0}","{\p4}m 0 0 l 0 21 l 14 7 l 21 -14 l 0 0 {\p0}","{\p3}m -10 0 l -10 -18 l 12 10 l -10 10 {\p0}")
tp1 = tp[randint(0,3)]
Xx = -50+randint(-50,50)
Yy = randint(-30,30)
R = randint(-30,10)
MOVE = move(x,y,_x+Xx,_y+Yy)
EFT = t(0,(_SK+_KT+90)*10,0.4,MOVE)+fad(0,500)+color1("EAF9DF")+be(3)+alpha3(randint(120,200))+color3("68A47C")+bord(2)+t(0,randint(0,_KT+50)*10,color1("685131")+bord(0))+fr(randint(-180,180))+t(fr(randint(-90,90)))
ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+90), EFT, tp1)
if _i == 8 :
fire_str = ('{\\p5}m 0 0 b 8 1 9 -28 -2 -41 b 3 -23 -17 0 0 0{\\p0}','{\\p5}m 1 41 b 20 39 1 13 13 -11 b 5 1 -18 22 1 41{\\p0}','{\\p4}m 6 39 b 4 29 1 13 27 -37 b -1 -3 -15 34 6 39{\\p0}','{\\p5}m -3 43 b -9 22 -1 33 16 -47 b 1 3 -17 0 -3 43{\\p0}')
PIX = TextPix(Font, _txt)
points = PixPoints(PIX)
pt_num = len(points)
dx = _x - int(_a / 2 + 0.5) + PIX[0][0]
dy = _y - int(_Fs / 2 + 0.5) + PIX[0][1]
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,250,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_ET-10,12),pos(_x,_y)+fad(0,200), _txt)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT+10,14),pos(_x,_y)+fad(0,_KT*4)+fs(_Fs+2)+color1("FFAF09")+bord(0)+t(0,_KT*10,0.4,fs(_Fs+18)), _txt)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,13),pos(_x,_y)+color3("FFAF09"), _txt)
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
for i in range(0, _ET-_SK-_BT, 3):
pt = points[randint(0, pt_num - 1)]
t0 = randint(_BT+_SK,_ET)
t1 = t0 + 30
tmpz = randint(0, 359)
tmpstr = fire_str[randint(0, 3)]
x = dx + pt[0]
y = dy + pt[1]
EFT = move(x, y, x, y - 35) + alpha1(100) + color1('FFAF09') + alpha3(150) + color3('FFAF09') + bord(3) + blur(3) + frz(tmpz) + t(fscx(70)+fscy(70) + bord(1) + fry(361) + frz(-57)) + fad(0, 200)
ass_main(ASS_BUF, SubL(t0, t1,10, Pix_Style), EFT, tmpstr)
if _i == 9 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,250,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
if _j == 0 :
ass_main(ASS_BUF, SubL(_BT,_ET),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(2)+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('76F5FC')+color1("76F5FC")+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+bord(2)+fs(_Fs))+t((_SK+1)*10,(_SK+_KT/3)*10,color3('76F5FC')+be(0))+t((_SK+_KT/3)*10,(_SK+_KT)*10+50,color3('000000')+color1('FFFFFF')+be(3)), _txt)
if _j == 2 :
ass_main(ASS_BUF, SubL(_BT,_ET),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(2)+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('BBABEA')+color1("BBABEA")+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+bord(2)+fs(_Fs))+t((_SK+1)*10,(_SK+_KT/3)*10,color3('BBABEA')+color1("BBABEA")+be(0))+t((_SK+_KT/3)*10,(_SK+_KT)*10+50,color3('000000')+color1('FFFFFF')+be(3)), _txt)
if _j == 4 :
ass_main(ASS_BUF, SubL(_BT,_ET),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(2)+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('BC893E')+color1("BC893E")+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+bord(2)+fs(_Fs))+t((_SK+1)*10,(_SK+_KT/3)*10,color3('BC893E')+color1("BC893E")+be(0))+t((_SK+_KT/3)*10,(_SK+_KT)*10+50,color3('000000')+color1('FFFFFF')+be(3)), _txt)
if _i > 12 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,250,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_ET-10),an(5)+pos(_x,_y)+fad(200,200)+fs(34)+bord(2)+be(3)+blur(0)+color3('000000')+t(_SK*10-150,(_SK+_KT/2)*10,blur(5)+bord(4)+color3('FFFFFF')+be(3)+fs(38))+t((_SK+_KT/2)*10,(_SK+_KT)*10+50,blur(0)+color3('000000')+bord(2)+be(0)+fs(34)), _txt)
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
if _i == 10 :
col = ("FFCB60")
if _i == 11 :
col = ("AEFD42")
if _i == 12 :
col = clo[randint(0,1)]
if _i > 9 and _i < 13 :
CLIP= clip(dx,dy,_x+_a/2+0.5,_y+_Fs/2+5)
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),pos(_x,_y)+color3('F4CE1C')+blur(3)+bord(2)+be(2)+clip(dx,_y+_Fs/2+5,_x+_a/2+0.5,_y+_Fs/2+5)+t(0,250,CLIP)+t(100,250,color3('000000')+blur(0)+bord(2)), _txt)
ass_main(ASS_BUF, SubL(_BT,_ET-10,2),pos(_x,_y)+fad(0,200)+bord(2)+blur(0)+be(3)+color3('000000')+t(_SK*10,(_SK+1)*10,blur(2)+bord(4)+color3('FFFFFF')+be(0)+fs(_Fs+7))+t((_SK+1)*10,(_SK+_KT)*10+50,blur(0)+color3('000000')+bord(2)+be(1)+fs(_Fs)), _txt)
for i in range(0,_a,13):
for k in range(0,_Fs+2,10):
if _i == 12 :
col = clo[randint(0,1)]
ass_main(ASS_BUF,SubL(_BT+_SK-15+randint(0,_KT)*0.5,_BT+_SK+_KT+randint(20,80),0),fad(100,300)+pos(dx+i+randint(-5,5),dy+k+randint(-2,3))+color1(col)+fscx(30)+fscy(20)+alpha1(randint(0,11)*20)+bord(0)+t(color1("FFFFFF")),"■")
for i in range(20):
ass_main(ASS_BUF, SubL(_BT-20,_BT+5),move(_x+randint(-25,25),_y+_Fs/2+randint(-15,5),_x+randint(-25,25),_y-randint(30,55))+fad(0,100)+color3('F4CE1C')+blur(3)+bord(1)+be(2)+t(bord(0)), "{\p1}m 0 0 l 1 0 1 1 0 1{\p0}")
return (ASS_BUF,None)
复制代码
嘛,一个简单的东西,那破碎效果略苦逼,看着有些假,以后试试mod好了
视频预览
作者:
milkyjing
时间:
2012-12-1 18:21:15
加油, KK君进步有目共睹啊...
入坑满周年了么..
作者:
kk123456
时间:
2012-12-1 18:54:35
本帖最后由 kk123456 于 2012-12-1 18:54 编辑
milkyjing 发表于 2012-12-1 18:21
加油, KK君进步有目共睹啊...
入坑满周年了么..
感谢奶大的鼓励,嗯,快一年了。
作者:
hamill
时间:
2016-4-17 05:09:50
挖个坟学习下。
作者:
aijessica
时间:
2016-6-28 01:33:48
谢谢楼主大大免费分享!学习了
作者:
ABC不是菜
时间:
2016-9-11 20:46:03
辛苦了
作者:
Kairu
时间:
2016-11-25 20:18:59
很漂亮,谢谢大神
作者:
夜芯筁
时间:
2018-9-12 21:37:17
感谢分享!!
作者:
Seekladoom
时间:
2021-7-12 02:01:34
感谢分享
作者:
Seekladoom
时间:
2021-7-12 18:32:46
if _j == num的用法跟Aegisub的fx name有相似之处啊。
分段执行ass_main的内容原来是靠if _i == num、if _j == num的方式实现的。。。_(:з」∠)_
欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/)
Powered by Discuz! X2