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

 找回密码
 新人加入
查看: 3401|回复: 7

[完整特效] [XY]001_fake doll [复制链接]

Rank: 4

发表于 2013-3-3 20:04:32 |显示全部楼层
呜咕。。修改youkeze大大的特效吧。。啊呜。。果然还是高兴不起来的说   o(︶︿︶)o 唉
  1. from tcaxPy import *
  2. from gdiFont import *  #加入GDIfont模块


  3. def tcaxPy_Init():



  4.     global _FontFileName   
  5.     global _FaceID
  6.     global _Fs
  7.     global _TextWidth
  8.     global _TextHeight
  9.     global _TextLength
  10.     global _TextAdvDiff
  11.     global _ResolutionX
  12.     global _OffsetX
  13.     global _FD


  14.     _FontFileName = GetVal(val_FontFileName)
  15.     _FaceID       = GetVal(val_FaceID)
  16.     _Fs           = GetVal(val_FontSize)
  17.     _TextHeight   = GetVal(val_TextHeight)
  18.     _TextWidth    = GetVal(val_TextWidth)
  19.     _TextLength   = GetVal(val_TextLength)
  20.     _TextAdvDiff  = GetVal(val_TextAdvanceDiff)
  21.     _ResolutionX  = GetVal(val_ResolutionX)
  22.     _OffsetX      = GetVal(val_OffsetX)
  23.     _FD           = 1000 / GetVal(val_FXFPS)



  24.     global GdiFont   #GDIfont
  25.    
  26.     GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False)   #GDIfont
  27.    
  28.     global Font
  29.     Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)


  30. def tcaxPy_Fin():
  31.     gfFinFont(GdiFont)   #GDIfont
  32.    
  33.     FinFont(Font)



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

  35.     ASS_BUF = []

  36.     points = gfGetPoints(GdiFont, _txt)  #GDIfont

  37.     PIX = PixFromPoints(points)   #GDIfont
  38.     InitPosX = _x - int(_a / 2 + 0.5) + PIX[0][0]        # 第一个像素的X轴坐标

  39.     InitPosY = _y - int(_Fs / 2 + 0.5) + PIX[0][1]        # 第一个像素的Y轴坐标

  40.     for h in range(PIX[1][1]):                                # 开始纵向扫描

  41.         PosY  = InitPosY + h

  42.                                       # 当前像素Y轴坐标

  43.         for w in range(PIX[1][0]):                        # 开始横向扫描

  44.             PosX = InitPosX + w

  45.             X = PosX-randint(-50,50)

  46.             Y = PosY-randint(-50,50)                        # 当前像素X轴坐标

  47.             idx  = 4 * (h * PIX[1][0] + w)                # 脚标

  48.             PixR = PIX[2][idx + 0]                        # 当前像素的红色分量

  49.             PixG = PIX[2][idx + 1]                        # 当前像素的绿色分量

  50.             PixB = PIX[2][idx + 2]                        # 当前像素的蓝色分量

  51.             PixA = PIX[2][idx + 3]                        # 当前像素的透明度

  52.             if PixA != 0:                                # 如果当前像素不为透明则进行如下操作

  53.                 rnd = randint(-30,30)

  54.                 R = randint(-100,100)

  55.                 C = randint(-100,100)

  56.                 H = randint(-10,10)
  57.                  
  58.                 S = randint(0,20)

  59.                

  60.                 ass_main(ASS_BUF, SubL(int(_BT+_SK+h*(_KT/PIX[1][1]))+H,int(_BT+_SK+_KT+rnd+h*(_KT/PIX[1][1])),1, Pix_Style),an(7)+mov(PosX,PosY,PosX,PosY-50+rnd)+fad(0,300+R+rnd)+alpha(255-PixA)+shad(0)+bord(1)+blur(1)+org(_x,_y)+color1("FFFFFF")+fry(0)+t(20,300,fry(57)+color3('FFFFFF')), "{\p5}m -5 -15 l -15 0 l -6 7 l 9 12 l 5 4 l 13 -13 ")
  61.                
  62.                 ass_main(ASS_BUF, SubL(_BT-35+_j*3,int(_BT+_SK+w*(_KT/PIX[1][0]))+H,1, Pix_Style),an(7)+pos(PosX,PosY)+shad(0)+bord(0)+alpha(255-PixA)+color1("FFFFFF")+fad(200,0), PixPt())
  63.     EFT1 = alpha1(0) + alpha3(0) + color1('FFFFFF') + bord(2.3) + blur(1.5) + t(0, 100, fscx(5)+fscy(5)) + fad(0, 200)


  64.     num = 100        
  65.     xs = _x - 40    # 开始点
  66.     ys = _y + 10
  67.     xc1 = _x - 3     # 控制点
  68.     yc1 = _y - 30
  69.     xe = _x - 3     # 结束点
  70.     ye = _y   
  71.     num = 100        
  72.     ixs = _x + 40    # 开始点
  73.     iys = _y + 10
  74.     xc2 = _x + 3     # 控制点1
  75.     yc2 = _y + 30
  76.     kxe = _x + 3    # 结束点
  77.     kye = _y
  78.     points1 = Bezier2(num, xs, ys, xe, ye, xc1, yc1)   # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
  79.     points2 = Bezier2(num, ixs, iys, kxe, kye, xc2, yc2)
  80.     for i in range(num):
  81.         POS1 = pos(points1[i][0], points1[i][1])
  82.         POS2 = pos(points2[i][0], points1[i][1])
  83.         EFT1 = POS1 + EFT1 + color3('H1D43FF&') + an(7)
  84.         ass_main(ASS_BUF, SubL(_BT+_SK-115+i*1, _BT+_SK-115+(i+1)*1+20, 1, Pix_Style), EFT1, "{\p2}m 7 0 b 2 0 1 4 1 6 b 1 8 2 12 7 12 b 12 12 13 8 13 6 b 13 4 12 0 7 0 ")
  85.         EFT1 = POS2 + EFT1+ color3('H1D43FF&') + an(7)
  86.         ass_main(ASS_BUF, SubL(_BT+_SK-115+i*1, _BT+_SK-115+(i+1)*1+20, 1, Pix_Style), EFT1, "{\p2}m 7 0 b 2 0 1 4 1 6 b 1 8 2 12 7 12 b 12 12 13 8 13 6 b 13 4 12 0 7 0 ")
  87.     ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT),an(5)+pos(_x,_y)+bord(1.5)+blur(1.5)+alpha1(255)+color3('EC487C')+t(0,100,color3('FFFFFF')+blur(4)+bord(4))+t(300,600,bord(1.5)+blur(1.5)), _txt)
  88.     dx = _x - int(_a / 2 + 0.5)
  89.     dy = _y - int(_Fs / 2 + 0.5)
  90.    
  91.     outline = TextOutlinePoints(Font, _txt, 1.0)        
  92.     num = len(outline)
  93.     for i in range(num):
  94.         CIR=RandCir2(_x, _y, 48, 53)
  95.         x = dx + outline[i][0]
  96.         y = dy + outline[i][1]

  97.             
  98.         
  99.         ass_main(ASS_BUF, SubL(_BT+_SK, _BT+_SK+39, 1, Pix_Style), an(7)+mov(x, y, CIR[0], CIR[1]) + alpha1(100) + alpha3(135) + bord(3) + shad(0) + color3('HE9F5FF&') + color1('HE9F5FF&') + fad(0, 300) + blur(2)+frx(56)+org(_x,_y), PixPt())
  100.    
  101.                
  102.     dx = _x - int(_a / 2 + 0.5)
  103.     dy = _y - int(_Fs / 2 + 0.5)
  104.    
  105.     outline = TextOutlinePoints(Font, _txt, 1.0)        
  106.     num = len(outline)
  107.     for i in range(num):
  108.         CIR=RandCir(_x, _y, 24)
  109.         x = dx + outline[i][0]
  110.         y = dy + outline[i][1]

  111.             
  112.         
  113.         ass_main(ASS_BUF, SubL(_BT+_SK, _BT+_SK+39, 1, Pix_Style), an(7)+mov(x, y, CIR[0], CIR[1]) + alpha1(0) + alpha3(135) + bord(3) + shad(0) + color3('H35A7FF&') + color1('H1399FF&') + fad(0, 300) + blur(2), PixPt())
  114.     return (ASS_BUF, None)
复制代码


呜咕。。让TCAX随机分配的K值。。换了视频的分辨率。。忘了了调整黑框的位置了(T.T)。。可是这个K值。。应该不是脚本的问题吧0.0
1

查看全部评分

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

发表于 2013-3-3 21:15:44 |显示全部楼层
还不错哦

Rank: 4

发表于 2013-3-3 21:41:23 |显示全部楼层
赞一个...

Moderator

疯子

Rank: 5Rank: 5

发表于 2013-3-5 21:51:32 |显示全部楼层
刚发现,这东西做的挺不错的嘛...

Rank: 5Rank: 5

发表于 2013-3-5 23:46:56 |显示全部楼层
本帖最后由 six 于 2013-3-6 00:01 编辑

好猎奇,自动日文K- -
而且,你打错老师的名字了。

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

发表于 2013-3-6 00:34:14 |显示全部楼层
six 发表于 2013-3-5 23:46
好猎奇,自动日文K- -
而且,你打错老师的名字了。

Six依旧吐得一口好槽

Rank: 4

发表于 2013-3-6 12:38:30 |显示全部楼层
six 发表于 2013-3-5 23:46
好猎奇,自动日文K- -
而且,你打错老师的名字了。

呜咕。。。嘛。。打快了。。就是一句中一个K值啦。。平均分配的

嘎哦。。是四月大大吗?

Rank: 5Rank: 5

发表于 2013-3-6 14:41:08 |显示全部楼层
milkyjing 发表于 2013-3-6 00:34
Six依旧吐得一口好槽

对老师的爱慕一如继往
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-3-29 19:26

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH