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

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

[完整特效] [SAI]009_mmOP2 [复制链接]

Administrator

Shanzhai Pro.

Rank: 7Rank: 7Rank: 7

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

這個 分了4個腳本 這是左邊日文。。。
  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.     ass_main(ASS_BUF, SubL(_BT+(_J-1)*5,_BT+_J*5,3),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)
  11.     ass_main(ASS_BUF, SubL(_BT+(_J-1)*5,_BT+_J*5,3),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)
  12.     ass_main(ASS_BUF, SubL(_BT+(_J-1)*5,_BT+_J*5,3),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)


  13.     ass_main(ASS_BUF, SubL(_BT+_J*5,_BT+_SK,1),pos(_X,_Y)+bord(1)+shad(2)+color1('FFC0A9')+color3('700002'), _TXT)


  14.     ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(2)+blur(6)+color1('FFFFFF')+color3('700002'), _TXT)
  15.     ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)
  16.     ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)
  17.     ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(2)+blur(6)+alpha1(255)+color3('700002'), _TXT)
  18.     PIX = TextPix(pyFont, _TXT)
  19.     InitPosX = _X - int(_A / 2 + 0.5) + PIX[0][0]                # left most position of the pixels in PIX
  20.     InitPosY = _Y - int(_FontSize / 2 + 0.5) + PIX[0][1]        # upper most position of the pixels in PIX
  21.     X_list = []
  22.     Y_list = []
  23.     for h in range(PIX[1][1]):
  24.         PosY  = InitPosY + h                                        # y-position of the current pixel

  25.         for w in range(PIX[1][0]):
  26.             PosX = InitPosX + w                                        # x-position of the current pixel

  27.             X = PosX
  28.             Y = PosY
  29.             
  30.             idx  = 4 * (h * PIX[1][0] + w)
  31.             PixR = PIX[2][idx + 0]
  32.             PixG = PIX[2][idx + 1]
  33.             PixB = PIX[2][idx + 2]
  34.             PixA = PIX[2][idx + 3]
  35.             if PixA != 0:
  36.                 Y_list.append(PosY)   
  37.                 X_list.append(PosX)  
  38.     B = Y_list[randint(0,len(Y_list)-1)]   
  39.     A = X_list[randint(0,len(Y_list)-1)]


  40.    
  41.     distance = []
  42.     for h in range(PIX[1][1]):
  43.         PosY  = InitPosY + h                                        # y-position of the current pixel
  44.         for w in range(PIX[1][0]):
  45.             PosX = InitPosX + w                                        # x-position of the current pixel
  46.             X = PosX
  47.             Y = PosY

  48.             idx  = 4 * (h * PIX[1][0] + w)
  49.             PixR = PIX[2][idx + 0]
  50.             PixG = PIX[2][idx + 1]
  51.             PixB = PIX[2][idx + 2]
  52.             PixA = PIX[2][idx + 3]
  53.             if PixA != 0:
  54.                 import math
  55.                 d = int(math.sqrt((X-A)**2+(Y-B)**2))
  56.                 distance.append(d)   
  57.     dmax = max(distance)
  58.     Color = DivClr('FFFFFF','EC9F00',int(dmax))  
  59.   
  60.     for h in range(PIX[1][1]):
  61.         PosY  = InitPosY + h                                        # y-position of the current pixel
  62.         for w in range(PIX[1][0]):
  63.             PosX = InitPosX + w                                        # x-position of the current pixel
  64.             X = PosX
  65.             Y = PosY

  66.             idx  = 4 * (h * PIX[1][0] + w)
  67.             PixR = PIX[2][idx + 0]
  68.             PixG = PIX[2][idx + 1]
  69.             PixB = PIX[2][idx + 2]
  70.             PixA = PIX[2][idx + 3]
  71.             if PixA != 0:                                        # skip transparent pixels
  72.                 import math
  73.                 d = int(math.sqrt((X-A)**2+(Y-B)**2))-1


  74.                 ass_main(ASS_BUF, SubL(_BT+_SK+15,_ET+_J*5),pos(X,Y)+bord(0)+alpha1(255-PixA)+color1(Color[d]), PixPt())
  75.                 ass_main(ASS_BUF, SubL(_BT+_SK+15,_ET+_J*5),pos(X,Y)+bord(0)+alpha1(255-PixA)+color1(Color[d]), PixPt())

  76.     ass_main(ASS_BUF, SubL(_BT+_SK+15,_ET+_J*5,1),pos(_X,_Y)+bord(2)+blur(6)+alpha1(255)+color3('700002'), _TXT)

  77.     ass_main(ASS_BUF, SubL(_ET+(_J-1)*5,_ET+_J*5+40,1),pos(_X-randint(5,15),_Y-randint(5,15))+an(7)+bord(3)+alpha1(255)+color3('700002')+fscx(11)+fscy(11)+t1(0,400,bord(2)+fscx(330)+fscy(330)+fad(0,200)), '{\p1}m 10 10 s 10 -10 -10 -10 -10 10 c{\p0}')
  78.     ass_main(ASS_BUF, SubL(_ET+(_J-1)*5+randint(0,5),_ET+_J*5+40,1),pos(_X+randint(-15,15),_Y+randint(-15,15))+an(7)+bord(3)+alpha1(255)+color3('700002')+fscx(11)+fscy(11)+t1(0,400,bord(2)+fscx(330)+fscy(330)+fad(0,300)), '{\p1}m 10 10 s 10 -10 -10 -10 -10 10 c{\p0}')
  79.     ass_main(ASS_BUF, SubL(_ET+(_J-1)*5+randint(3,5),_ET+_J*5+40,1),pos(_X+randint(5,15),_Y+randint(5,15))+an(7)+bord(3)+alpha1(255)+color3('700002')+fscx(11)+fscy(11)+t1(0,400,bord(2)+fscx(330)+fscy(330)+fad(0,200)), '{\p1}m 10 10 s 10 -10 -10 -10 -10 10 c{\p0}')


  80.     return (ASS_BUF,None)


  81. def tcaxPy_Fin():
  82.     # Tips: finalize your global variables here
  83.     FinFont(pyFont)
复制代码
1

查看全部评分

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

沙发
发表于 2011-10-28 17:05:12 |只看该作者
原来这个不是用Mask做的

看了代码, 还真是EP呢...

Rank: 4

板凳
发表于 2012-11-14 00:04:44 |只看该作者
好好学习,天天向上
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-4-20 07:55

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH