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

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

[已解决] Usage of BigPix [复制链接]

Moderator

Effect Researcher.

Rank: 5Rank: 5

跳转到指定楼层
楼主
发表于 2016-4-8 14:43:55 |显示全部楼层 |倒序浏览
本帖最后由 面麻 于 2016-4-11 15:15 编辑

Problem: I tried to make pix of a line as a whole, but no words showed when previewing avs script.
Is it the reason that I made wrong with the usage of gloabl variable?
Or the misunderstanding of BigPix structure, especially the InitBigPix() function?

Codes listed below:
  1. from tcaxPy import *


  2. def tcaxPy_Init():
  3.     global font
  4.     global font_out
  5.     global font_size
  6.     font_file   = GetVal(val_FontFileName)
  7.     face_id     = GetVal(val_FaceID)
  8.     font_size   = GetVal(val_FontSize)
  9.     spacing     = GetVal(val_Spacing)
  10.     space_scale = GetVal(val_SpaceScale)
  11.     color       = DecRGB(GetVal(val_1C))
  12.     bord        = GetVal(val_Bord)
  13.     font = InitFont(font_file, face_id, font_size, spacing, space_scale, color, bord, 0)
  14.     font_out = InitFont(font_file, face_id, font_size, spacing, space_scale, color, 3 * bord, 1)


  15. def tcaxPy_User():
  16.     pass


  17. def tcaxPy_Fin():
  18.     FinFont(font)
  19.     FinFont(font_out)


  20. def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):

  21.     #ASS_BUF  = []        # used for saving ASS FX lines
  22.     TCAS_BUF = []        # used for saving TCAS FX raw data

  23.     # an5 -> an7, TCAS uses an7
  24.     ux = _x - int(_a / 2 + 0.5)
  25.     uy = _y - int(font_size / 2 + 0.5)

  26.     if _j == 0:
  27.         global LINEPIX
  28.         LINEPIX = InitBigPix()

  29.     texture = ImagePix('x3.png')
  30.     PIX = TextPix(font, _txt)
  31.     PIX = PixTexture(PIX, texture)
  32.     BORD = TextPix(font_out, _txt)
  33.     BORD = PixColorRGB(BORD, 0xFF0000)
  34.     BORD = PixBlur(BORD, 4)

  35.     PIX = CombinePixs(BORD, PIX)
  36.     BigPixAdd(LINEPIX, PIX, ux, uy, 0)

  37.     if _j == _n - 1:
  38.         ALINEPIX = ConvertBigPix(LINEPIX)
  39.         #tcaxLog(ALINEPIX)

  40.         ts = 10 * _start
  41.         te = 10 * _end

  42.         tcas_main(TCAS_BUF, ALINEPIX, ts, te, ux, uy, 0)

  43.     return (None, TCAS_BUF)
复制代码

Moderator

Effect Researcher.

Rank: 5Rank: 5

沙发
发表于 2016-4-8 21:25:05 |显示全部楼层
It's pretty grateful of you to offer me these references.
After learning about basic conception of tcas, it seems that creating a line effect has become more difficult than syllable effects, such as line clip.
Maybe it's because of my lack of knowledge about tcas. (Ignore this //
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-5-3 05:30

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH