TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua
标题:
[SAI]036_sukitteiinayoED
[打印本页]
作者:
saiyaku
时间:
2012-10-13 20:47:16
标题:
[SAI]036_sukitteiinayoED
預覽:
http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview
沒什麽可說的
from tcaxPy import *
from util.cairo import *
from util.gdiFont import *
def tcaxPy_Init():
global _Fs
global _FD # 一帧的持续时间, 约40毫秒
global _Spacing # 字体间距
global Font # 首要字体
global GdiFont
global _TextWidth # 文字宽度
global _TextHeight # 文字高度
global _TextLength
global _TextAdvDiff
global _ResolutionX
global _OffsetX
_TextHeight = GetVal(val_TextHeight)
_TextWidth = GetVal(val_TextWidth)
_TextLength = GetVal(val_TextLength)
_TextAdvDiff = GetVal(val_TextAdvanceDiff)
_ResolutionX = GetVal(val_ResolutionX)
_OffsetX = GetVal(val_OffsetX)
_Fs = GetVal(val_FontSize)
_FD = 1000 / GetVal(val_FXFPS)
_FontFileName = GetVal(val_FontFileName)
_FaceID = GetVal(val_FaceID)
_Spacing = GetVal(val_Spacing)
Font = InitFont(_FontFileName, _FaceID, _Fs, _Spacing, GetVal(val_SpaceScale), MakeRGB(255, 255, 255), 0, False)
GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False) #GDIfont
# cairo
global ctx
fx_width = GetVal(val_ResolutionX)
fx_height = GetVal(val_ResolutionY)
surface = ImageSurface(FORMAT_ARGB32, fx_width, fx_height)
ctx = Context(surface)
def tcaxPy_Fin():
FinFont(Font)
gfFinFont(GdiFont) #GDIfont
def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
ASS_BUF = [] # 保存ASS特效
TCAS_BUF = [] # 保存TCAS特效
if _i==0:
global bsf
bsf = _BT
bs=75-(_BT-bsf)%75
if _i==2 or _i==3 or _i==6 or _i==8or _i==9or _i==10:
POS=an(5) + pos(_ResolutionX -33-_TextLength[_i]/2, 22)
_X = _ResolutionX - _TextLength[_i] - _OffsetX + _TextAdvDiff[_i][_j]+_A/2
else:
POS=an(5) + pos(33+_TextLength[_i]/2, 22)
if _i > -1:
dx = _X - int(_A / 2 + 0.5)
dy = _Y - int(_Fs / 2 + 0.5)
frames = int((_KT+2)*10 / _FD + 0.5)
for i in range(frames):
ts = _BT+_SK-5 + i * _FD / 10
te = _BT+_SK-5 + (i + 1) * _FD / 10
frame_pct = i / frames
outline = gfGetOutline(GdiFont, _TXT, 0, 0)
AssDraw(ctx, outline)
path_trans(ctx, x_filter,(_A,_X,_Y,frame_pct))
text = ToAssDraw(ctx)
EFT = an(7) + pos(dx,dy) +bord(0.5)+color3("FF0000")+color4("FF0000") + p(4)
ass_main(ASS_BUF, SubL(ts, te,20), EFT, text)
outline = gfGetOutline(GdiFont, _TXT, 0, 0)
ass_main(ASS_BUF, SubL(_BT+_j*5, _BT+_SK-5,10),an(7)+bord(0.5) + pos(dx,dy)+fad(150,0)+p(4), outline)
ass_main(ASS_BUF, SubL(_BT+_SK+_KT, _ET+_j*5,10),an(7) +bord(0.5)+ pos(dx,dy)+fad(0,150)+p(4), outline)
if _i==7:
TX = 103
elif _i==10:
TX = 71
elif _i==13:
TX = 170
else:
TX = 0
for j in range(_BT+bs,_ET-30-TX,75):
ass_main(ASS_BUF, SubL(j-3, j+25),an(5) + pos(_X,_Y)+fad(50,300)+alpha3(180)+alpha1(255)+color3("FF0000")+bord(2)+blur(3)+shad(0)+t(fsc(100,160)), _TXT)
if _i==13:
TY = 170
else:
TY=0
for j in range(_BT+bs-75,_ET-TY,75):
ass_main(ASS_BUF, SubL(j-3, j-3+25, 0), POS+blur(2)+bord(0.5)+fs(2)+alpha3(220)+alpha4(255) +color1("FFFFFF")+color3("FF0000")+ fsc(60*_TextLength[_i],130)+alpha1(255) +shad(0)+t(0,80,alpha3(255))+t(80,160,alpha3(220))+t(160,240,alpha3(255)), "●")
return (ASS_BUF,None)
def x_filter(x, y, param):
_A, dx, dy, frame_pct = param
max_diff_x = randint(-1* 8,1* 8)
max_diff_y = randint(-1* 8,1* 8)
p = 1+0.5*(1-frame_pct)
new_x = floor(x*p-_A*4*(p-1) + max_diff_x)
new_y = floor(y*p-_Fs*4*(p-1) + max_diff_y)
return new_x, new_y
复制代码
作者:
zxdfcgv
时间:
2012-10-13 20:50:11
来了来了
作者:
mzlmcx
时间:
2012-10-13 22:24:11
右键来了
作者:
兜兜里没糖
时间:
2012-10-14 02:17:49
膜拜
作者:
渣渣疯子
时间:
2012-10-14 06:56:02
终于来了
欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/)
Powered by Discuz! X2