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

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

[完整特效] [youkaze]018_Chuunibyou_OP [复制链接]

Moderator

youkaze

Rank: 5Rank: 5

跳转到指定楼层
楼主
发表于 2012-11-27 12:44:24 |只看该作者 |倒序浏览
  1. from tcaxPy import *
  2. from gdiFont import *
  3. from s import *

  4. def tcaxPy_Init():

  5.     global _FontFileName
  6.     global _FaceID
  7.     global _Fs
  8.     global _TextWidth
  9.     global _TextHeight
  10.     global _TextLength
  11.     global _TextAdvDiff
  12.     global _ResolutionX
  13.     global _FD
  14.     global GdiFont   #GDIfont
  15.     global Font


  16.     _FontFileName = GetVal(val_FontFileName)
  17.     _FaceID       = GetVal(val_FaceID)
  18.     _Fs           = GetVal(val_FontSize)
  19.     _TextHeight   = GetVal(val_TextHeight)
  20.     _TextWidth    = GetVal(val_TextWidth)
  21.     _TextLength   = GetVal(val_TextLength)
  22.     _TextAdvDiff  = GetVal(val_TextAdvanceDiff)
  23.     _ResolutionX  = GetVal(val_ResolutionX)
  24.     _FD           = 1000 / GetVal(val_FXFPS)
  25.     GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False)    #GDIfont
  26.    
  27.     Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
  28.    

  29. def tcaxPy_Fin():
  30.     gfFinFont(GdiFont)    #GDIfont
  31.    
  32.     FinFont(Font)


  33. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
  34.     ASS_BUF = []

  35.    

  36.     if _i < 3 or _i == 21:
  37.         R = randint(0,15)
  38.         dx = _x - int((_a + GetVal(val_Spacing)) / 2 + 0.5)
  39.         dy = _y - int(_Fs / 2 + 0.5)
  40.         
  41.         COLOR1 = vc1('E9C4BC','E9C4BC','E9865E','E9865E')
  42.         COLOR2 = vc1('E9865E','E9865E','E9C4BC','E9C4BC')
  43.         COLOR3 = vc1('E9C4BC','E9865E','E9C4BC','E4987E')
  44.         COLOR4 = vc1('E9865E','E9C4BC','E9865E','E9C4BC')
  45.         COLOR = [COLOR1,COLOR2,COLOR3,COLOR4]
  46.         RCOLOR = COLOR[randint(0,3)]
  47.         
  48.         mask1 = gfGetOutline(GdiFont, _txt, dx-_ResolutionX/2+_TextLength[_i]/2, dy)    #GDIfont 中間
  49.         
  50.             
  51.         ass_main(ASS_BUF, SubL(_BT-8+_j*5,_ET+_j*5,3),an(5)+pos(_x-_ResolutionX/2+_TextLength[_i]/2, _y)+color3("8F371A")+fad(200,0)+bord(4), _txt)
  52.         ass_main(ASS_BUF, SubL(_BT-8+_j*5,_ET+_j*5,3),an(5)+pos(_x-_ResolutionX/2+_TextLength[_i]/2, _y)+RCOLOR+fad(200,0)+bord(2), _txt)
  53.         
  54.         for a in range(_BT-8+_j*5,_BT+_SK+20,8):
  55.             MOV = move(_x-_ResolutionX/2+_TextLength[_i]/2, _y,_x-_ResolutionX/2+_TextLength[_i]/2+randint(-20,20), _y+randint(-20,20))
  56.             ass_main(ASS_BUF, SubL(a,a+50,3),an(7)+MOV+color1("FFFFFF")+fad(200,200)+bord(0)+frz(randint(0,360))+blur(2.5)+clip2(4, mask1)+p(3), "m -11 -11 l -11 -3 l -14 12 l 5 13 l 10 2 l 14 -13 ")
  57.         
  58.         ass_main(ASS_BUF, SubL(_BT+_SK-10,_BT+_SK+_KT+10,7),pos(_x-_ResolutionX/2+_TextLength[_i]/2, _y)+color1("6228E3")+t(200,_KT,color1("9D6217"))+bord(0), _txt)
  59.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT+10,_ET+_j*5,7),pos(_x-_ResolutionX/2+_TextLength[_i]/2, _y)+color1("9D6217")+bord(0), _txt)
  60.         
  61.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-_ResolutionX/2+_TextLength[_i]/2, _y,_x-_ResolutionX/2+_TextLength[_i]/2, _y-_Fs-10)+color3("8F371A")+fad(0,200)+bord(4), _txt)
  62.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-_ResolutionX/2+_TextLength[_i]/2, _y,_x-_ResolutionX/2+_TextLength[_i]/2, _y-_Fs-10)+color1("9D6217")+fad(0,200)+bord(2), _txt)
  63.         
  64.         
  65.     if _i == 3 or _i == 6 or _i == 9:    #左邊
  66.         dx = _x - int((_a + GetVal(val_Spacing)) / 2 + 0.5)
  67.         dy = _y - int(_Fs / 2 + 0.5)
  68.         
  69.         ass_main(ASS_BUF, SubL(_BT+_SK-100,_ET+_j*5,3),an(5)+move(_x-_ResolutionX+_TextLength[_i]+23, _y-_Fs-10,_x-_ResolutionX+_TextLength[_i]+23, _y,0,400)+fad(200,0)+color1("000000")+fscx(_a*100/10)+fscy(380)+bord(0), "{\p1}m 0 0 b 0 3 0 7 0 10 b 3 10 7 10 10 10 b 10 7 10 3 10 0 b 7 0 3 0 0 0 {\p0}")
  70.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-_ResolutionX+_TextLength[_i]+23, _y,_x-_ResolutionX+_TextLength[_i]+23, _y-_Fs-10)+fad(0,200)+color1("000000")+fscx(_a*100/10)+fscy(380)+bord(0), "{\p1}m 0 0 b 0 3 0 7 0 10 b 3 10 7 10 10 10 b 10 7 10 3 10 0 b 7 0 3 0 0 0 {\p0}")
  71.         
  72.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET+_j*5,3),an(5)+pos(_x-_ResolutionX+_TextLength[_i]+25, _y)+color1("D8D8D8")+bord(0), _txt)
  73.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-_ResolutionX+_TextLength[_i]+25, _y,_x-_ResolutionX+_TextLength[_i]+25, _y-_Fs-10)+color1("D8D8D8")+bord(0), _txt)
  74.         
  75.         bx = _x - int(_a / 2 + 0.5)-_ResolutionX+_TextLength[_i]+25-1
  76.         by = _y - int(_Fs / 2 + 0.5)-1
  77.         CLIP = clip(bx,by,bx+_a+20,by+_Fs+5)
  78.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_BT+_SK+_KT+50,3),an(5)+CLIP+move(_x-_ResolutionX+_TextLength[_i]+25, _y,_x-_ResolutionX+_TextLength[_i]+25, _y+_Fs+10)+color1("000000")+bord(0), _txt)
  79.         
  80.         outline = TextOutlinePoints(Font, _txt, 1.0)
  81.         num = len(outline)
  82.         for i in range(num):
  83.             ts1 = _BT + _SK +int(i/num*_KT)-20
  84.             te1 = _BT + _SK +int(i/num*_KT)+50
  85.             x = dx + outline[i][0]-_ResolutionX+_TextLength[_i]+24
  86.             y = dy + outline[i][1]
  87.             EFT = pos(x, y)+alpha1(0)+alpha3(0)+bord(0.5)+blur(2)+shad(0)+color3('FFFFFF')+color1('FFFFFF')+fad(200, 200)
  88.             ass_main(ASS_BUF, SubL(ts1, te1, 3, Pix_Style), EFT, PixPt())
  89.             
  90.             
  91.             
  92.     if _i == 4 or _i == 5 or _i == 7 or _i == 8 or _i == 10:   #右邊
  93.         dx = _x - int((_a + GetVal(val_Spacing)) / 2 + 0.5)
  94.         dy = _y - int(_Fs / 2 + 0.5)
  95.         
  96.         ass_main(ASS_BUF, SubL(_BT+_SK-100,_ET+_j*5,3),an(5)+move(_x-2, _y-_Fs-10,_x-2, _y,0,400)+fad(200,0)+color1("000000")+fscx(_a*100/10)+fscy(380)+bord(0), "{\p1}m 0 0 b 0 3 0 7 0 10 b 3 10 7 10 10 10 b 10 7 10 3 10 0 b 7 0 3 0 0 0 {\p0}")
  97.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-2, _y,_x-2, _y-_Fs-10)+fad(0,200)+color1("000000")+fscx(_a*100/10)+fscy(380)+bord(0), "{\p1}m 0 0 b 0 3 0 7 0 10 b 3 10 7 10 10 10 b 10 7 10 3 10 0 b 7 0 3 0 0 0 {\p0}")
  98.         
  99.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET+_j*5,3),an(5)+pos(_x, _y)+color1("D8D8D8")+bord(0), _txt)
  100.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x, _y,_x, _y-_Fs-10)+color1("D8D8D8")+bord(0), _txt)
  101.         
  102.         bx = _x - int(_a / 2 + 0.5)-1
  103.         by = _y - int(_Fs / 2 + 0.5)-1
  104.         CLIP = clip(bx,by,bx+_a+20,by+_Fs+5)
  105.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_BT+_SK+_KT+50,3),an(5)+CLIP+move(_x, _y,_x, _y+_Fs+10)+color1("000000")+bord(0), _txt)
  106.         
  107.         
  108.         outline = TextOutlinePoints(Font, _txt, 1.0)
  109.         num = len(outline)
  110.         for i in range(num):
  111.             ts1 = _BT + _SK +int(i/num*_KT)-20
  112.             te1 = _BT + _SK +int(i/num*_KT)+50
  113.             x = dx + outline[i][0]
  114.             y = dy + outline[i][1]
  115.             EFT = pos(x, y)+alpha1(0)+alpha3(0)+bord(0.5)+blur(2)+shad(0)+color3('FFFFFF')+color1('FFFFFF')+fad(200, 200)
  116.             ass_main(ASS_BUF, SubL(ts1, te1, 3, Pix_Style), EFT, PixPt())
  117.             
  118.     if _i == 11 or _i > 10 and _i < 21:
  119.         dx = _x - int((_a + GetVal(val_Spacing)) / 2 + 0.5)
  120.         dy = _y - int(_Fs / 2 + 0.5)
  121.         
  122.         ass_main(ASS_BUF, SubL(_BT+_SK-100,_ET+_j*5,3),an(5)+move(_x-_ResolutionX/2+_TextLength[_i]/2+12, _y-_Fs-10,_x-_ResolutionX/2+_TextLength[_i]/2+10, _y,0,400)+fad(200,0)+color1("000000")+fscx(_a*100/10)+fscy(380)+bord(0), "{\p1}m 0 0 b 0 3 0 7 0 10 b 3 10 7 10 10 10 b 10 7 10 3 10 0 b 7 0 3 0 0 0 {\p0}")
  123.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-_ResolutionX/2+_TextLength[_i]/2+12, _y,_x-_ResolutionX/2+_TextLength[_i]/2+10, _y-_Fs-10)+fad(0,200)+color1("000000")+fscx(_a*100/10)+fscy(380)+bord(0), "{\p1}m 0 0 b 0 3 0 7 0 10 b 3 10 7 10 10 10 b 10 7 10 3 10 0 b 7 0 3 0 0 0 {\p0}")
  124.         
  125.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET+_j*5,3),an(5)+pos(_x-_ResolutionX/2+_TextLength[_i]/2+12, _y)+color1("D8D8D8")+bord(0), _txt)
  126.         ass_main(ASS_BUF, SubL(_ET+_j*5,_ET+15+_j*5,3),an(5)+move(_x-_ResolutionX/2+_TextLength[_i]/2+12, _y,_x-_ResolutionX/2+_TextLength[_i]/2+12, _y-_Fs-10)+color1("D8D8D8")+bord(0), _txt)
  127.         
  128.         bx = _x - int(_a / 2 + 0.5)-1-_ResolutionX/2+_TextLength[_i]/2
  129.         by = _y - int(_Fs / 2 + 0.5)-1
  130.         CLIP = clip(bx,by,bx+_a+20,by+_Fs+5)
  131.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_BT+_SK+_KT+50,3),an(5)+CLIP+move(_x-_ResolutionX/2+_TextLength[_i]/2+12, _y,_x-_ResolutionX/2+_TextLength[_i]/2+12, _y+_Fs+10)+color1("000000")+bord(0), _txt)
  132.         
  133. #有沒有粒子映射
  134. #        outline = TextOutlinePoints(Font, _txt, 1.0)
  135. #        outnline = TextOutlinePoints(_FontFileName, _FaceID, 45, _txt, 1.0)
  136. #        outnum = len(outline)
  137. #        outnnum = len(outnline)
  138. #        num = max(outnum,outnnum)
  139. #        for i in range(outnum):
  140. #            indice_out = i
  141. #            indice_toun = randint(0, outnum - 1)
  142.             
  143. #            ts1 = _BT + _SK +int(i/num*_KT)-20
  144. #            te1 = _BT + _SK +int(i/num*_KT)+50
  145. #            x = dx + outline[i][0]-_ResolutionX/2+_TextLength[_i]/2+12
  146. #            y = dy + outline[i][1]
  147.             
  148. #            x1 = dx + outnline[indice_toun][0]-_ResolutionX/2+_TextLength[_i]/2+5
  149. #            y1 = dy + outnline[indice_toun][1]-5
  150. #            EFT = move(x, y, x1, y1, 100,700)+alpha1(0)+alpha3(0)+bord(0.5)+blur(2)+shad(0)+color3('D6ABFF')+color1('D6ABFF')+fad(200, 200)
  151. #            ass_main(ASS_BUF, SubL(ts1, te1, 3, Pix_Style), EFT, PixPt())
  152.             
  153.             
  154.             
  155. #沒有粒子映射
  156.         outline = TextOutlinePoints(Font, _txt, 1.0)
  157.         outnline = TextOutlinePoints(_FontFileName, _FaceID, 45, _txt, 1.0)
  158.         num = len(outline)
  159.         for i in range(num):
  160.             ts1 = _BT + _SK +int(i/num*_KT)-20
  161.             te1 = _BT + _SK +int(i/num*_KT)+50
  162.             x = dx + outline[i][0]-_ResolutionX/2+_TextLength[_i]/2+12
  163.             y = dy + outline[i][1]
  164.             
  165.             x1 = dx + outnline[i][0]-_ResolutionX/2+_TextLength[_i]/2+5
  166.             y1 = dy + outnline[i][1]-5
  167.             EFT = mov(x, y, x1, y1)+alpha1(0)+alpha3(0)+bord(0.5)+blur(2)+shad(0)+color3('D6ABFF')+color1('D6ABFF')+fad(0, 300)
  168.             ass_main(ASS_BUF, SubL(ts1, te1, 3, Pix_Style), EFT, PixPt())
  169.             
  170.         
  171.     return (ASS_BUF, None)
复制代码
老样子一些东西写了没用 没整理 预览群邮了
4

查看全部评分

Rank: 5Rank: 5

沙发
发表于 2012-11-27 15:41:38 |只看该作者
高端又洋气,我要坐沙发。

Moderator

疯子

Rank: 5Rank: 5

板凳
发表于 2012-11-28 18:06:55 |只看该作者
终于把脚本都丢出来啊

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

地板
发表于 2012-12-1 18:28:31 |只看该作者
以为是双刀流... 很像是双刀流啊
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-11-22 11:10

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH