TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua

 找回密码
 新人加入
查看: 4398|回复: 0
打印 上一主题 下一主题

[完整特效] [SAI]011_hakuouki2OP [复制链接]

Administrator

Shanzhai Pro.

Rank: 7Rank: 7Rank: 7

跳转到指定楼层
楼主
发表于 2011-10-22 18:34:06 |只看该作者 |倒序浏览
預覽:http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview
  1. from tcaxPy import *

  2. def tcaxPy_Init():
  3.     # Tips: initialize your global variables here
  4.     global _FontSize
  5.     global pyFont
  6.     _FontSize = GetVal(val_FontSize)
  7.     pyFont    = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), GetVal(val_FontSize), GetVal(val_Spacing), GetVal(val_SpaceScale), 0x0000FF, 0, 0)




  8. def tcaxPy_Main(_I, _J, _N, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
  9.     ASS_BUF = []        # used for saving ASS FX lines
  10.     global _FontSize
  11.     global pyFont
  12.     _FontSize = GetVal(val_FontSize)
  13.     pyFont    = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), GetVal(val_FontSize), GetVal(val_Spacing), GetVal(val_SpaceScale), 0x0000FF, 0, 0)
  14.     if _I >4 and _I<11:
  15.         if _I%2 == 1:
  16.             ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,0)+pos(_X-360,_Y), _TXT)
  17.             ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,1),bord(4)+blur(8)+color3("0080FF")+color1("FFFFFF")+pos(_X-360,_Y), _TXT)
  18.             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)
  19.             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)
  20.             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)
  21.             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)
  22.         else:
  23.             ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,100)+pos(_X+360,_Y), _TXT)
  24.             ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,1),bord(4)+blur(8)+color3("0080FF")+color1("FFFFFF")+pos(_X+360,_Y), _TXT)
  25.             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)
  26.             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)
  27.             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)
  28.             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)
  29.     elif _I == 11 or _I==12:
  30.         PIX = TextPix(pyFont, _TXT)
  31.         InitPosX = _X - int(_A / 2 + 0.5) + PIX[0][0]                # left most position of the pixels in PIX
  32.         InitPosY = _Y - int(_FontSize / 2 + 0.5) + PIX[0][1]        # upper most position of the pixels in PIX
  33.         X_list = []
  34.         Y_list = []
  35.         for h in range(PIX[1][1]):
  36.             PosY  = InitPosY + h                                        # y-position of the current pixel

  37.             for w in range(PIX[1][0]):
  38.                 PosX = InitPosX + w                                        # x-position of the current pixel
  39.                 X = PosX
  40.                 Y = PosY
  41.          
  42.                 idx  = 4 * (h * PIX[1][0] + w)
  43.                 PixR = PIX[2][idx + 0]
  44.                 PixG = PIX[2][idx + 1]
  45.                 PixB = PIX[2][idx + 2]
  46.                 PixA = PIX[2][idx + 3]
  47.                 if PixA == 255:
  48.                     if randint(0,5) == 1:
  49.                         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())

  50.         for i in range (10):
  51.             for j in range(2):
  52.                 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())





  53.         ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,0)+pos(_X,_Y), _TXT)
  54.         ass_main(ASS_BUF, SubL(_BT+_SK,_ET,1),fad(0,100)+pos(_X,_Y)+color1("FFFFFF"), _TXT)




  55.     elif _I== 13 or _I == 14:

  56.         ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),fad(100,0)+pos(_X,_Y), _TXT)
  57.         
  58.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 30,1),pos(_X,_Y)+bord(2)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
  59.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 30,2),pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
  60.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 30,3),pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)

  61.         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)
  62.         for i in range(int((_ET-_BT-_SK)/10)):
  63.             for j in range (5):
  64.                 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}")


  65.         if _I == 14:
  66.             for i in range(50):
  67.                 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}")



  68.     else:
  69.         if _I !=4:
  70.             ass_main(ASS_BUF, SubL(_BT-55,_BT,1),fad(100,100)+pos(_X,_Y)+bord(2)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
  71.             ass_main(ASS_BUF, SubL(_BT-55,_BT,2),fad(100,100)+pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
  72.             ass_main(ASS_BUF, SubL(_BT-55,_BT,3),fad(100,100)+pos(_X,_Y)+bord(0)+blur(5)+color1("FFFFFF")+color3("FFFFFF"), _TXT)
  73.         ass_main(ASS_BUF, SubL(_BT,_BT+_SK,1),pos(_X,_Y), _TXT)


  74.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+ 20,2),bord(3)+blur(3)+color1("000000")+color3("FFFFFF")+pos(_X,_Y), _TXT)
  75.         ass_main(ASS_BUF, SubL(_BT+_SK+20,_ET,2),pos(_X,_Y)+bord(3)+blur(3)+color1("000000")+color3("FFFFFF"), _TXT)
  76.    



  77.         for i in range(4):
  78.    
  79.             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)
  80.             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)

  81.         for i in range(6):
  82.             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}")


  83.     return (ASS_BUF, None)


  84. def tcaxPy_Fin():
  85.     # Tips: finalize your global variables here
  86.     FinFont(pyFont)
复制代码
1

查看全部评分

您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-11-25 05:50

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH