TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua
标题:
[SAI]009_mmOP2
[打印本页]
作者:
saiyaku
时间:
2011-10-22 19:34:50
标题:
[SAI]009_mmOP2
預覽:
http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview
這個 分了4個腳本 這是左邊日文。。。
from tcaxPy import *
def tcaxPy_Init():
# Tips: initialize your global variables here
global _FontSize
global pyFont
_FontSize = GetVal(val_FontSize)
pyFont = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), GetVal(val_FontSize), GetVal(val_Spacing), GetVal(val_SpaceScale), 0x0000FF, 0, 0)
def tcaxPy_Main(_I, _J, _N, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
ASS_BUF = [] # used for saving raw TCS FX data
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)
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)
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)
ass_main(ASS_BUF, SubL(_BT+_J*5,_BT+_SK,1),pos(_X,_Y)+bord(1)+shad(2)+color1('FFC0A9')+color3('700002'), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(2)+blur(6)+color1('FFFFFF')+color3('700002'), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(0)+blur(3)+color1('FFFFFF')+color3('FFFFFF'), _TXT)
ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+15,2),pos(_X,_Y)+bord(2)+blur(6)+alpha1(255)+color3('700002'), _TXT)
PIX = TextPix(pyFont, _TXT)
InitPosX = _X - int(_A / 2 + 0.5) + PIX[0][0] # left most position of the pixels in PIX
InitPosY = _Y - int(_FontSize / 2 + 0.5) + PIX[0][1] # upper most position of the pixels in PIX
X_list = []
Y_list = []
for h in range(PIX[1][1]):
PosY = InitPosY + h # y-position of the current pixel
for w in range(PIX[1][0]):
PosX = InitPosX + w # x-position of the current pixel
X = PosX
Y = PosY
idx = 4 * (h * PIX[1][0] + w)
PixR = PIX[2][idx + 0]
PixG = PIX[2][idx + 1]
PixB = PIX[2][idx + 2]
PixA = PIX[2][idx + 3]
if PixA != 0:
Y_list.append(PosY)
X_list.append(PosX)
B = Y_list[randint(0,len(Y_list)-1)]
A = X_list[randint(0,len(Y_list)-1)]
distance = []
for h in range(PIX[1][1]):
PosY = InitPosY + h # y-position of the current pixel
for w in range(PIX[1][0]):
PosX = InitPosX + w # x-position of the current pixel
X = PosX
Y = PosY
idx = 4 * (h * PIX[1][0] + w)
PixR = PIX[2][idx + 0]
PixG = PIX[2][idx + 1]
PixB = PIX[2][idx + 2]
PixA = PIX[2][idx + 3]
if PixA != 0:
import math
d = int(math.sqrt((X-A)**2+(Y-B)**2))
distance.append(d)
dmax = max(distance)
Color = DivClr('FFFFFF','EC9F00',int(dmax))
for h in range(PIX[1][1]):
PosY = InitPosY + h # y-position of the current pixel
for w in range(PIX[1][0]):
PosX = InitPosX + w # x-position of the current pixel
X = PosX
Y = PosY
idx = 4 * (h * PIX[1][0] + w)
PixR = PIX[2][idx + 0]
PixG = PIX[2][idx + 1]
PixB = PIX[2][idx + 2]
PixA = PIX[2][idx + 3]
if PixA != 0: # skip transparent pixels
import math
d = int(math.sqrt((X-A)**2+(Y-B)**2))-1
ass_main(ASS_BUF, SubL(_BT+_SK+15,_ET+_J*5),pos(X,Y)+bord(0)+alpha1(255-PixA)+color1(Color[d]), PixPt())
ass_main(ASS_BUF, SubL(_BT+_SK+15,_ET+_J*5),pos(X,Y)+bord(0)+alpha1(255-PixA)+color1(Color[d]), PixPt())
ass_main(ASS_BUF, SubL(_BT+_SK+15,_ET+_J*5,1),pos(_X,_Y)+bord(2)+blur(6)+alpha1(255)+color3('700002'), _TXT)
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}')
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}')
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}')
return (ASS_BUF,None)
def tcaxPy_Fin():
# Tips: finalize your global variables here
FinFont(pyFont)
复制代码
作者:
milkyjing
时间:
2011-10-28 17:05:12
原来这个不是用Mask做的
看了代码, 还真是EP呢...
作者:
靠不住
时间:
2012-11-14 00:04:44
好好学习,天天向上
欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/)
Powered by Discuz! X2