TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua
标题:
[SAI]046_prismaillya2weiOP
[打印本页]
作者:
saiyaku
时间:
2014-8-1 14:49:14
标题:
[SAI]046_prismaillya2weiOP
預覽:
http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview
from util.gdiFont import *
from tcaxPy import *
from s import *
def tcaxPy_Init():
global _FontFileName
global _FaceID
global _Fs
global _Height
global Font
global GdiFont
_FontFileName = GetVal(val_FontFileName)
_FaceID = GetVal(val_FaceID)
_Fs = GetVal(val_FontSize)
_Height = GetVal(val_TextHeight)
Font = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False)
def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
ASS_BUF = []
clr3 = "881988"
if _i == 8 or _i == 10:
_Y -= _Fs+10
dx1 = _X - int(_A / 2 + 0.5)
dy1 = _Y - int(_Fs / 2 + 0.5)
outline = gfGetOutline(GdiFont, _TXT, dx1, dy1)
ts = _BT + _SK-5
te = ts + _KT
#發光前
ass_main(ASS_BUF, SubL(_BT-15, ts,10), an(7)+fad(150,0) + pos(_X+randint(-16,16), _Y+randint(-16,16))+color1("FA68EB")+blur(8) + clip2(4, outline), "{\p1}m 15 15 s 15 -15 -15 -15 -15 15 c{\p0}")
ass_main(ASS_BUF, SubL(_BT-15, ts,2), an(7)+fad(150,0) + pos(0, 0) + bord(2.5)+color3(clr3)+p(4),outline )
ass_main(ASS_BUF, SubL(_BT-15, ts,1), an(7)+fad(150,0) + pos(0, 0) + bord(3)+blur(4)+color3("8045F8")+p(4),outline )
#發光後
ass_main(ASS_BUF, SubL(te, _ET+5,10), an(7)+fad(0,50) + pos(_X+randint(-16,16), _Y+randint(-16,16))+color1("FA68EB")+blur(8) + clip2(4, outline), "{\p1}m 15 15 s 15 -15 -15 -15 -15 15 c{\p0}")
ass_main(ASS_BUF, SubL(te, _ET+5,2), an(7)+fad(0,50) + pos(0, 0) + bord(2.5)+color3(clr3)+p(4),outline )
ass_main(ASS_BUF, SubL(te, _ET+5,1), an(7)+fad(0,50) + pos(0, 0) + bord(3)+blur(4)+color3("8045F8")+p(4),outline )
#發光
ass_main(ASS_BUF, SubL(ts, te,20), an(7) + pos(0, 0) + bord(3)+blur(4)+color3("8446F5")+p(4),outline )
ass_main(ASS_BUF, SubL(ts, te,21), an(7) + pos(0, 0) +alpha(200)+ bord(1.5)+blur(1.5)+color3("FFFFFF")+p(4),outline )
#羽毛
for j in range(5):
POS = RandCirX(_X, _Y, int(_Fs), int(_Fs)+20)
ass_main(ASS_BUF, SubL(_ET+3, _ET+55),an(7)+fad(20,400)+bord(0)+fsc(70,70)+color1("FFFFFF")+frx(randint(-180,180))+fry(randint(-180,180))+frz(randint(-180,180))+t(frx(randint(-180,180))+fry(randint(-180,180))+frz(randint(-180,180)))+mov(POS[0][0],POS[0][1],POS[1][0],POS[1][1]),"{\p1}m 12 -15 b 12 -12 11 -10 9 -7 9 -6 9 -5 9 -4 11 -5 11 -3 8 -3 l 9 -2 6 -1 5 0 3 -2 b -3 12 -20 11 -25 6 -26 5 -25 3 -23 3 -20 3 -9 5 2 -3 l -1 -4 b -1 -6 1 -6 2 -6 2 -7 1 -8 1 -9 2 -9 4 -8 5 -8 4 -10 4 -12 5 -11 6 -11 6 -9 7 -8 9 -10 10 -13 10 -16 c{\p0}")
#光線
PIX = TextPix(Font, _TXT)
points = PixPoints(PIX)
pt_num = len(points)
dx = _X - int(_A / 2 + 0.5) + PIX[0][0]
dy = _Y - int(_Fs / 2 + 0.5) + PIX[0][1]
pp = ''
for i in range(pt_num):
if random() < 0.4:
xr = points[i][0] / PIX[1][0]
yr = points[i][1] / PIX[1][1]
rnd = randint(-40,-5)
pp += ' m %d %d l %d %d %d %d %d %d %d %d'%(dx + points[i][0], dy + points[i][1],dx + points[i][0],dy + points[i][1]+int(40*(100 + f1(yr) * 30)/100+rnd+0.5),dx + points[i][0]+1,dy + points[i][1],dx + points[i][0],dy + points[i][1]-int(40*(100 + f1(yr) * 30)/100+rnd+0.5),dx + points[i][0], dy + points[i][1])
EFT = pos(0 , 0 ) +color1("FD88FF")+ fad(50, 10 * _KT + 200 - 50 - 80) +alpha1(0) + be(1) + p(1)
ass_main(ASS_BUF, SubL(ts, te + 10, 10, Pix_Style), EFT, pp)
return (ASS_BUF, None)
def f1(x):
return pow(abs(x) , 0.5)
def scaleAlpha(a1, a2, scale):
return a1 + (a2 - a1) * scale
def RandCirX(a, b, r1,r2):
R1 = randint(0, r1)
R2 = randint(r1,r2)
theta = randint(0, 2 * 314) / 100.0
x1 = AdvInt(R1 * cos(theta) + a)
y1 = AdvInt(R1 * sin(theta) + b)
x2 = AdvInt(R2 * cos(theta) + a)
y2 = AdvInt(R2 * sin(theta) + b)
return [(x1, y1),(x2,y2)]
复制代码
欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/)
Powered by Discuz! X2