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

标题: Position! [打印本页]

作者: Alex    时间: 2014-1-15 15:06:43     标题: Position!

本帖最后由 Alex 于 2014-1-20 02:11 编辑

Hi

in tcc script there is option for the alignment

< alignment = 8 >

I want sometimes the lines (syllable) be in alignment 7 and sometimes in alignment 9

How can I don that?
作者: 四月一日 君寻    时间: 2014-1-16 13:40:22

只能在PY脚本里面修改定位(大概
作者: saiyaku    时间: 2014-1-16 20:28:40

http://www.tcax.org/forum.php?mo ... &extra=page%3D1

You can use these functions.
getpos( i , j [,an,offsetX,offsetY] )  
getpos_vert( i , j [,an,offsetX,offsetY]] )
They'll return a tuple of position.
example:
posX=getpos(_i,_j,7)[0]
posY=getpos(_i,_j,7)[1]

And the default values of an,offsetX,offsetY are according to the settings of tcc file.

作者: milkyjing    时间: 2014-1-16 21:24:49

use the \an tag function

e.g.   EFT = an(9) + t(frx(50))

etc.

if you want get positions for an 8 and 9, use formulas above (by saiyaku)


作者: Alex    时间: 2014-1-16 22:29:43

Thank you very much saiy & Milky
作者: ccx    时间: 2014-1-17 21:48:32

if your question was be finished ,you can change you state,,such as this 【已解决】
作者: Alex    时间: 2014-4-19 22:18:02

本帖最后由 Alex 于 2014-4-19 22:21 编辑

Back XD

this my  simple code
  1.     if _I ==0 and _I == 1:

  2.         _X = getpos(_I,_J,9)[0]        
  3.         _Y = getpos(_I,_J,9)[1]   

  4.     else:
  5.    
  6.         _X = _X     
  7.         _Y = _Y   

  8.         ass_main(ASS_BUF, SubL(_BT,_ET,5),pos(_X,_Y)+an(5)+shad(0)+color1('000000')+color3('FFFFFF'), _TXT )
复制代码
Why when the line in ass file == 0 and ==1 is not taking this position

        _X = getpos(_I,_J,9)[0]        
        _Y = getpos(_I,_J,9)[1]   

but taking this potion

        _X = _X        
        _Y = _Y

as what I wrote  the first line and second (1 & 2) should have the 1st position and the 3 line should have the second potion (_X = _X \ _Y = _y)


all lines taking the second position!!!
  1. Dialogue: 0,0:00:40.77,0:00:43.20,Default3,,0,0,0,,{\k36}Hey! {\k21}dou{\k13}shi{\k32}te {\k24}bo{\k24}ku {\k16}wa {\k16}ma{\k15}tte{\k14}i{\k32}ta
  2. Dialogue: 0,0:00:43.20,0:00:45.86,Default3,,0,0,0,,{\k12}u{\k21}su{\k15}gu{\k29}rai {\k20}he{\k20}ya {\k44}hi{\k38}to{\k22}ri{\k22}ki{\k23}ri
  3. Dialogue: 0,0:00:45.91,0:00:48.18,Default3,,0,0,0,,{\k29}Hey! {\k25}dou{\k12}shi{\k27}te {\k28}bo{\k14}ku {\k10}wa {\k21}ma{\k22}tte{\k17}i{\k22}ta
复制代码
??
作者: milkyjing    时间: 2014-4-20 21:13:29

Alex 发表于 2014-4-19 22:18
Back XD

this my  simple codeWhy when the line in ass file == 0 and ==1 is not taking this position ...

Maybe it's just because of the wrong indentation (of the line 11, reduce 4 white spaces)


作者: Alex    时间: 2014-4-20 22:03:24



I have did a lots of tests, but still -_-

even If I write like that
  1.     if _I ==0:
  2.         _X = getpos(_I,_J,9)[0]        
  3.         _Y = getpos(_I,_J,9)[1]   
  4.     else:
  5.         _X = _X     
  6.         _Y = _Y   
  7.         ass_main(ASS_BUF, SubL(_BT,_ET),pos(_X,_Y)+an(5)+shad(0)+bord(0)+color1('000000'), _TXT )
复制代码
he's going to ignoring the firs line is ass file
the script only applying on the second & third line ><"
  1. Dialogue: 0,0:00:40.77,0:00:43.20,Default3,,0,0,0,,{\k36}Hey! {\k21}dou{\k13}shi{\k32}te {\k24}bo{\k24}ku {\k16}wa {\k16}ma{\k15}tte{\k14}i{\k32}ta
  2. Dialogue: 0,0:00:43.20,0:00:45.86,Default3,,0,0,0,,{\k12}u{\k21}su{\k15}gu{\k29}rai {\k20}he{\k20}ya {\k44}hi{\k38}to{\k22}ri{\k22}ki{\k23}ri
  3. Dialogue: 0,0:00:45.91,0:00:48.18,Default3,,0,0,0,,{\k29}Hey! {\k25}dou{\k12}shi{\k27}te {\k28}bo{\k14}ku {\k10}wa {\k21}ma{\k22}tte{\k17}i{\k22}ta
复制代码

作者: Alex    时间: 2014-4-20 22:03:40

本帖最后由 Alex 于 2014-4-20 22:07 编辑



I have did a lots of tests, but still -_-

even If I write like that
  1.     if _I ==0:
  2.         _X = getpos(_I,_J,9)[0]        
  3.         _Y = getpos(_I,_J,9)[1]   
  4.     else:
  5.         _X = _X     
  6.         _Y = _Y   
  7.         ass_main(ASS_BUF, SubL(_BT,_ET),pos(_X,_Y)+an(5)+shad(0)+bord(0)+color1('000000'), _TXT )
复制代码
he's going to ignoring the firs line in ass file
the script only applying on the second & third line ><"
  1. Dialogue: 0,0:00:40.77,0:00:43.20,Default3,,0,0,0,,{\k36}Hey! {\k21}dou{\k13}shi{\k32}te {\k24}bo{\k24}ku {\k16}wa {\k16}ma{\k15}tte{\k14}i{\k32}ta
  2. Dialogue: 0,0:00:43.20,0:00:45.86,Default3,,0,0,0,,{\k12}u{\k21}su{\k15}gu{\k29}rai {\k20}he{\k20}ya {\k44}hi{\k38}to{\k22}ri{\k22}ki{\k23}ri
  3. Dialogue: 0,0:00:45.91,0:00:48.18,Default3,,0,0,0,,{\k29}Hey! {\k25}dou{\k12}shi{\k27}te {\k28}bo{\k14}ku {\k10}wa {\k21}ma{\k22}tte{\k17}i{\k22}ta
复制代码

作者: Alex    时间: 2014-4-20 23:07:00

Now it's ok, but when i'm writing

    if _I ==0 and _I ==3 :

Is not working at all, so I think it's wrong to write something like that
anyway I will find out =D
作者: milkyjing    时间: 2014-4-21 21:28:57

Alex 发表于 2014-4-20 23:07
Now it's ok, but when i'm writing

    if _I ==0 and _I ==3 :

_I can not be 0 and at the same time be 3

maybe you should use

if _I == 0 or _I == 3:

instead ?
作者: Alex    时间: 2014-4-22 14:17:48

Because in lua it could be ^^
Thank you. Now I have done with this question
Shishime




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