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

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

[完整特效] [kk]08_Hayate-ed [复制链接]

Rank: 4

跳转到指定楼层
楼主
发表于 2012-10-26 23:06:52 |只看该作者 |正序浏览
本帖最后由 kk123456 于 2012-10-27 07:29 编辑

嘛,就是个简单的东西,堆了些随机clip
  1. from tcaxPy import *

  2. def Randmask(n, IMG_WD, IMG_HT,X,Y):       # 随机mask
  3.     STR_RAND_IMG = 'm ' + str(X+randint(-25, 25)) + ' ' + str(Y+randint(-20, 15)) + ' b '
  4.     for i in range(4 * n):
  5.         if i % 2 == 0:
  6.             STR_RAND_IMG += str(X+randint(-1*IMG_WD, IMG_WD)) + ' '
  7.         else:
  8.             STR_RAND_IMG += str(Y+randint(-1*IMG_HT, IMG_HT)) + ' '
  9.     return STR_RAND_IMG + 'c'

  10. def tcaxPy_Init():
  11.     global _FontFileName
  12.     global _FaceID
  13.     global _Fs
  14.     global _Height
  15.     global Font
  16.     _FontFileName = GetVal(val_FontFileName)
  17.     _FaceID       = GetVal(val_FaceID)
  18.     _Fs           = GetVal(val_FontSize)
  19.     _Height       = GetVal(val_TextHeight)
  20.     Font = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
  21.    





  22. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):



  23.     ASS_BUF = []
  24.     jg = randint(2,6)
  25.     if _j == 0 :
  26.         dx = _x - int(_a / 2 + 0.5)        
  27.         dy = _y - int(_Fs / 2 + 0.5)
  28.         _TextLength = GetVal(val_TextLength)
  29.         for k in range (randint(int(0.5*_n),int(1.3*_n))):
  30.             num = 20   
  31.             xs = dx + randint(0,_TextLength[_i])   
  32.             ys = dy + randint(-10, 0)
  33.             xe = xs + randint(-10,10)     
  34.             ye = dy + _Fs + randint(5,10)
  35.             points = Bezier1(num, xs, ys, xe, ye)
  36.             kt = _BT+randint(0,_ET-_BT-15)
  37.             for i in range (20):
  38.                 EFT = pos(points[i][0], points[i][1]) + alpha1(HexToDec('AA')) + alpha3(HexToDec('AA')) + color1('FFFFFF') + bord(3) + blur(4) + t(0, 100,blur(3)) + fad(0, 200)
  39.                 EFT2 = pos(points[i][0], points[i][1]) +alpha1(HexToDec('AA')) + alpha3(HexToDec('00')) + color1('FFFFFF') + color3('FFFFFF') + bord(1) + blur(3) + t(0, 100, blur(1) + alpha3(HexToDec('44'))) + fad(0, 200)
  40.                 ass_main(ASS_BUF, SubL(kt+i,kt+i+randint(25,45), 2), EFT2, PixPt())
  41.                 ass_main(ASS_BUF, SubL(kt+i,kt+i+randint(25,45), 2), EFT+color3('F5F274'), PixPt())
  42.             for j in range (3):
  43.                 ass_main(ASS_BUF,SubL(kt+20+j*13,kt+110+j*13),an(7)+pos(xe,ye)+frx(78)+alpha1(255)+alpha3(82)+be(1)+color3("FFFFFF")+bord(2)+fscx(0)+fscy(0)+t(fscx(100)+fscy(100)+bord(6))+fad(0,1000),"{\p2}m 59 0 b 59 -79 -59 -79 -59 0 -59 79 59 79 59 0{\p0}")


  44.     for i in range (_BT+_SK-5,_BT+_SK+_KT,jg):
  45.         tx = Randmask(randint(0,3),randint(30,60),randint(20,40), _x, _y)
  46.         mask = tx
  47.         cl = ("1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F")
  48.         
  49.         cl1=cl[randint(0,15)]
  50.             
  51.         ass_main(ASS_BUF, SubL(i, i+jg+5,10),pos(_x,_y)+bord(0)+blur(randint(1,6))+color1(cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)])+clip(mask)+fs(randint(30,46)), _txt)
  52.     for i in range (_BT+_SK-5,_BT+_SK+_KT,jg):
  53.         tx = Randmask(randint(1,3),randint(30,60),randint(20,40), _x, _y)
  54.         mask = tx
  55.         cl = ("1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F")
  56.         
  57.         cl1=cl[randint(0,15)]
  58.             
  59.         ass_main(ASS_BUF, SubL(i, i+jg+5,10),pos(_x,_y)+bord(0)+blur(randint(2,6))+color1(cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)]+cl[randint(0,15)])+clip(mask)+fs(randint(30,46)), _txt)
  60.     ass_main(ASS_BUF, SubL(_BT+_j*7,_ET+_j*7,1),an(5)+pos(_x,_y)+fad(150,150)+bord(2)+blur(2)+t(_SK*10-_j*70,(_SK+_KT)*10+150-_j*70,color3("F5B589")+fs(_Fs+25)+alpha1(250)+be(2))+t((_SK+_KT/2)*10+100-_j*70,(_SK+_KT)*10+50-_j*70,blur(2)+bord(2)+be(1)+color3("FFFFFF")+fs(_Fs)+alpha1(0)), _txt)
  61.     return (ASS_BUF, None)
复制代码
1

查看全部评分

Rank: 4

6#
发表于 2012-11-14 00:03:54 |只看该作者
好好学习,天天向上

Rank: 4

5#
发表于 2012-10-27 01:53:40 |只看该作者
顶起

Rank: 5Rank: 5

地板
发表于 2012-10-27 00:17:21 |只看该作者
顶一个

Moderator

疯子

Rank: 5Rank: 5

板凳
发表于 2012-10-27 00:14:20 |只看该作者
支持一下

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

沙发
发表于 2012-10-26 23:27:53 |只看该作者
顶一个~ 正在下载中
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

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

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH