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

 找回密码
 新人加入
查看: 4136|回复: 1

[完整特效] [SAI]020_nichijouED1 [复制链接]

Administrator

Shanzhai Pro.

Rank: 7Rank: 7Rank: 7

发表于 2011-10-22 18:42:52 |显示全部楼层
預覽: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 raw TCS FX data


  10.     C = ["FFB9E5","B9FFFF","DBC7FF","01FFFF","FFFFC4","FFCEFF","ABFFD4"]

  11.     COLOR=[ "0000FF", "0080FF","00FFFF","00FF00","FF0000","FFFF00","800080" ]
  12.     fc = COLOR[randint(0,6)]
  13.     mc = C[randint(0,6)]
  14.     A = randint(-180,180)


  15.     """
  16.     if _I == 8:

  17.         PIX = TextPix(pyFont, _TXT)
  18.         InitPosX = _X - int(_A / 2 + 0.5) + PIX[0][0]                # left most position of the pixels in PIX
  19.         InitPosY = _Y - int(_FontSize / 2 + 0.5) + PIX[0][1]        # upper most position of the pixels in PIX
  20.         X_list = []
  21.         Y_list = []
  22.         for h in range(PIX[1][1]):
  23.             PosY  = InitPosY + h                                        # y-position of the current pixel

  24.             for w in range(PIX[1][0]):
  25.                 PosX = InitPosX + w                                        # x-position of the current pixel
  26.                 X = PosX
  27.                 Y = PosY
  28.          
  29.                 idx  = 4 * (h * PIX[1][0] + w)
  30.                 PixR = PIX[2][idx + 0]
  31.                 PixG = PIX[2][idx + 1]
  32.                 PixB = PIX[2][idx + 2]
  33.                 PixA = PIX[2][idx + 3]
  34.                 if PixA == 255:
  35.                     if randint(0,20) == 1:
  36.                         ass_main(ASS_BUF, SubL(_BT+_SK-5+randint(-2,5),_BT+_SK+120+randint(-10,10),15),mov(X,Y+40,X-100+randint(-30,30),Y+120+randint(-30,30))+fad(20,300)+fs(10)+bord(2)+blur(3)+color3("FCFF9E")+color1("FCFF9E")+alpha1(20)+alpha3(100)+t(frz(360)+fs(25)), "★")
  37.         ass_main(ASS_BUF, SubL(_BT,_BT+_SK,10),fad(200,100)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y+40), _TXT)
  38.     """

  39.     if _I == 6 :
  40.         ass_main(ASS_BUF, SubL(_BT-5,_BT+_SK+_KT,10),fad(200,0)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y), _TXT)
  41.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET,10),fad(0,200)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y), _TXT)

  42.         if _KT <= 40 :
  43.             ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+68,30),pos(_X,_Y)+fad(50,50)+color1(fc)+color3("FFFFFF")+blur(3)+alpha3(50)+alpha4(255)+bord(0)+shad(1), _TXT)
  44.         else:
  45.             ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+_KT,30),pos(_X,_Y)+fad(50,50)+color1(fc)+color3("FFFFFF")+blur(3)+alpha3(50)+alpha4(255)+bord(0)+shad(1), _TXT)
  46.         ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+_KT+30,1),color1(mc)+fad(50,250)+fs(70)+color3(mc)+blur(8)+alpha3(50)+bord(3)+shad(0)+pos(_X,_Y)+frz(A)+t(frz(A-3*_KT)), "★")

  47.     elif _I == 7:
  48.         ass_main(ASS_BUF, SubL(_BT-5,_BT+_SK+_KT,10),fad(200,0)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y), _TXT)
  49.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET,10),fad(0,200)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y), _TXT)

  50.         if _KT <= 40 :
  51.             ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+68,30),pos(_X,_Y)+fad(50,50)+color1(fc)+color3("FFFFFF")+blur(3)+alpha3(50)+alpha4(255)+bord(0)+shad(1), _TXT)
  52.         else:
  53.             ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+_KT,30),pos(_X,_Y)+fad(50,50)+color1(fc)+color3("FFFFFF")+blur(3)+alpha3(50)+alpha4(255)+bord(0)+shad(1), _TXT)
  54.         ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+_KT+30,1),color1(mc)+fad(50,250)+fs(70)+color3(mc)+blur(8)+alpha3(50)+bord(3)+shad(0)+pos(_X,_Y)+frz(A)+t(frz(A+3*_KT)), "★")


  55.     else:
  56.         ass_main(ASS_BUF, SubL(_BT-5,_BT+_SK+_KT,10),fad(200,0)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y), _TXT)
  57.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET,10),fad(0,200)+color1("FFFFFF")+color3("000000")+blur(3)+alpha3(50)+bord(1)+shad(1)+pos(_X,_Y), _TXT)
  58.         if _KT <= 40 :
  59.             ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+68,30),pos(_X,_Y)+fad(50,50)+color1(fc)+color3("FFFFFF")+blur(3)+alpha3(50)+alpha4(255)+bord(0)+shad(1), _TXT)
  60.         else:
  61.             ass_main(ASS_BUF, SubL(_BT+_SK-5,_BT+_SK+_KT,30),pos(_X,_Y)+fad(50,50)+color1(fc)+color3("FFFFFF")+blur(3)+alpha3(50)+alpha4(255)+bord(0)+shad(1), _TXT)

  62.         for i in range(_BT+_SK-5,_BT+_SK-5+_KT,68):
  63.             Y = (i - _BT-_SK+5)%272
  64.             if Y == 0:
  65.                 x = 1
  66.                 y = -1
  67.             elif Y == 136:
  68.                 x = 1
  69.                 y = 1
  70.             else:
  71.                 x = 0
  72.                 y = 0
  73.             ass_main(ASS_BUF, SubL(i,i+68,1),color1(mc)+fad(50,100)+fs(60)+color3(mc)+blur(3)+alpha3(50)+bord(1)+shad(0)+pos(_X,_Y)+fscx(130-30*x+randint(-5,5))+fscy(130-30*x+randint(-5,5))+frz(A+120*y), "★")


  74.     return (ASS_BUF,None)


  75. def tcaxPy_Fin():
  76.     # Tips: finalize your global variables here
  77.     FinFont(pyFont)
复制代码
2

查看全部评分

Rank: 4

发表于 2012-11-14 00:04:53 |显示全部楼层
好好学习,天天向上
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-7-18 16:31

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH