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

 找回密码
 新人加入
查看: 2744|回复: 4

[已解决] 请问关于PixPoints [复制链接]

Rank: 4

发表于 2014-6-23 14:00:41 |显示全部楼层
本帖最后由 孫悟 于 2014-6-24 08:51 编辑

PixPoints的说明是写

Returns:
((x1, y1), (x2, y2), ...)

我试着print回传值却有三个值
请问这三个各代表什么呢(?)
感谢

Administrator

Shanzhai Pro.

Rank: 7Rank: 7Rank: 7

发表于 2014-6-23 18:09:46 |显示全部楼层
麻煩給一下 具體的腳本和 print出來的數據
太久沒用這函數 記不清了
不應該有三個值才對

Rank: 4

发表于 2014-6-23 19:36:55 |显示全部楼层
本帖最后由 孫悟 于 2014-6-23 19:39 编辑
saiyaku 发表于 2014-6-23 18:09
麻煩給一下 具體的腳本和 print出來的數據
太久沒用這函數 記不清了
不應該有三個值才對 ...


未命名00.png
  1. from tcaxPy import *


  2. def tcaxPy_Init():
  3.     global _FD                         # frame duration, in millisecond
  4.     global _Fs
  5.     global Font
  6.     global fire_str
  7.     _FD = 1000 / GetVal(val_FXFPS)
  8.     _Fs = GetVal(val_FontSize)
  9.     Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
  10.     fire_str = ('{\\p5}m 0 0 b 8 1 9 -28 -2 -41 b 3 -23 -17 0 0 0{\\p0}',
  11.                 '{\\p5}m 1 41 b 20 39 1 13 13 -11 b 5 1 -18 22 1 41{\\p0}',
  12.                 '{\\p4}m 6 39 b 4 29 1 13 27 -37 b -1 -3 -15 34 6 39{\\p0}',
  13.                 '{\\p5}m -3 43 b -9 22 -1 33 16 -47 b 1 3 -17 0 -3 43{\\p0}')
  14. def tcaxPy_Fin():
  15.     FinFont(Font)


  16. time_gap = 1    # you can change this value to 0, or 2 or any other number
  17. time_fac = 1    # you can change this value to 0, or 2 or any other number

  18. def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
  19.     ASS_BUF  = []        # used for saving ASS FX lines
  20.     TCAS_BUF = []        # used for saving TCAS FX raw data

  21.     ts = _start + _j * time_fac * _FD / 10 - time_gap * _FD / 10
  22.     te = _end - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 - 30
  23.     count = int(te - ts)
  24.     step = int(_FD / 10)
  25.     PIX = TextPix(Font, _txt)
  26.     points = PixPoints(PIX)
  27.     pt_num = len(points)
  28.     print(points[0])
  29.     dx = _x - int(_a / 2 + 0.5) + PIX[0][0]
  30.     dy = _y - int(_Fs / 2 + 0.5) + PIX[0][1]
  31.     for i in range(0, count, step):
  32.         pt = points[randint(0, pt_num - 1)]
  33.         t0 = randint(int(ts), int(te))
  34.         t1 = t0 + 30
  35.         tmpz = randint(0, 359)
  36.         tmpstr = fire_str[randint(0, 3)]
  37.         x = dx + pt[0]
  38.         y = dy + pt[1]
  39.         EFT = move(x, y, x, y - 25) + \
  40.               alpha1(100) + color1('3F7EF6') + alpha3(150) + color3('3F7EF6') + \
  41.               bord(3) + blur(3) + frz(tmpz) + t(fsc(80, 80) + bord(1) + fry(361) + frz(-57)) + fad(0, 200)
  42.         ass_main(ASS_BUF, SubL(t0, t1, 10, Pix_Style), EFT, tmpstr)
  43.     return (ASS_BUF, TCAS_BUF)
复制代码
脚本是用[内置特效EXT]火焰效果test

print在代码第34行

Administrator

Shanzhai Pro.

Rank: 7Rank: 7Rank: 7

发表于 2014-6-23 20:31:25 |显示全部楼层
哦 第三個值 應該是透明度

Rank: 4

发表于 2014-6-24 08:51:05 |显示全部楼层
saiyaku 发表于 2014-6-23 20:31
哦 第三個值 應該是透明度

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

GitHub|TCAX 主页

GMT+8, 2024-4-19 06:26

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH