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

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

[入场效果] SylFX_out_01 [复制链接]

Rank: 4

跳转到指定楼层
楼主
发表于 2014-12-13 00:04:42 |显示全部楼层 |倒序浏览
本帖最后由 ALKOON 于 2014-12-14 13:16 编辑

Hi everyone

This is a simple Fx, actually first test I make by NyuFx(Lua), so I thought it's better to make it by using TCAX
but unfortunately the second FX_02 wasn't as I want, so I hope from  Milky. or saiy to find a sulation for this problem that I got XD

NyuFx_Lua(Demo): http://www.dailymotion.com/video/x2cdr55_demotest_creation

TCAX_Python(Demo) : http://www.dailymotion.com/video/x2cert7_tcax-simple-test


Script:
  1. from tcaxPy import *
  2. from pixLibs.ImageStone.pixStone import *

  3. def tcaxPy_Init():
  4.     global _FD         
  5.     global _Fs
  6.     global _Length
  7.     global _Width
  8.     global _Height
  9.     global Font
  10.     global FontOut
  11.     global PIX_tex
  12.     global PIX_tex2

  13.     _FD = 1000 / GetVal(val_FXFPS)
  14.     _Fs = GetVal(val_FontSize)
  15.     _Length = GetVal(val_TextLength)
  16.     _Height   = GetVal(val_TextHeight)
  17.     _Width    = GetVal(val_TextWidth)
  18.     _FontFileName = GetVal(val_FontFileName)
  19.     _FaceID       = GetVal(val_FaceID)
  20.     Font    = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 0, 0)   
  21.     FontOut = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 2, 0)   
  22.     PIX_tex = ImagePix(abspath('img (13).png'), _Fs, 0)   
  23.     PIX_tex2 = ImagePix(abspath('img (13).png'))   
  24.    

  25. def tcaxPy_Fin():
  26.     FinFont(Font)


  27. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
  28.     ASS_BUF  = []         
  29.     TCAS_BUF = []        


  30.     PIX_t = TextPix(Font, _txt)              

  31.     dx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
  32.     dy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1]
  33.    
  34.     PIX_t = PixTexture(PIX_t, PIX_tex)     
  35.     PIX_out = TextPix(FontOut, _txt)      
  36.     PIX_out = PixTexture(PIX_out, PIX_tex2)      
  37.     PIX_out = PixColorMul(PIX_out, 1, 1, 1, 1)   
  38.     PIX_out = PixBlur(PIX_out, 0)           
  39.     PIX_ori = CombinePixs(PIX_out, PIX_t)   
  40.     points = PixPoints(PIX_ori)
  41.     pt_num = len(points)
  42.     pt = pt_num
  43.          
  44.     x = dx  
  45.     y = dy   

  46.    
  47.     for i in range(pt):
  48.         w = points[i][0]
  49.         h = points[i][1]
  50.         idx  = 4 * (h * PIX_ori[1][0] + w)            
  51.         PixR = PIX_ori[2][idx + 0]                        
  52.         PixG = PIX_ori[2][idx + 1]                    
  53.         PixB = PIX_ori[2][idx + 2]                       
  54.         PixA = PIX_ori[2][idx + 3]                    
  55.         
  56.         x = dx + points[i][0]
  57.         y = dy + points[i][1]

  58.         syl_dur = _KT
  59.         start = _BT
  60.         end = _BT + _SK
  61.         w_mov = (points[i][0]/ _Width[_i] [_j])*syl_dur
  62.          
  63.         EFT1 = an(7)+shad(0)+blur(2)+bord(2)+move(x,y,x,y)+alpha3(242)+fscxy(90,90)+alpha1(255-PixA)+color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))   
  64.         ass_main(ASS_BUF, SubL(start,end+w_mov,3,Pix_Style), EFT1, PixPt())

  65.         ### --(I tried to cut the text_pixle from half (make it half-falf, but it's not coming as I want so I think sthe problem is with _Height[_i][_j] I guess  )-- ###

  66.         py = points[i][1] < _Height[_i][_j] / 2 and -1 or 1  

  67.         xr_mov = -70 + randint(-10,10)
  68.         yr_mov = randint(-15,15)  
  69.         start1 = end+w_mov
  70.         end1 = start1 +100
  71.         ttt = end - start
  72.         x1 = x+xr_mov
  73.         y1 = y+yr_mov
  74.         y2 = y1*py
  75.         FRZ = t(frz(580))+t(frz(-330))
  76.         

  77.         #FX_01 (Normal-Frz)
  78.         if _i ==0 :
  79.             EFT1 = an(7)+FRZ+blur(2)+bord(2)+org(x,y)+move(x+randint(-1,1),y,x1,y1)+fad(0,150)+alpha3(245)+fscxy(90,90)+alpha1(255-PixA) +color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
  80.             ass_main(ASS_BUF, SubL(start1,end1,3,Pix_Style), EFT1, PixPt())

  81.         #FX_012 ( Pixels (half\falf) )
  82.         if _i == 1:
  83.             EFT1 = an(7)+FRZ+blur(2)+bord(2)+org(x,y)+move(x+randint(-1,1),y,x1,y2)+fad(0,150)+alpha3(240)+fscxy(90,90)+alpha1(255-PixA) +color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
  84.             ass_main(ASS_BUF, SubL(start1,end1,3,Pix_Style), EFT1, PixPt())

  85.         #FX_03 (pixels Down)
  86.         if _i == 2:
  87.             EFT1 = an(7)+blur(2)+bord(2)+move(x+randint(-1,1),y,x+randint(-5,5),y+randint(35,45))+fad(0,150)+alpha3(240)+fscxy(90,90)+alpha1(255-PixA) +color1(FmtRGB(PixR,PixG,PixB)) +color3(FmtRGB(PixR,PixG,PixB))
  88.             ass_main(ASS_BUF, SubL(start1,end1,3,Pix_Style), EFT1, PixPt())


  89.     return (ASS_BUF, TCAS_BUF)
复制代码

Rank: 4

沙发
发表于 2014-12-13 01:55:37 |显示全部楼层
TCC
  1. # tcc file version

  2. < tcc file version = 1.0 >


  3. # mode configuration

  4. < inherit ass header = false >
  5. < k mode = normal >
  6. < text layout = horizontal >
  7. < tcaxpy init = true >
  8. < tcaxpy user = false >
  9. < tcaxpy fin = true >


  10. # py settings

  11. < py file = k_test.py >     < beg line = 1 >    < end line = 10 >


  12. # main settings

  13. < k-timed ass file = test.ass >
  14. < font file = hockey.ttf >    < font face id = 1 >    < font size = 40 >
  15. < fx width = 1280 >    < fx height = 720 >    < fx fps = 23.976 >
  16. < alignment = 8 >
  17. < x offset = 0 >    < y offset = 20 >
  18. < spacing = 1 >    < space scale = 1.0 >


  19. # style settings

  20. < font face name = "" >
  21. < bord = 0 >    < shad = 0 >
  22. < primary color = F0E7DA >    < secondary color = FFFFFF >    < outline color = 000066 >    < back color = 000000 >
  23. < primary alpha = 0 >    < secondary alpha = 255 >    < outline alpha = 0 >    < back alpha = 255 >


  24. # additional settings

  25. < blur = 0.0 >
复制代码

Rank: 4

板凳
发表于 2014-12-13 10:37:58 |显示全部楼层
本帖最后由 ALKOON 于 2014-12-13 10:39 编辑


Actually I already know that, I can make it by auto.4 or by using NyuFX, I was doing that since 2010 & there's many ways, but because I'm not familiar with TCAX -_-", anyway I'm not going to fix this one, it's up to who care to use this kind of fx or who will use my script

thank u =D

Rank: 4

地板
发表于 2014-12-13 19:25:21 |显示全部楼层
几年 发表于 2014-12-13 10:50
anyway,thanks for sharing,nice effect.:P

Most welcome =D

Rank: 4

5#
发表于 2014-12-15 16:31:09 |显示全部楼层
Thank you milky =D
but don't you think it's too much that I have to read ? XD
anyway it's helpful, I'll read when I have time ^^.

Rank: 4

6#
发表于 2014-12-16 00:31:11 |显示全部楼层
As u said, the cut should going through the middle of every text.

like that https://mega.co.nz/#!VU0FyCbZ!WV ... _BRRXDvLK-IKM1sPQyI

Rank: 4

7#
发表于 2014-12-16 16:47:27 |显示全部楼层
本帖最后由 ALKOON 于 2014-12-16 16:48 编辑

round(PIX_ori[1][1])
It's better than
_Height[_i][_j]

but not going exactly through the middle of every text .but when I changed the font (capital letters), it's going through the middle of every text when i used _Height[_i][_j]
anyway thank u milky and saiy =D
I will try later again
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-5-6 19:17

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH