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

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

[完整特效] [OTo]008 Love Live! 6th single -「Music S.T.A.R.T!!」 [复制链接]

Rank: 5Rank: 5

跳转到指定楼层
楼主
发表于 2014-7-15 23:38:30 |只看该作者 |倒序浏览
这个说真的有点失败,部分效果没达到我想要的,看起来会感觉有些奇怪....
就是那个曲线的那个,失败作....虽然连贯的会,但是效果更差...嗯,就只能这样了
见笑了
  1. from tcaxPy import *

  2. def tcaxPy_Init():
  3.     global _FD                              # frame duration, in millisecond
  4.     global _Fs
  5.     global _FontFileName
  6.     global _FaceID
  7.     global _Height
  8.     global Font
  9.     _FD = 1000 / GetVal(val_FXFPS)
  10.     _Fs = GetVal(val_FontSize)
  11.     _FontFileName = GetVal(val_FontFileName)
  12.     _FaceID       = GetVal(val_FaceID)
  13.     _Height       = GetVal(val_TextHeight)
  14.     Font = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)


  15. def hs(n):
  16.     HS= 'm 0 0 l 50 49 100 0 51 50 100 100 50 51 0 100 49 50 0 0 m 45 45 s 55 45 55 55 45 55 c'
  17.     PHS = '{\p'+str(n)+'}'+HS+'{\p0}'
  18.     return PHS


  19.    
  20. time_gap = 1    # you can change this value to 0, or 2 or any other number
  21. time_fac = 1    # you can change this value to 0, or 2 or any other number
  22. _BL = blur(4)






  23. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):

  24.     ASS_BUF = []

  25.     CL=[ "26B1FD", "CECECE","C8E787","6883FF","FCD8AF","A9E096","AF7BFF","FA6CA7","FC8769","F596EE" ]
  26.    

  27.     if _i == 26 or _i == 28 or _i == 39 or _i == 41 or _i == 42 or _i == 51 or _i == 54  :
  28. #################进入方式#################
  29.         duration = 15 * _FD
  30.         in_ts = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
  31.         in_te = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10
  32.         in_EFT =an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+move(_X+60,_Y+60,_X, _Y+60) + fsc(0,0) + t(fsc(100,100)) + fad(duration, 0) + _BL
  33.         ass_main(ASS_BUF, SubL(in_ts, in_te), in_EFT, _TXT)

  34.     #################退场方式#################
  35.         
  36.         
  37.         out_ts = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10
  38.         out_te = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
  39.         out_EFT = an(2)+move(_X, _Y+60,_X-60,_Y+60) + fad(0, duration) +color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+t(blur(10))
  40.         ass_main(ASS_BUF, SubL(out_ts, out_te), out_EFT, _TXT)
  41.         
  42.         
  43.     #################    存在方式
  44.         ass_main(ASS_BUF, SubL(in_te,_BT+_SK,40),an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+pos(_X,_Y+60),_TXT)   
  45.         
  46.         
  47.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,40),an(2)+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL+pos(_X,_Y+60),_TXT)
  48.         
  49.         
  50. #################   附加效果  一直闪的小星星  #################
  51.     ######  小星星1

  52.         main_ts= _BT+_SK
  53.         main_te = out_ts
  54.         count = int(main_te - main_ts)
  55.         step = int(_FD+_KT )
  56.         for i in range(0, count, step):
  57.             main_EFT =pos(_X+randint(-30,30), _Y+60+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  58.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  59.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))

  60.     ######  小星星2

  61.         for i in range(0, count, step):
  62.             main_EFT =pos(_X+randint(-30,30), _Y+60+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  63.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  64.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))


  65. #################表现效果    震动+闪光     #################   
  66.             
  67.             
  68.         step = int(50/(_KT+1)+1)
  69.         for J in range(_BT+_SK,_BT+_SK+_KT+1,step):
  70.             Ts = J
  71.             Ts2 = Ts + step
  72.             ass_main(ASS_BUF,SubL(Ts,Ts2),an(2)+pos(_X+randint(-3,3),_Y+60+randint(-3,3))+ color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL,_TXT)
  73.             
  74.             
  75.              #################
  76.             
  77.     elif _i== 38  or _i== 40 or _i== 43 :
  78.             #################进入方式#################
  79.         duration = 15 * _FD
  80.         in_ts = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
  81.         in_te = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10
  82.         in_EFT =an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+move(_X+60,_Y,_X, _Y) + fsc(0,0) + t(fsc(100,100)) + fad(duration, 0) + _BL
  83.         ass_main(ASS_BUF, SubL(in_ts, in_te), in_EFT, _TXT)

  84.     #################退场方式#################
  85.         
  86.         out_ts = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10
  87.         out_te = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
  88.         out_EFT = an(2)+move(_X, _Y,_X-60,_Y) + fad(0, duration) +color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+t(blur(10))
  89.         ass_main(ASS_BUF, SubL(out_ts, out_te), out_EFT, _TXT)
  90.         
  91.     #################    存在方式
  92.         ass_main(ASS_BUF, SubL(in_te,_BT+_SK,40),an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+pos(_X,_Y),_TXT)   
  93.         
  94.     ######
  95.    
  96.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,40),an(2)+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL+pos(_X,_Y),_TXT)
  97.         
  98.         
  99.     #################   附加效果  一直闪的小星星  #################
  100.    
  101.     ######  小星星1

  102.         main_ts= _BT+_SK
  103.         main_te = out_ts
  104.         count = int(main_te - main_ts)
  105.         step = int(_FD+_KT )
  106.         for i in range(0, count, step):
  107.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  108.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  109.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))
  110.             
  111.     ######  小星星2
  112.             
  113.         for i in range(0, count, step):
  114.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  115.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  116.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))
  117. #################表现效果    震动+闪光     #################   
  118.         step = int(50/(_KT+1)+1)
  119.         for J in range(_BT+_SK,_BT+_SK+_KT+1,step):
  120.             Ts = J
  121.             Ts2 = Ts + step
  122.             ass_main(ASS_BUF,SubL(Ts,Ts2),an(2)+pos(_X+randint(-3,3),_Y+randint(-3,3))+ color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL,_TXT)
  123.              #################
  124.             
  125.     elif (_i >7 and _i<12) or (_i >23 and _i<32) :
  126.         #################进入方式#################
  127.         duration = 15 * _FD
  128.         in_ts = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
  129.         in_te = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10
  130.         in_EFT =an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+move(_X+60,_Y,_X, _Y) + fsc(0,0) + t(fsc(100,100)) + fad(duration, 0) + _BL
  131.         ass_main(ASS_BUF, SubL(in_ts, in_te), in_EFT, _TXT)

  132.     #################退场方式#################
  133.         
  134.         out_ts = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10
  135.         out_te = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
  136.         out_EFT = an(2)+move(_X, _Y,_X-60,_Y) + fad(0, duration) +color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+t(blur(10))
  137.         ass_main(ASS_BUF, SubL(out_ts, out_te), out_EFT, _TXT)
  138.         
  139.     #################    存在方式
  140.         ass_main(ASS_BUF, SubL(in_te,_BT+_SK,40),an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+pos(_X,_Y),_TXT)   
  141.         
  142.     ######
  143.    
  144.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,40),an(2)+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL+pos(_X,_Y),_TXT)
  145.         
  146.     #################   附加效果  一直闪的小星星  #################
  147.    
  148.     ######  小星星1
  149.         main_ts= _BT+_SK
  150.         main_te = out_ts
  151.         count = int(main_te - main_ts)
  152.         step = int(_FD+_KT )
  153.         for i in range(0, count, step):
  154.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  155.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  156.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))
  157.             
  158.     ######  小星星2

  159.         for i in range(0, count, step):
  160.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  161.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  162.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))
  163.             
  164. #################表现效果    放大     #################   
  165.         ass_main(ASS_BUF, SubL(in_te,_BT+_SK,40),an(2)+pos(_X,_Y)+color3(CL[_j%10])+shad(0),_TXT)
  166.    
  167.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,40),an(2)+pos(_X,_Y)+color3(CL[_j%10])+fsc(80,80)+shad(0)+t(color3(CL[(_j+1)%10])+fsc(100,100)+_BL),_TXT)
  168.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT),an(2)+pos(_X,_Y)+alpha1(255)+fsc(150,150)+t(fsc(100,100))+color3(CL[_j%10])+color4(CL[_j%10])+t(color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10]))+_BL,_TXT)
  169.         
  170.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,40),an(2)+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL+pos(_X,_Y),_TXT)
  171.         
  172.         
  173. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

  174.         
  175.         
  176.         
  177.         
  178. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  179.     elif  (_i >11 and _i<18) or (_i >31 and _i<38) or (_i >43 and _i<51):
  180.     #################进入方式#################
  181.         duration = 15 * _FD
  182.         in_ts = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
  183.         in_te = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10
  184.         in_EFT =an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+move(_X+60,_Y,_X, _Y) + fsc(0,0) + t(fsc(100,100)) + fad(duration, 0) + _BL
  185.         ass_main(ASS_BUF, SubL(in_ts, in_te), in_EFT, _TXT)

  186.     #################退场方式#################
  187.         
  188.         out_ts = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10
  189.         out_te = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
  190.         out_EFT = an(2)+move(_X, _Y,_X-60,_Y) + fad(0, duration) +color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+t(blur(10))
  191.         ass_main(ASS_BUF, SubL(out_ts, out_te), out_EFT, _TXT)
  192.         
  193.     #################    存在方式
  194.         ass_main(ASS_BUF, SubL(in_te,_BT+_SK,40),an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+pos(_X,_Y),_TXT)   
  195.         
  196.     ######
  197.    
  198.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,40),an(2)+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL+pos(_X,_Y),_TXT)
  199.         
  200.     #################   附加效果  一直闪的小星星  #################
  201.    
  202.     ######  小星星1

  203.         main_ts= _BT+_SK
  204.         main_te = out_ts
  205.         count = int(main_te - main_ts)
  206.         step = int(_FD+_KT )
  207.         for i in range(0, count, step):
  208.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  209.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  210.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))
  211.             
  212.     ######  小星星2

  213.         for i in range(0, count, step):
  214.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  215.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  216.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))



  217. #################表现效果    星星 波浪 运动    #################   

  218.         dx = _X - int((_A + GetVal(val_Spacing)) / 2 + 0.5)     # 一个固定操作, 将an5的坐标转换为an7
  219.         dy = _Y - int(_Fs  + 0.5)    # ASS特效默认采用an5坐标, TCAS特效则采用an7坐标
  220.    
  221.         po_ts = _BT + _SK      # 效果开始时间
  222.         po_te = _BT + _SK+_KT            # 效果结束时间
  223.    
  224.         EFT1 = alpha1(100) + alpha3(150)  +color3(CL[_j%10])+ color4(CL[_j%10]) +t(color3(CL[(_j+1)%10]))+ t(color4(CL[(_j+1)%10]))+bord(2)+shad(2)+ blur(4)+be(20)
  225.         EFT2 = alpha1(100)  +color3(CL[_j%10])+ color4(CL[_j%10]) +t(color3(CL[(_j+1)%10]))+ t(color4(CL[(_j+1)%10]))+bord(2)+shad(2)+ blur(4)+be(20)

  226.         num = 80    # 曲线上点的个数
  227.         
  228.     #####  point  #####

  229.         xs  = dx      # 开始点
  230.         ys  = dy  
  231.         xc1 = xs  + 0.25*_A     # 控制点1
  232.         yc1 = dy  + 1.5*_Fs
  233.         xc2 = xs +  0.75*_A    # 控制点2
  234.         yc2 = dy -  1.5*_Fs
  235.         xe  = dx + _A    # 结束点
  236.         ye  = dy
  237.         points = Bezier3(num, xs, ys, xe, ye, xc1, yc1, xc2, yc2)   # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
  238.         for i in range(num):
  239.             MOVE = move(points[i][0], points[i][1],points[i][0]+randint(-3*_A,0), points[i][1]+randint(0,30))   # 获取曲线上点坐标
  240.             EFT = MOVE + EFT1
  241.             ass_main(ASS_BUF, SubL(po_ts+i , po_te +i, 50, Pix_Style), EFT, hs(3))
  242.             EFT = MOVE + EFT2
  243.             ass_main(ASS_BUF, SubL(po_ts+i , po_te +i, 50, Pix_Style), EFT, hs(3))
  244. #################表现效果    拉伸   弹跳     #################


  245.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+0.4*_KT,40),an(2)+pos(_X,_Y)+t(fscy(115))+color3(CL[_j%10])+color4(CL[_j%10])+_BL,_TXT)
  246.         ass_main(ASS_BUF, SubL(_BT+_SK+0.4*_KT,_BT+_SK+0.8*_KT,40),an(2)+pos(_X,_Y)+fscy(115)+t(fscy(90))+color3(CL[_j%10])+color4(CL[_j%10])+t(color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10]))+_BL,_TXT)
  247.         ass_main(ASS_BUF, SubL(_BT+_SK+0.8*_KT,_BT+_SK+_KT,40),an(2)+pos(_X,_Y)+fscy(90)+t(fscy(100))+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL,_TXT)

  248. ###############################################################################

  249. ##########################################################################################################################

  250.    

  251.     else:
  252.     #################进入方式#################
  253.         duration = 15 * _FD
  254.         in_ts = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
  255.         in_te = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10
  256.         in_EFT =an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+move(_X+60,_Y,_X, _Y) + fsc(0,0) + t(fsc(100,100)) + fad(duration, 0) + _BL
  257.         ass_main(ASS_BUF, SubL(in_ts, in_te), in_EFT, _TXT)

  258.     #################退场方式#################
  259.         
  260.         out_ts = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10
  261.         out_te = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
  262.         out_EFT = an(2)+move(_X, _Y,_X-60,_Y) + fad(0, duration) +color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+t(blur(10))
  263.         ass_main(ASS_BUF, SubL(out_ts, out_te), out_EFT, _TXT)
  264.         
  265.     #################    存在方式
  266.         ass_main(ASS_BUF, SubL(in_te,_BT+_SK,40),an(2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL+pos(_X,_Y),_TXT)   
  267.         
  268.     ######
  269.    
  270.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,40),an(2)+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL+pos(_X,_Y),_TXT)
  271.         
  272.     #################   附加效果  一直闪的小星星  #################
  273.     ######  小星星1

  274.         main_ts= _BT+_SK
  275.         main_te = out_ts
  276.         count = int(main_te - main_ts)
  277.         step = int(_FD+_KT )
  278.         for i in range(0, count, step):
  279.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  280.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  281.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))
  282.             
  283.     ######  小星星2
  284.         for i in range(0, count, step):
  285.             main_EFT =pos(_X+randint(-30,30), _Y+randint(-45,0)) +color3(CL[randint(0,9)])+ color4(CL[randint(0,9)])+bord(2)+shad(2)+ blur(4)+be(20)
  286.             ass_main(ASS_BUF, SubL(main_ts + i, main_ts + i + step/2), main_EFT  +fsc(20,20)+t(fsc(100,100))+fad(200+_KT,0), hs(3))
  287.             ass_main(ASS_BUF, SubL(main_ts + i+ step/2, main_ts + i + step), main_EFT  + fsc(100,100)+t(fsc(20,20))+fad(0,200+_KT), hs(3))


  288. #################表现效果    拉伸   弹跳     #################


  289.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+0.4*_KT,40),an(2)+pos(_X,_Y)+t(fscy(115))+color3(CL[_j%10])+color4(CL[_j%10])+_BL,_TXT)
  290.         ass_main(ASS_BUF, SubL(_BT+_SK+0.4*_KT,_BT+_SK+0.8*_KT,40),an(2)+pos(_X,_Y)+fscy(115)+t(fscy(90))+color3(CL[_j%10])+color4(CL[_j%10])+t(color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10]))+_BL,_TXT)
  291.         ass_main(ASS_BUF, SubL(_BT+_SK+0.8*_KT,_BT+_SK+_KT,40),an(2)+pos(_X,_Y)+fscy(90)+t(fscy(100))+color3(CL[(_j+1)%10])+color4(CL[(_j+1)%10])+_BL,_TXT)

  292. #################表现效果    画心     #################   

  293.         dx = _X-int(( 0.2*_A +GetVal(val_Spacing)) / 2 + 0.5)
  294.         dy = _Y  - int(0.9*_Fs + 0.5)

  295.         po_ts = _BT + _SK      # 效果开始时间
  296.         po_te = _BT + _SK+_KT            # 效果结束时间
  297.    
  298.         EFT1 = alpha1(100) + alpha3(150) +color3(CL[_j%10])+ color4(CL[_j%10]) +t(color3(CL[(_j+1)%10]))+ t(color4(CL[(_j+1)%10]))+bord(2)+shad(2)+ blur(4)+be(20)
  299.         EFT2 = alpha1(100) +color3(CL[_j%10])+ color4(CL[_j%10]) +t(color3(CL[(_j+1)%10]))+ t(color4(CL[(_j+1)%10]))+bord(2)+shad(2)+ blur(4)+be(20)

  300.         num = 30    # 曲线上点的个数

  301.     #####  point1  #####

  302.         xs  = dx      # 开始点
  303.         ys  = dy  
  304.         xc1 = xs  - 0.85*_A     # 控制点1
  305.         yc1 = dy  - _Fs
  306.         xc2 = xs -  0.85*_A    # 控制点2
  307.         yc2 = dy +  0.7*_Fs
  308.         xe  = dx     # 结束点
  309.         ye  = dy+ 0.8*_Fs
  310.         points = Bezier3(num, xs, ys, xe, ye, xc1, yc1, xc2, yc2)   # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
  311.         for i in range(num):
  312.             MOVE = move(points[i][0], points[i][1],points[i][0]+randint(-8,8), points[i][1]+randint(0,15))   # 获取曲线上点坐标
  313.             EFT = MOVE + EFT1
  314.             ass_main(ASS_BUF, SubL(po_ts+i , po_te +i*2, 50, Pix_Style), EFT, hs(4))
  315.             EFT = MOVE + EFT2
  316.             ass_main(ASS_BUF, SubL(po_ts+i , po_te +i*2, 50, Pix_Style), EFT, hs(4))
  317.         
  318.     #####  point2  #####

  319.         xs  = dx      # 开始点
  320.         ys  = dy  
  321.         xc1 = xs + 0.85*_A     # 控制点1
  322.         yc1 = dy  - _Fs
  323.         xc2 = xs + 0.85*_A    # 控制点2
  324.         yc2 = dy + 0.7*_Fs
  325.         xe  = dx     # 结束点
  326.         ye  = dy + 0.8*_Fs
  327.         points = Bezier3(num, xs, ys, xe, ye, xc1, yc1, xc2, yc2)   # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
  328.         for i in range(num):
  329.             MOVE = move(points[i][0], points[i][1],points[i][0]+randint(-8,8), points[i][1]+randint(0,15))   # 获取曲线上点坐标
  330.             EFT = MOVE + EFT1
  331.             ass_main(ASS_BUF, SubL(po_ts+i , po_te +i*3, 50, Pix_Style), EFT, hs(4))
  332.             EFT = MOVE + EFT2
  333.             ass_main(ASS_BUF, SubL(po_ts+i , po_te +i*3, 50, Pix_Style), EFT, hs(4))
  334.         


  335. ##########################################################################################################################
  336.         

  337.    
  338.     return (ASS_BUF,None)
复制代码
http://pan.baidu.com/s/1xi8Qw

体积有点大,不是我压的....1080....sorry了
B站在线

http://www.bilibili.com/video/av862109/
1

查看全部评分

Rank: 4

沙发
发表于 2014-10-31 18:04:46 |只看该作者
感谢楼主分享的代码,做的非常漂亮。

Rank: 4

板凳
发表于 2014-10-31 22:13:40 |只看该作者
Good 良好 =D
和 感谢楼主分享的代码

Rank: 4

地板
发表于 2015-8-31 15:43:16 |只看该作者
感谢~!做的很不错了!!
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-11-22 19:38

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH