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

标题: Apply script! [打印本页]

作者: Alex    时间: 2013-9-8 05:09:09     标题: Apply script!

Hi,

Why the effect(script) only applied on the first line of ass k-time file?
  1. Dialogue: 0,0:00:08.36,0:00:15.90,Default,,0000,0000,0000,,{\K52}{\K41}夜{\K37}ヲ{\K22}{\K45}覆{\K36}ウ{\K15}目{\K47}蓋{\K23}{\K23}開{\K53}ケ{\K0} {\K29}凶{\K41}キ{\K28}影{\K15}ヲ{\K28}恐{\K13}レ{\K14}ル{\K14}ナ{\K14}カ{\K164}レ
  2. Dialogue: 0,0:00:18.79,0:00:31.80,Default,,0000,0000,0000,,{\K43}{\K73}仄{\K15}く{\K29}ら{\K48}き{\K117}柩{\K42}か{\K61}ら{\K233} {\K45}産{\K55}み{\K15}堕{\K12}と{\K36}さ{\K43}れ{\K70}た{\K56}{\K104}人{\K61}形{\K42}の{\K22}よ{\K25}う{\K54}に
复制代码

作者: Alex    时间: 2013-9-8 12:32:21

本帖最后由 Alex 于 2013-9-8 12:41 编辑

Anyway

I found the solution,  I have to change  end line number


< py file = bezier.py >     < beg line = 1 >    < end line = 5 >
作者: Alex    时间: 2013-9-8 14:58:20

I have another question

What is the best position for _x & _y to use it for romaji (English) ?

  1.     dx = _x  
  2.     dy = _y
复制代码

作者: milkyjing    时间: 2013-9-8 18:37:02

Alex 发表于 2013-9-8 14:58
I have another question

What is the best position for _x & _y to use it for romaji (English) ?

I think this script can also be applied on romaji karaoke files without modification :)

So you started using TCAX? cool~
作者: Alex    时间: 2013-9-8 21:07:52

本帖最后由 Alex 于 2013-9-8 21:09 编辑

thank you

this is my first FX by using TCAX
D files : http://www.speedyshare.com/EXSu9/test-s.zip

I used showjim old script, to start with TCAX
  1.     dx, dy = _x, _y

  2.     if _j == 0:
  3.         global infad
  4.         infad = 0

  5.     c1, c3 = "\\1c&HFFFFFF&", "\\3c&HFFFFFF&"
  6.     dur2 = _k * 20 + infad

  7.     line_fx = "\\bord1\\blur2\\3a&H30&"
  8.     text = "{\\an5%s%s\\move(%f1.2,%f1.2,%f1.2,%f1.2)\\fad(%f1.2,0)\\org(%f1.2,%f1.2)%s}%s" % (c1,c3,dx+70,dy,dx,dy,infad/2, dx,dy, line_fx,_txt)
  9.     ass_main(ASS_BUF, SubL(_start - 200 + infad, _start - 8 + infad, 2), '', text)

  10.     text = "{\\an5%s%s\\bord1\\blur2\\3a&H30&\\move(%f1.2,%f1.2,%f1.2,%f1.2)%s}%s" % (c1,c3,dx,dy,dx,dy,line_fx,_txt)=D
  11.     ass_main(ASS_BUF, SubL(_start - 8 + infad, _start + _elapk , 2), '', text)
  12.     infad += 50 / _n

  13.     text = "{\\an5%s%s\\bord1\\blur2\\3a&H30&\\move(%f1.2,%f1.2,%f1.2,%f1.2)\\t(\\fscx150\\fscy150)\\t(\\alpha&H%d&)%s} %s" % (c1,c3,dx, dy, dx ,dy,dur2,line_fx,_txt)
  14.     ass_main(ASS_BUF, SubL(_start + _elapk, _start + _elapk + _k*1.5, 3), '', text)
复制代码
thank you =D
作者: Alex    时间: 2013-9-8 21:11:14



My new question is, how i will use char method and pixel ?

作者: milkyjing    时间: 2013-9-8 21:12:04

Alex 发表于 2013-9-8 21:07
thank you

this is my first FX by using TCAX


Good job~

tips: TCAX provides ASS tag functions, such as pos(_x, _y), t(t1, t2, a, code), color1("aabbcc"), etc.

they are more convenient and are recommended when writing TCAX scripts. check any of the existing scripts you'll find how to use these tag functions.


作者: milkyjing    时间: 2013-9-8 21:17:56

Alex 发表于 2013-9-8 21:11
My new question is, how i will use char method and pixel ?


Several ways,

here is one example,

http://www.tcax.org/forum.php?mod=viewthread&tid=176

other recommended tutorials (not related)
http://www.tcax.org/forum.php?mod=viewthread&tid=177
http://www.tcax.org/forum.php?mod=viewthread&tid=178

a good way for learning to write TCAX scripts is to check out the shared existing ones
http://www.tcax.org/forum.php?mod=forumdisplay&fid=42
作者: Alex    时间: 2013-9-8 21:33:22

本帖最后由 Alex 于 2013-9-8 21:34 编辑
milkyjing 发表于 2013-9-8 21:12
Good job~

tips: TCAX provides ASS tag functions, such as pos(_x, _y), t(t1, t2, a, code), color1( ...


yes I know that, and it's same like a lua by using  zheox library (zheolib \ Spanish guy)
but i like to use a lua method
no problem i will start to use provides way =D

thank you 4 examples and tutorials


-
作者: Alex    时间: 2013-9-13 17:22:54

there is problem in line 39 - return (ASS_BUF, TCAS_BUF)
I don't know why exactly ?
  1. from tcaxPy import *
  2. from extLibs.small_code import *


  3. def tcaxPy_Init():
  4.     global _Fs
  5.     global _Spacing
  6.     global Font
  7.     global pos_fix
  8.     _FontFileName = GetVal(val_FontFileName)
  9.     _FaceID       = GetVal(val_FaceID)
  10.     _Fs           = GetVal(val_FontSize)
  11.     _Spacing = GetVal(val_Spacing)
  12.     Font = InitFont(_FontFileName, _FaceID, _Fs, _Spacing, GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 0, False)


  13. def tcaxPy_Fin():
  14.     FinFont(Font)

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

  16.     ASS_BUF  = []      
  17.     TCAS_BUF = []   

  18.     dx = _x         
  19.     dy = _y     

  20.     ts_0 = _start - 40 + 2 * _FD / 10 * _j
  21.     ts = ts_0 + 40
  22.     te = _end - 2 * _FD / 10 * (_n - _j - 1)
  23.     te_0 = te + 40


  24.     ass_main(ASS_BUF, SubL(Start = ts_0, End = ts_0 + 40, Layer = 1), mov(_x + 50, _y - 20, _x, _y) + fad(300, 0) + bord(3) + blur(2), _txt)
  25.     ass_main(ASS_BUF, SubL(Start = ts_0, End = ts_0 + 40, Layer = 2), mov(_x + 50, _y - 20, _x, _y) + fad(300, 0) + bord(1) + color3('000000'), _txt)
  26.     ass_main(ASS_BUF, SubL(Start = ts_0, End = ts_0 + 40, Layer = 3), mov(_x + 50, _y - 20, _x, _y) + fad(300, 0) + bord(0), _txt)


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



作者: milkyjing    时间: 2013-9-13 23:48:43

Alex 发表于 2013-9-13 17:22
there is problem in line 39 - return (ASS_BUF, TCAS_BUF)
I don't know why exactly ?

This is a Python Grammar error... Python requires strict indention.

The code of the same level (block) should be aligned, i.e., have the same indention.

so, the solution to your question is to add two more white spaces to the beginning of line 39 - return (ASS_BUF, TCAS_BUF)
作者: Alex    时间: 2013-9-14 00:04:25

本帖最后由 Alex 于 2013-9-14 13:58 编辑

Yeah, u r right, it's working now

k, I used picture after that I applied the effect(script), the result was TCAS file not ass file (fx)
so what is the way to deal with this kind of file?


sorry man, I have a lots of questions
作者: milkyjing    时间: 2013-9-14 19:43:55

Alex 发表于 2013-9-14 00:04
Yeah, u r right, it's working now

k, I used picture after that I applied the effect(script), the re ...


use AVS script to do the preview.

to preview ASS file, we use VSFilter.dll plugin and TextSub function

Analogously, we use TcasFilter.dll plugin (placed in the TCAX's root directory) and TcasSub function to preview TCAS file

p.s. feel free to ask


作者: Alex    时间: 2013-9-14 20:52:31

本帖最后由 Alex 于 2013-9-15 02:07 编辑


thank you
作者: Alex    时间: 2013-9-15 02:56:19

本帖最后由 Alex 于 2013-9-15 03:03 编辑

Wt is the problem again  



font+script+ass file+pic : http://www.megafileupload.com/en/file/450991/test-fx-zip.html



-
作者: saiyaku    时间: 2013-9-15 14:36:18

Alex 发表于 2013-9-15 02:56
Wt is the problem again   

Set the tag of TCC file 'tcaxpy user' =false,the problem will be solved.
FYI: TCC File Format Specification http://www.tcax.org/forum.php?mod=viewthread&tid=25
作者: Alex    时间: 2013-9-15 15:55:07

本帖最后由 Alex 于 2013-9-15 16:03 编辑

thank you,

it's really good to learn and know new things


OK, I want to know how can i use char(fx)
and is this tool supporting Arabic lang.


thank you  
作者: milkyjing    时间: 2013-9-15 19:09:13

Alex 发表于 2013-9-15 15:55
thank you,

it's really good to learn and know new things


what do you mean by char fx? sorry, but I'm not familiar with Aegisub.

give some specific example (the char fx you want to create), then I may help you figure it out about how to do the same thing in TCAX.

I didn't test TCAX with Arabic Language, but I think it does support. since the font Engine used by TCAX is the great FreeType Library, if you encounter any problem, please inform me.  


作者: Alex    时间: 2013-9-15 20:08:08

本帖最后由 Alex 于 2013-9-15 20:11 编辑

Char = character (letter)
it's making each letter separately in each line

Eaxample : http://docs.aegisub.org/manual/K ... _Template_modifiers

Other modifiers >> Char

I read that FreeType Library supporting AR language (Right to left Language)
anyway i will test by myself  


thank you
作者: milkyjing    时间: 2013-9-17 23:33:47

Alex 发表于 2013-9-15 20:08
Char = character (letter)
it's making each letter separately in each line

Open a TCC file, and set < k mode = normal > to syllable ?

I don't know what exactly you want, since I'm not too familiar with Aegisub.

you can try this exampel http://tcxcore.googlecode.com/files/example.zip and learn the TCAX way to accomplish your FX if you have enough interests.
作者: Alex    时间: 2013-9-18 06:26:14

本帖最后由 Alex 于 2013-9-18 06:32 编辑

I already saw this example, I think there's no a property/advantage (function) in TCAX to helping make a simple char fx

there is a char function in aegisub (Template/auto.4) & NyuFx(line/syl/char/word) to separately each letter in each line
eaxmple :

{\k20}ko{\k35}ne
it will be like this if we are going to use char property(function)
{\k10}k
{\k10}o
{\k12}n
{\k13}e


I think u you guys not interesting about it, because chines alphabet no need for this kind of property

I can't make like this effect if there is no like this function
anyway, thank u very much =D



作者: Alex    时间: 2013-9-19 21:40:58

finally, I found the method to make that effect
testings still continue XD
作者: milkyjing    时间: 2013-9-23 21:41:55

Alex 发表于 2013-9-18 06:26
I already saw this example, I think there's no a property/advantage (function) in TCAX to helping ma ...

it can be done in TCAX, through the method in my previous post, well, which you may have already found?
作者: milkyjing    时间: 2013-9-23 21:42:10

Alex 发表于 2013-9-19 21:40
finally, I found the method to make that effect
testings still continue XD

good to see you still active.




欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/) Powered by Discuz! X2