- UID
- 363
- 积分
- 2032
- 帖子
- 123
- 主题
- 18
- 论坛币
- 3812
- 威望
- 10
- EP值
- 1178
- MP值
- 0
- 阅读权限
- 80
- 注册时间
- 2012-3-21
- 在线时间
- 284 小时
- 最后登录
- 2017-1-31
|
本帖最后由 jijidata 于 2013-12-26 07:06 编辑
日文- from tcaxPy import *
- from s import *
- from gdiFont import * #加入GDIfont模块
- from util.tcCurve import *
- import math
- import random
- def tcaxPy_Init():
- global _FontFileName
- global _FaceID
- global _Fs
- global _TextWidth
- global _TextHeight
- global _TextLength
- global _TextAdvDiff
- global _ResolutionX
- global _FD
- global _TextInitX
- global _Ascender # 字体上行高度
- global _Descender # 字体下行高度 通常为负数
- global _H
- global _3C
- global _KarTime
- _KarTime = GetVal(val_KarTime)# 第i句卡拉OK歌词的第j个字符的Karaoke时间 = !$start!
- _H = GetVal(val_FontSize)
- _3C = GetVal(val_3C)
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- _Fs = GetVal(val_FontSize)
- _Ascender = GetVal(val_Ascender) #字体上行高度
- _TextHeight = GetVal(val_TextHeight)# 第i句卡拉OK歌词的j个字符的高度
- _TextWidth = GetVal(val_TextWidth)# 第i句卡拉OK歌词的j个字符的宽度
- _TextLength = GetVal(val_TextLength)# 第i句卡拉OK歌词的文字总长度
- _TextAdvDiff = GetVal(val_TextAdvanceDiff)# 从初始位置到第i句卡拉OK歌词的j个字符的水平步距
- _TextInitX = GetVal(val_TextInitX)
- _ResolutionX = GetVal(val_ResolutionX)
- _FD = 1000 / GetVal(val_FXFPS)
- global GdiFont #GDIfont
- GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False) #GDIfont
- global Font
- Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
- def p(y):#绘图缩放代码
- if y == int(y):
- Y = str(int(y))
- else:
- Y = str(format(y, '.2f'))
- return '\\p{0}'.format(Y)
-
- def frxyz(x):
- X1 = randint(-x,x)
- X2 = randint(-x,x)
- X3 = randint(-x,x)
- return frx(X1)+fry(X2)+frz(X3)
-
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
- ASS_BUF = [] # 用于保存ASS特效
- _7X = _X - int(_A / 2 + 0.5) #每个字的上X坐标= !$left!
- _7Y = _Y - int(_H / 2 + 0.5) #每个字的上Y坐标=!$top!
- _bottom = _Y + int(_H / 2 + 0.5) #每个字的下Y坐标
- if _i > -1 and _i < 4 :
- shape = ["m 30 23 b 24 23 24 33 30 33 b 36 33 37 23 30 23 m 35 27 l 61 28 l 35 29 m 26 27 l 0 28 l 26 29 m 29 23 l 30 0 l 31 23 m 29 33 l 30 57 l 31 33 ","m 6 0 b 12 0 12 7 6 7 b 0 7 0 0 6 0 ","m 15 0 l 10 7 l 0 9 l 9 13 l 5 23 l 15 17 l 25 23 l 21 13 l 31 9 l 20 7 l 15 0 "]
- ass_main(ASS_BUF,SubL(_BT-10+_j*3,_BT+_SK,1),an(5)+blur(4)+fsc(0,0)+move(_X+30,_Y,_X,_Y,0,400)+alpha(255)+t(0,400,alpha(0)+fsc(100,100)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,1),an(5)+blur(4)+pos(_X,_Y)+t(0,_KT*5,fsc(120,120))+t(_KT*5,_KT*10,fsc(100,100))+t(0,_KT*1,rnd(20))+t(_KT*1,_KT*2,rnd(0))+t(_KT*2,_KT*3,rnd(5))+t(_KT*3,_KT*4,rnd(20))+t(_KT*4,_KT*5,rnd(0))+t(_KT*5,_KT*6,rnd(15))+t(_KT*6,_KT*7,rnd(2))+t(_KT*7,_KT*8,rnd(16))+t(_KT*8,_KT*9,rnd(0))+t(_KT*9,_KT*10,rnd(10)) ,_TXT)#表现方式
- dur = _ET-(_BT+_SK+_KT)
- ass_main(ASS_BUF,SubL(_BT+_SK+_KT,_ET,1),an(5)+blur(4)+pos(_X,_Y)+t(0,dur*1,rnd(20))+t(dur*1,dur*2,rnd(0))+t(dur*2,dur*3,rnd(5))+t(dur*3,dur*4,rnd(20))+t(dur*4,dur*5,rnd(0))+t(dur*5,dur*6,rnd(15))+t(dur*6,dur*7,rnd(2))+t(dur*7,dur*8,rnd(16))+t(dur*8,dur*9,rnd(0))+t(dur*9,dur*10,rnd(10)) ,_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+_j*10,1),an(5)+blur(4)+move(_X,_Y,_X+40,_Y+5)+t(fsc(50,50)+bord(0)+blur(20)+fad(0,700))+t(0,_j*10*2,rnd(20))+t(_j*10*2,_j*10*4,rnd(0))+t(_j*10*4,_j*10*6,rnd(10))+t(_j*10*6,_j*10*8,rnd(20))+t(_j*10*8,_j*10*10,rnd(1)) ,_TXT)
- for j in range(math.ceil(_KT)):
- J = [math.ceil(_KT)]
- step1 = _KT*10*(j-1)/(max(J)*10-1)
- XC1= _7X+_A*(j+1)/max(J) #X的实际坐标,从每个字的左边移动到右边(这是spacing为0的情况下,spacing不为0需修改代码,嗯~我偷懒了)
- _SY = _Y - int(_H / 2 + 0.5)*(-1)**_j #Y坐标初始坐标,依次为每个字的上顶点,下顶点,
- _CY = (-1)**_j*_H*(j+1)/max(J) #Y坐标的控制参数,含义为依次加上字符的高度,减去字符的高度
- YC1= _SY+_CY #Y坐标的实际坐标,由以上初始坐标加上控制参数生成
- XC2= XC1-_A*0.1*randint(10,40)
- YC2= YC1+random.uniform(-0.4*_A,0.4*_A)
- CurveMove = move(XC1,YC1,XC2,YC2)
- ass_main(ASS_BUF,SubL(_BT+_SK+step1,_BT+_SK+_KT+step1+70,2),an(5)+blur(4)+bord(0.5)+vc1("00FFFF","00FFFF","FFFFFF","FFFFFF")+fad(0,300)+t(frxyz(720))+CurveMove+p(1)+fsc(randint(20,40),randint(20,40)),shape[randint(0,2)])
- if _i > 3 and _i < 8 :
- ass_main(ASS_BUF,SubL(_BT-10+_j*3,_BT+_SK,1),an(5)+blur(4)+move(_X+130,_Y,_X,_Y,0,400)+alpha(255)+t(0,400,alpha(0)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,1),an(5)+pos(_X,_Y)+t(0,_KT*4,0.5,fsc(135,135)+frz(randint(-20,20)))+bord(3)+blur(8)+alpha(0)+t(_KT*4,_KT*10,frz(0)+fsc(100,100)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK+_KT,_ET,1),an(5)+blur(4)+pos(_X,_Y),_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+50,1),an(5)+blur(4)+pos(_X,_Y)+t(frz(500)+fsc(0,0)+alpha(255)) ,_TXT)
- for j in range(0,3):
- EFT2=alt(_ET,_ET+randint(400,600), t = randint(20,80) , FX1 =alpha(0), FX2 = alpha(255), offset = 0, a1 = None,a2 = None)
- ass_main(ASS_BUF,SubL(_ET,_ET+randint(400,600)),an(5)+fad(0,randint(100,700))+blur(6)+fsc(randint(5,50),randint(5,50))+moves4(_X,_Y,_X+randint(-70,100),_Y+randint(-80,-50),_X+randint(-80,50),_Y+randint(-40,80),_X+randint(-70,50),_Y+randint(-60,60))+EFT2,"{\p1}m 21 16 b 17 16 17 23 21 23 b 25 23 26 16 21 16 m 24 19 l 43 20 l 24 20 m 18 19 l 0 20 l 18 20 m 20 16 l 21 0 l 22 16 m 20 23 l 21 40 l 22 23")
- colour = ["&HE4ACFF&","&HDC76FF&","&HFFFFFF&"]
- for k in range(2):# 曲线数
- posX1 = _X+randint(-_A,-_A/2)
- posX2 =_X+randint(-_A/3,_A)
- PP = [(posX1, _Y),(posX1, _Y),(posX1, _Y),(_X+randint(-_A*2,_A*2), _Y+randint(-50,50)), (_X+randint(-_A*1.5,_A*1.5), _Y+randint(-90,50)),(posX2 ,_Y),(posX2,_Y),(posX2 ,_Y)]
- ucb = UCBSpline(PP) #使用ucb
- L = ucb.length() # 曲线总长度
- STEP_N = _KT*3 # 取样点数
- step_size = 1 / STEP_N
- print('控制点: {0} 曲线总长度: {1:.02f} 所取点数: {2}'.format(len(PP), L, STEP_N))
- t1 = 0
- POS = []
- for w in range(int(STEP_N/2)):
- POS.append(UniformCubicBSpline(PP,w * step_size))
- particle = RandPolygon(12/5, 12/8, 4)
- BT2=_BT+_SK-20+w*1
- ET2=_BT+_SK-20+70+(w+1)*1
- ass_main(ASS_BUF, SubL(BT2, ET2,11), an(5)+t(frxyz(720))+bord(1)+shad(0)+blur(2)+ move(POS[w][0], POS[w][1],POS[w][0]+randint(-15,15), POS[w][1]+randint(-15,15)) +fad(100,200)+color3(colour[randint(0,2)]), particle ) #曲线
-
- if _i > 7 and _i < 11 :
- pcolor2 = ["&HF2CCFF&","&HF3BFFF&","&HFF6BF4&","&HD49DFF&","&HBE7FFF&"]
- size1 = randint(30,50)
- size2 = randint(10,40)
- ass_main(ASS_BUF,SubL(_BT-50+randint(-20,40),_BT+_SK,1),an(5)+blur(4)+fsc(0,0)+pos(_X,_Y)+t(0,400,randint(5,15)*0.1,frz(720)+fsc(100,100)+fad(300,0)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,1),an(5)+pos(_X,_Y)+t(0,_KT*4,0.7,fsc(150,150)+frz(randint(-20,20))+bord(2)+blur(8))+t(_KT*4,_KT*10,10/7,fsc(100,100)+frz(0)+blur(2)+bord(1)) ,_TXT)
- step1 = _ET+80-(_BT+_SK+_KT)
- ass_main(ASS_BUF,SubL(_BT+_SK+_KT,_ET+80,1),an(5)+pos(_X,_Y)+color3("00FFF1")+color1("FFFFFF")+alpha(255)+t(0,200,alpha(0)+bord(0)+blur(1)+be(1))+t(step1*4+randint(-100,200),step1*4+randint(100,400),fsc(randint(50,250),randint(50,250))+blur(8)+be(8)+alpha(255)) ,_TXT)
- for j in range(5):
- ass_main(ASS_BUF,SubL(_BT-30+j*1.5,_BT+_SK+_KT*2+j*0.5,1),an(5)+fad(300,300)+move(_X+randint(-10,10),_7Y+randint(-30,0),_X+randint(-15,15),_bottom+randint(-10,10))+blur(j*1)+bord(0.5)+alpha(255)+alpha1(128)+alpha3(128)+color1("FFFFFF")+color3(pcolor2[randint(0,4)])+fsc(size1,size1)+t(_KarTime[_i][_j]-210+j*50,_KarTime[_i][_j]-250+_KT*10+1000,fr(randint(0,90)*(-1)**randint(1,2)))+t(_KarTime[_i][_j],_KarTime[_i][_j]+1,color1("FFFFFF")+alpha1(0)+alpha3(0)+bord(1))+t(_KarTime[_i][_j]+1,_KarTime[_i][_j]+_KT+300,color1("FFFFFF")+alpha1(128)+alpha3(128)+bord(1)+fsc(size1+50,size1+60)) ,"{\p1}m 20 0 l 20 0 l 20 40 m 20 40 b 22 40 22 43 20 43 b 18 43 18 40 20 40 m 20 0 b 18 0 18 -3 20 -3 b 22 -3 22 0 20 0 m 0 20 l 40 20 m 40 20 b 40 18 43 18 43 20 b 43 22 40 22 40 20 m 0 20 b 0 18 -3 18 -3 20 b -3 22 0 22 0 20")
- for k in range(2):
- ass_main(ASS_BUF,SubL(_BT-30+k*1.5,_BT+_SK+_KT*2+k*0.5,1),an(5)+fad(300,300)+move(_X+randint(-30,30),_Y+randint(-30,0),_X+randint(-15,15),_Y+randint(-10,10))+blur(k*1)+bord(0.5)+alpha(255)+alpha1(128)+alpha3(128)+color1("FFFFFF")+color3(pcolor2[randint(0,4)])+fsc(size2,size2)+t(_KarTime[_i][_j]-210+j*50,_KarTime[_i][_j]-250+_KT*10+1000,fr(randint(0,90)*(-1)**randint(1,2)))+t(_KarTime[_i][_j],_KarTime[_i][_j]+1,color1("FFFFFF")+alpha1(0)+alpha3(0)+bord(0.5))+t(_KarTime[_i][_j]+1,_KarTime[_i][_j]+_KT+300,color1("FFFFFF")+alpha1(128)+alpha3(128)+bord(1)+fsc(size1+50,size1+60)) ,"{\p1}m 20 0 l 20 0 l 20 40 m 20 40 b 22 40 22 43 20 43 b 18 43 18 40 20 40 m 20 0 b 18 0 18 -3 20 -3 b 22 -3 22 0 20 0 m 0 20 l 40 20 m 40 20 b 40 18 43 18 43 20 b 43 22 40 22 40 20 m 0 20 b 0 18 -3 18 -3 20 b -3 22 0 22 0 20")
- for l in range(5):
- ass_main(ASS_BUF,SubL(_BT-30+j*1.5,_BT+_SK+_KT*2+j*0.5,1),an(5)+fad(300,300)+move(_X+randint(-10,10),_bottom+randint(0,30),_X+randint(-20,10),_7Y+randint(-20,-10))+blur(l*1)+bord(0.5)+alpha(255)+alpha1(128)+alpha3(128)+color1("FFFFFF")+color3(pcolor2[randint(0,4)])+fsc(size1,size1)+t(_KarTime[_i][_j]-210+j*50,_KarTime[_i][_j]-250+_KT*10+1000,fr(randint(0,90)*(-1)**randint(1,2)))+t(_KarTime[_i][_j],_KarTime[_i][_j]+1,color1("FFFFFF")+alpha1(0)+alpha3(0)+bord(1))+t(_KarTime[_i][_j]+1,_KarTime[_i][_j]+_KT+600,color1("FFFFFF")+alpha1(128)+alpha3(128)+bord(1)+fsc(size1+50,size1+60)) ,"{\p1}m 20 0 l 20 0 l 20 40 m 20 40 b 22 40 22 43 20 43 b 18 43 18 40 20 40 m 20 0 b 18 0 18 -3 20 -3 b 22 -3 22 0 20 0 m 0 20 l 40 20 m 40 20 b 40 18 43 18 43 20 b 43 22 40 22 40 20 m 0 20 b 0 18 -3 18 -3 20 b -3 22 0 22 0 20")
-
- if _i > 10 and _i < 17 :
- ass_main(ASS_BUF,SubL(_BT-50+randint(-20,40),_BT+_SK,1),an(5)+blur(8)+be(8)+bord(0)+fsc(200,200)+pos(_X,_Y)+alpha(255)+t(0,500,randint(5,15)*0.1,fsc(100,100)+blur(0)+be(0)+alpha(0)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,1),an(2)+pos(_X,_bottom)+color3("FFFFFF")+t(0,_KT*10/4.5,0.65,fscy(120)+bord(2)+blur(7))+t(_KT*10/2.5,_KT*10,1.35,fscy(100)+blur(2)+bord(1)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK+_KT,_ET,1),an(5)+blur(2)+bord(1)+pos(_X,_Y) ,_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+_n*2.5,1),an(5)+blur(2)+bord(1)+pos(_X,_Y)+t(0,100,0.5,fsc(80,80)+bord(1.3)+blur(2)+color3("FFFFFF"))+t(100,_n*25,0.5,fsc(130,130)+alpha(255)+bord(1)+blur(0)) ,_TXT)
- for j in range(10):
- ass_main(ASS_BUF,SubL(_BT+_SK+j,_BT+_SK+_KT+j*5+randint(25,75),2),an(5)+fad(20,50)+color1("FFFFFF")+color3("DC76FF")+bord(randint(1,15)*0.1)+blur(randint(5,20)*0.1)+fsc(randint(3,8),randint(3,8))+move(_X+randint(-5,5),_Y+randint(-50,-10),_X+randint(-50,50),_Y+randint(-5,25)) ,"{\p1}m 0 -2 l -3 1 l -1 3 l 1 3 l 3 1 l 0 -2")
- ass_main(ASS_BUF,SubL(_BT+_SK+j,_BT+_SK+_KT+j*5+randint(25,75),2),an(5)+fad(20,50)+color1("FFFFFF")+color3("DC76FF")+bord(randint(1,15)*0.1)+blur(randint(5,20)*0.1)+fsc(randint(3,8),randint(3,8))+move(_X+randint(-5,5),_7Y+randint(-50,-10),_X+randint(-50,50),_7Y+randint(-15,15)) ,"{\p1}m 0 -2 l -3 1 l -1 3 l 1 3 l 3 1 l 0 -2")
- ass_main(ASS_BUF,SubL(_BT+_SK+j,_BT+_SK+_KT+j*5+randint(25,75),2),an(5)+fad(20,50)+color1("FFFFFF")+color3("DC76FF")+bord(randint(1,15)*0.1)+blur(randint(5,20)*0.1)+fsc(randint(3,8),randint(3,8))+move(_X+randint(-5,5),_bottom+randint(-5,5),_X+randint(-50,50),_bottom+randint(-5,100)) ,"{\p1}m 0 -2 l -3 1 l -1 3 l 1 3 l 3 1 l 0 -2")
- for k in range(3):
- EFT = alt(_BT+_SK+k,_BT+_SK+_KT+k*5+randint(25,75), t = randint(60,100) , FX1 = alpha(255)+fsc(randint(5,10),randint(5,10)), FX2 = alpha(0)+fsc(randint(10,20),randint(10,20)), offset = 0, a1 = None,a2 = None)
- ass_main(ASS_BUF,SubL(_BT+_SK+k,_BT+_SK+_KT+k*5+randint(25,75),2),an(5)+fad(20,50)+color1("FFFFFF")+color3("DC76FF")+bord(0.4)+blur(4)+fsc(5,5)+move(_X+randint(-5,5),_Y+randint(-5,5),_X+randint(-40,40),_Y+randint(-5,85))+EFT ,"{\p1}m 46 54 l 1 56 l 46 57 b 46 58 47 60 47 60 b 42 66 37 72 32 77 b 38 72 43 67 49 62 b 49 63 51 64 52 64 b 53 79 53 93 54 107 b 54 93 55 79 56 64 b 56 65 58 63 59 62 l 76 78 l 60 61 b 61 60 61 57 61 57 l 106 56 l 61 54 b 61 54 60 51 60 51 l 75 35 l 59 49 b 58 48 57 47 55 47 l 54 1 l 52 47 b 50 47 49 48 49 49 l 32 34 l 47 51 b 47 52 46 53 46 54")
- ass_main(ASS_BUF,SubL(_BT+_SK+k,_BT+_SK+_KT+k*5+randint(25,75),2),an(5)+fad(20,50)+color1("FFFFFF")+color3("DC76FF")+bord(0.4)+blur(4)+fsc(5,5)+move(_X+randint(-5,5),_Y+randint(-5,5),_X+randint(-40,40),_Y+randint(-105,5))+EFT ,"{\p1}m 46 54 l 1 56 l 46 57 b 46 58 47 60 47 60 b 42 66 37 72 32 77 b 38 72 43 67 49 62 b 49 63 51 64 52 64 b 53 79 53 93 54 107 b 54 93 55 79 56 64 b 56 65 58 63 59 62 l 76 78 l 60 61 b 61 60 61 57 61 57 l 106 56 l 61 54 b 61 54 60 51 60 51 l 75 35 l 59 49 b 58 48 57 47 55 47 l 54 1 l 52 47 b 50 47 49 48 49 49 l 32 34 l 47 51 b 47 52 46 53 46 54")
- ass_main(ASS_BUF,SubL(_BT+_SK+k,_BT+_SK+_KT+k*5+randint(25,75),2),an(5)+fad(20,50)+color1("FFFFFF")+color3("DC76FF")+bord(0.5)+blur(4)+fsc(5,5)+move(_X+randint(-5,5),_Y+randint(-5,5),_X+randint(-40,40),_Y+randint(-5,85))+EFT ,"{\p1}m 46 54 l 1 56 l 46 57 b 46 58 47 60 47 60 b 42 66 37 72 32 77 b 38 72 43 67 49 62 b 49 63 51 64 52 64 b 53 79 53 93 54 107 b 54 93 55 79 56 64 b 56 65 58 63 59 62 l 76 78 l 60 61 b 61 60 61 57 61 57 l 106 56 l 61 54 b 61 54 60 51 60 51 l 75 35 l 59 49 b 58 48 57 47 55 47 l 54 1 l 52 47 b 50 47 49 48 49 49 l 32 34 l 47 51 b 47 52 46 53 46 54")
-
- if _i > 16 :
- ass_main(ASS_BUF,SubL(_BT-40+_j*2,_BT+_SK,1),an(5)+b(1)+pos(_X,_Y)+fad(200,0)+fsc(0,0)+t(0,200,fsc(220,220))+t(200,330,fsc(80,80))+t(330,520,fsc(140,140))+t(520,610,fsc(150,150))+t(610,710,fsc(120,120))+t(710,820,fsc(100,100))+rndy(20)+t(rndy(0))+blur(6) ,_TXT)
- BT=_BT+_SK
- ET=_BT+_SK+_KT
- color33 = ["&HE4ACFF&","&H965B0A&","&H468613&","&HBC4E6C&","&H3A3BC4&","&H24D4D7&","&HF417B5&"]
- EFT1 = alt(BT,ET, t = 40 , FX1 =frz(-1), FX2 = frz(1), offset = 0, a1 = None,a2 = None)
- EFT2 = alt(BT,ET, t = 40 , FX1 =frz(-1)+color3("FFFFFF"), FX2 = frz(1)+color3("FF9F3D"), offset = 0, a1 = None ,a2 = None )
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,5),an(5)+b(1)+org(_X,_Y+300)+pos(_X,_Y)+fscy(150)+rndx(10)+blur(8)+t(rndx(0)+fscy(100))+EFT1 ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,5),an(5)+b(1)+blur(8)+org(_X,_Y+300)+move(_X,_Y+5,_X,_Y-5)+fscy(150)+bord(4)+t(fscy(100))+alpha3(128)+EFT2 ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK+_KT,_ET,5),an(5)+b(1)+blur(6)+pos(_X,_Y) ,_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+30,5),an(5)+b(1)+blur(3)+move(_X,_Y,_X+randint(-800,800),_Y+randint(-30,30))+fad(0,300)+bord(2)+t(frz(randint(-1280,1280))+fsc(randint(20,100),randint(20,100))) ,_TXT)
- for j in range(60):
- ass_main(ASS_BUF,SubL(_BT+_SK+randint(0,_KT),_BT+_SK+_KT+randint(-_KT,_KT),1),an(5)+be(8)+fad(0,300)+blur(8)+move(_X,_Y,_X-randint(0,150),_Y-randint(-65,65))+fsc(30,30)+color3(color33[randint(0,6)])+p(randint(2,3)) ,"m 20 0 b 20 10 30 20 40 20 b 30 20 20 30 20 40 b 20 30 10 20 0 20 b 10 20 20 10 20 0")
-
-
-
- return (ASS_BUF, None)
复制代码 中文:- from tcaxPy import *
- from s import *
- from gdiFont import * #加入GDIfont模块
- from util.tcCurve import *
- import math
- import random
- def tcaxPy_Init():
- global _FontFileName
- global _FaceID
- global _Fs
- global _TextWidth
- global _TextHeight
- global _TextLength
- global _TextAdvDiff
- global _ResolutionX
- global _FD
- global _TextInitX
- global _Ascender # 字体上行高度
- global _Descender # 字体下行高度 通常为负数
- global _H
- global _3C
- global _KarTime
- _KarTime = GetVal(val_KarTime)# 第i句卡拉OK歌词的第j个字符的Karaoke时间 = !$start!
- _H = GetVal(val_FontSize)
- _3C = GetVal(val_3C)
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- _Fs = GetVal(val_FontSize)
- _Ascender = GetVal(val_Ascender) #字体上行高度
- _TextHeight = GetVal(val_TextHeight)# 第i句卡拉OK歌词的j个字符的高度
- _TextWidth = GetVal(val_TextWidth)# 第i句卡拉OK歌词的j个字符的宽度
- _TextLength = GetVal(val_TextLength)# 第i句卡拉OK歌词的文字总长度
- _TextAdvDiff = GetVal(val_TextAdvanceDiff)# 从初始位置到第i句卡拉OK歌词的j个字符的水平步距
- _TextInitX = GetVal(val_TextInitX)
- _ResolutionX = GetVal(val_ResolutionX)
- _FD = 1000 / GetVal(val_FXFPS)
- global GdiFont #GDIfont
- GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False) #GDIfont
- global Font
- Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
- def p(y):#绘图缩放代码
- if y == int(y):
- Y = str(int(y))
- else:
- Y = str(format(y, '.2f'))
- return '\\p{0}'.format(Y)
-
- def frxyz(x):
- X1 = randint(-x,x)
- X2 = randint(-x,x)
- X3 = randint(-x,x)
- return frx(X1)+fry(X2)+frz(X3)
-
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
- ASS_BUF = [] # 用于保存ASS特效
- _7X = _X - int(_A / 2 + 0.5) #每个字的上X坐标= !$left!
- _7Y = _Y - int(_H / 2 + 0.5) #每个字的上Y坐标=!$top!
- _bottom = _Y + int(_H / 2 + 0.5) #每个字的下Y坐标
- if _i > -1 and _i < 4 :
- ass_main(ASS_BUF,SubL(_BT-10+_j*3,_BT+_SK,1),an(5)+blur(4)+fsc(0,0)+move(_X+30,_Y,_X,_Y,0,400)+alpha(255)+t(0,400,alpha(0)+fsc(100,100)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_ET,1),an(5)+blur(4)+pos(_X,_Y) ,_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+_j*10,1),an(5)+blur(4)+move(_X,_Y,_X+40,_Y+5)+t(fsc(50,50)+bord(0)+blur(20)+fad(0,700)) ,_TXT)
-
- if _i > 3 and _i < 8 :
- ass_main(ASS_BUF,SubL(_BT-10+_j*3,_BT+_SK,1),an(5)+blur(4)+move(_X+130,_Y,_X,_Y,0,400)+alpha(255)+t(0,400,alpha(0)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_ET,1),an(5)+blur(4)+pos(_X,_Y),_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+50,1),an(5)+blur(4)+pos(_X,_Y)+t(frz(500)+fsc(0,0)+alpha(255)) ,_TXT)
-
- if _i > 7 and _i < 11 :
- pcolor2 = ["&HF2CCFF&","&HF3BFFF&","&HFF6BF4&","&HD49DFF&","&HBE7FFF&"]
- size1 = randint(30,50)
- size2 = randint(10,40)
- ass_main(ASS_BUF,SubL(_BT-50+randint(-20,40),_BT+_SK,1),an(5)+blur(4)+fsc(0,0)+pos(_X,_Y)+t(0,400,randint(5,15)*0.1,frz(720)+fsc(100,100)+fad(300,0)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,1),an(5)+pos(_X,_Y)+blur(4) ,_TXT)
- step1 = _ET+80-(_BT+_SK+_KT)
- ass_main(ASS_BUF,SubL(_BT+_SK+_KT,_ET+80,1),an(5)+pos(_X,_Y)+color3("00FFF1")+color1("FFFFFF")+alpha(255)+t(0,200,alpha(0)+bord(0)+blur(1)+be(1))+t(step1*4+randint(-100,200),step1*4+randint(100,400),fsc(randint(50,250),randint(50,250))+blur(8)+be(8)+alpha(255)) ,_TXT)
-
- if _i > 10 and _i < 17 :
- ass_main(ASS_BUF,SubL(_BT-50+randint(-20,40),_BT+_SK,1),an(5)+blur(8)+be(8)+bord(0)+fsc(200,200)+pos(_X,_Y)+alpha(255)+t(0,500,randint(5,15)*0.1,fsc(100,100)+blur(0)+be(0)+alpha(0)) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_ET,1),an(5)+blur(2)+bord(1)+pos(_X,_Y) ,_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+_n*2.5,1),an(5)+blur(2)+bord(1)+pos(_X,_Y)+t(0,100,0.5,fsc(80,80)+bord(1.3)+blur(2)+color3("FFFFFF"))+t(100,_n*25,0.5,fsc(130,130)+alpha(255)+bord(1)+blur(0)) ,_TXT)
-
- if _i > 16 :
- ass_main(ASS_BUF,SubL(_BT-40+_j*2,_BT+_SK,1),an(5)+b(1)+pos(_X,_Y)+fad(200,0)+fsc(0,0)+t(0,200,fsc(220,220))+t(200,330,fsc(80,80))+t(330,520,fsc(140,140))+t(520,610,fsc(150,150))+t(610,710,fsc(120,120))+t(710,820,fsc(100,100))+rndy(20)+t(rndy(0))+blur(6) ,_TXT)
- ass_main(ASS_BUF,SubL(_BT+_SK,_ET,5),an(5)+b(1)+blur(6)+pos(_X,_Y) ,_TXT)
- ass_main(ASS_BUF,SubL(_ET,_ET+30,5),an(5)+b(1)+blur(3)+move(_X,_Y,_X+randint(-800,800),_Y+randint(-30,30))+fad(0,300)+bord(2)+t(frz(randint(-1280,1280))+fsc(randint(20,100),randint(20,100))) ,_TXT)
-
-
- return (ASS_BUF, None)
复制代码 修复了http://www.tcax.org/forum.php?mo ... &extra=page%3D1
中间那部分的伪曲线的衔接不完整的瑕疵,嘛~
以上~个人的template移植完成,还有少许简单的就不移植了,接下来开个大坑~
补上个第80行代码的template- Comment: 0,0:00:00.00,0:00:00.00,song-jp-1,,0,0,0,template noblank notext,!maxloop(math.ceil($dur/10))!!retime("presyl",syl.duration*(j-1)/(maxj-1),syl.duration*(j-1)/(maxj-1)+700)!{\move(!$left+$width*(j-1)/(maxj-1)-0.1*syl.height!, !$top+0.4*$height+0.6*$height*((1+(-1)^syl.i)/2)+((-1)^(syl.i+1))*0.6*$height*(j-1)/(maxj-1)!,!$left+$width*(j-1)/(maxj-1)-0.1*syl.height-$height*math.random(10,40)/10!, !$top+0.2*$height+0.6*$height*((1+(-1)^syl.i)/2)+((-1)^(syl.i+1))*0.6*$height*(j-1)/(maxj-1)+math.random(-0.4*$height,0.4*$height)!)\an5\fscx!math.random(20,40)!\fscy!math.random(20,40)!\bord0.5\blur4\1vc(&H00FFFF&,&H00FFFF&,&HFFFFFF&,&HFFFFFF&)\fad(0,300)\frz45\p1}!shape2[math.random(3)]!
复制代码 预览:http://pan.baidu.com/s/1sj6O12H
|
-
2
查看全部评分
-
|