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

 找回密码
 新人加入
查看: 5010|回复: 1

[完整特效] TCAX 三段样式的制作方法(待改进) [复制链接]

Rank: 4

发表于 2022-3-6 02:35:07 |显示全部楼层
本帖最后由 Seekladoom 于 2022-3-6 02:56 编辑

注:如下压缩包中的样式目前是先用Aegisub设置好以后,再用TCAX的tcc文件中的< inherit ass header = true >这行代码生成的:
【TCAX】Little Busters OP 三段样式(OPJP、OPJP 2、OPJP 3).rar (13.47 KB, 下载次数: 2469)

压缩包中的内容
三段.png


tcc文件中的< inherit ass header = true >
继承ASS文件头部样式.png


中日特效同时生成

优点:一次性生成
缺点:目前tcc文件一次只能设置一个样式,其他样式要正常实现,需要在tcc的基础上对py脚本中的相应行修改ASS特效标签
合并.png


【Python脚本】
  1. from tcaxPy import *

  2. def tcaxPy_Init():
  3.     pass
  4.    
  5. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
  6.     ASS_BUF = []        # used for saving ASS FX lines

  7.     # ----------日文----------
  8.     if _i < 3:#OPJP
  9.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_BT+_SK,0,'OPJP'), an(5)+pos(_X,_Y)+color1('3767E6')+color3('FFFFFF')+blur(2)+fad(200,0), _TXT)             #入场特效 - start2syl
  10.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,0,'OPJP'), an(5)+pos(_X,_Y)+blur(2)+t(color1('FFFFFF')+color3('3767E6')), _TXT)                     #卡拉OK特效 - syl
  11.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_n-_j-1)*3+20,0,'OPJP'), an(5)+pos(_X,_Y)+color1('FFFFFF')+color3('3767E6')+blur(2)+fad(0,200), _TXT)  #退场特效 - syl2end
  12.         
  13.     if _i > 2 and _i < 6:#OPJP 2
  14.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_BT+_SK,0,'OPJP 2'), an(5)+pos(_X,_Y)+color1('3767E6')+color3('FFFFFF')+blur(2)+fad(200,0), _TXT)             #入场特效 - start2syl
  15.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,0,'OPJP 2'), an(5)+pos(_X,_Y)+blur(2)+t(color1('FFFFFF')+color3('3767E6')), _TXT)                     #卡拉OK特效 - syl
  16.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_n-_j-1)*3+20,0,'OPJP 2'), an(5)+pos(_X,_Y)+color1('FFFFFF')+color3('3767E6')+blur(2)+fad(0,200), _TXT)  #退场特效 - syl2end
  17.         
  18.     if _i > 5 and _i < 9:#OPJP 3
  19.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_BT+_SK,0,'OPJP 3'), an(5)+pos(_X,_Y)+color1('3767E6')+color3('FFFFFF')+blur(2)+fad(200,0), _TXT)             #入场特效 - start2syl
  20.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,0,'OPJP 3'), an(5)+pos(_X,_Y)+blur(2)+t(color1('FFFFFF')+color3('3767E6')), _TXT)                     #卡拉OK特效 - syl
  21.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_n-_j-1)*3+20,0,'OPJP 3'), an(5)+pos(_X,_Y)+color1('FFFFFF')+color3('3767E6')+blur(2)+fad(0,200), _TXT)  #退场特效 - syl2end
  22.         
  23.     # ----------中文----------
  24.     if _i > 8 and _i < 12:#OPCN
  25.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_ET-(_n-_j-1)*3+20,0,'OPCN'), pos(_X,_Y+1038)+blur(2)+fad(200,200), _TXT)  #整体特效 - line
  26.    
  27.     if _i > 11 and _i < 15:#OPCN 2
  28.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_ET-(_n-_j-1)*3+20,0,'OPCN 2'), pos(_X,_Y+1038)+blur(2)+fad(200,200), _TXT)  #整体特效 - line

  29.     if _i > 14 and _i < 18:#OPCN 3
  30.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_ET-(_n-_j-1)*3+20,0,'OPCN 3'), pos(_X,_Y+1038)+blur(2)+fad(200,200), _TXT)  #整体特效 - line
  31.         
  32.     return (ASS_BUF, None)
复制代码
【TCC】
  1. # tcc file version
  2. < tcc file version = 1.000 >

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

  10. # py settings
  11. < py file = Little Busters OP.py >    < beg line = 1 >    < end line = 0 >

  12. # main settings
  13. < k-timed ass file = LBOP_K.ass >
  14. < font file = SourceHanSerif-Bold.otf >    < font face id = 1 >    < font size = 70 >
  15. < fx width = 1920 >    < fx height = 1080 >    < fx fps = 23.976 >
  16. < alignment = 8 >
  17. < x offset = 0 >    < y offset = 0 >
  18. < spacing = 3 >    < space scale = 1.0 >

  19. # style settings
  20. < font face name = "" >
  21. < bord = 0 >    < shad = 0 >
  22. < primary color = FFFFFF >    < secondary color = 000000 >    < outline color = 000000 >    < back color = 000000 >
  23. < primary alpha = 0 >    < secondary alpha = 0 >    < outline alpha = 0 >    < back alpha = 0 >

  24. # additional settings
  25. < blur = 0.000 >
复制代码

中日特效分开生成(需最后复制粘贴回来)

优点:中文和日文样式不易搞混
缺点:两个字幕最后需要手动复制粘贴合并到一起,再进行压制
分开.png


【Python脚本:Little Busters OPJP】
  1. from tcaxPy import *

  2. def tcaxPy_Init():
  3.     pass
  4.    
  5. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _WID, _TXT):
  6.     ASS_BUF = []        # used for saving ASS FX lines
  7.    
  8.     # ----------日文----------
  9.     if _i < 3:#OPJP
  10.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_BT+_SK,0,'OPJP'), an(5)+pos(_X,_Y)+color1('3767E6')+color3('FFFFFF')+blur(2)+fad(200,0), _TXT)             #入场特效 - start2syl
  11.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,0,'OPJP'), an(5)+pos(_X,_Y)+blur(2)+t(color1('FFFFFF')+color3('3767E6')), _TXT)                     #卡拉OK特效 - syl
  12.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_n-_j-1)*3+20,0,'OPJP'), an(5)+pos(_X,_Y)+color1('FFFFFF')+color3('3767E6')+blur(2)+fad(0,200), _TXT)  #退场特效 - syl2end
  13.         
  14.     if _i > 2 and _i < 6:#OPJP 2
  15.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_BT+_SK,0,'OPJP 2'), an(5)+pos(_X,_Y)+color1('3767E6')+color3('FFFFFF')+blur(2)+fad(200,0), _TXT)             #入场特效 - start2syl
  16.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,0,'OPJP 2'), an(5)+pos(_X,_Y)+blur(2)+t(color1('FFFFFF')+color3('3767E6')), _TXT)                     #卡拉OK特效 - syl
  17.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_n-_j-1)*3+20,0,'OPJP 2'), an(5)+pos(_X,_Y)+color1('FFFFFF')+color3('3767E6')+blur(2)+fad(0,200), _TXT)  #退场特效 - syl2end
  18.         
  19.     if _i > 5 and _i < 9:#OPJP 3
  20.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_BT+_SK,0,'OPJP 3'), an(5)+pos(_X,_Y)+color1('3767E6')+color3('FFFFFF')+blur(2)+fad(200,0), _TXT)             #入场特效 - start2syl
  21.         ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT,0,'OPJP 3'), an(5)+pos(_X,_Y)+blur(2)+t(color1('FFFFFF')+color3('3767E6')), _TXT)                     #卡拉OK特效 - syl
  22.         ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET-(_n-_j-1)*3+20,0,'OPJP 3'), an(5)+pos(_X,_Y)+color1('FFFFFF')+color3('3767E6')+blur(2)+fad(0,200), _TXT)  #退场特效 - syl2end

  23.     return (ASS_BUF, None)
复制代码
【TCC:Little Busters OPJP】
  1. # tcc file version
  2. < tcc file version = 1.000 >

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

  10. # py settings
  11. < py file = Little Busters OPJP.py >    < beg line = 1 >    < end line = 0 >

  12. # main settings
  13. < k-timed ass file = LBOP_K.ass >
  14. < font file = SourceHanSerif-Bold.otf >    < font face id = 1 >    < font size = 70 >
  15. < fx width = 1920 >    < fx height = 1080 >    < fx fps = 23.976 >
  16. < alignment = 8 >
  17. < x offset = 0 >    < y offset = 5 >
  18. < spacing = 3 >    < space scale = 1.0 >

  19. # style settings
  20. < font face name = "" >
  21. < bord = 0 >    < shad = 0 >
  22. < primary color = FFFFFF >    < secondary color = 000000 >    < outline color = 000000 >    < back color = 000000 >
  23. < primary alpha = 0 >    < secondary alpha = 0 >    < outline alpha = 0 >    < back alpha = 0 >

  24. # additional settings
  25. < blur = 0.000 >
复制代码
【Python脚本:Little Busters OPCN】
  1. from tcaxPy import *

  2. def tcaxPy_Init():
  3.     pass
  4.    
  5. def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _WID, _TXT):
  6.     ASS_BUF = []        # used for saving ASS FX lines
  7.    
  8.     # ----------中文----------
  9.     if _i > 8 and _i < 12:#OPCN
  10.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_ET-(_n-_j-1)*3+20,0,'OPCN'), pos(_X,_Y)+blur(2)+fad(200,200), _TXT)  #整体特效 - line
  11.    
  12.     if _i > 11 and _i < 15:#OPCN 2
  13.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_ET-(_n-_j-1)*3+20,0,'OPCN 2'), pos(_X,_Y)+blur(2)+fad(200,200), _TXT)  #整体特效 - line

  14.     if _i > 14 and _i < 18:#OPCN 3
  15.         ass_main(ASS_BUF, SubL(_BT+_j*3-20,_ET-(_n-_j-1)*3+20,0,'OPCN 3'), pos(_X,_Y)+blur(2)+fad(200,200), _TXT)  #整体特效 - line
  16.         
  17.     return (ASS_BUF, None)
复制代码
【TCC:Little Busters OPCN】
  1. # tcc file version
  2. < tcc file version = 1.000 >

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

  10. # py settings
  11. < py file = Little Busters OPCN.py >    < beg line = 1 >    < end line = 0 >

  12. # main settings
  13. < k-timed ass file = LBOP_K.ass >
  14. < font file = SourceHanSerifSC-Bold.otf >    < font face id = 1 >    < font size = 70 >
  15. < fx width = 1920 >    < fx height = 1080 >    < fx fps = 23.976 >
  16. < alignment = 2 >
  17. < x offset = 0 >    < y offset = -24 >
  18. < spacing = 6 >    < space scale = 1.0 >

  19. # style settings
  20. < font face name = "" >
  21. < bord = 0 >    < shad = 0 >
  22. < primary color = FFFFFF >    < secondary color = 000000 >    < outline color = 000000 >    < back color = 000000 >
  23. < primary alpha = 0 >    < secondary alpha = 0 >    < outline alpha = 0 >    < back alpha = 0 >

  24. # additional settings
  25. < blur = 0.000 >
复制代码

Rank: 4

发表于 2022-3-6 03:05:29 |显示全部楼层
本帖最后由 Seekladoom 于 2022-3-6 03:09 编辑

相关链接:
建议允许多样式


目前的TCAX自身还不支持多样式设置,但可以通过1楼的方法降低TCAX设置多段样式的难度,进一步简化看后续TCAX的GUI开发工作了,敬请期待。

您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-12-6 21:10

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH