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

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

[已解决] Position! [复制链接]

Rank: 4

跳转到指定楼层
楼主
发表于 2014-1-15 15:06:43 |只看该作者 |正序浏览
本帖最后由 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?

Rank: 4

13#
发表于 2014-4-22 14:17:48 |只看该作者
Because in lua it could be ^^
Thank you. Now I have done with this question
Shishime

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

12#
发表于 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 ?

Rank: 4

11#
发表于 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

Rank: 4

10#
发表于 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
复制代码

Rank: 4

9#
发表于 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
复制代码

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

8#
发表于 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)

Rank: 4

7#
发表于 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
复制代码
??

Rank: 4

6#
发表于 2014-1-17 21:48:32 |只看该作者
if your question was be finished ,you can change you state,,such as this 【已解决】

Rank: 4

5#
发表于 2014-1-16 22:29:43 |只看该作者
Thank you very much saiy & Milky

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

地板
发表于 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)

Administrator

Shanzhai Pro.

Rank: 7Rank: 7Rank: 7

板凳
发表于 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.

Moderator

youkaze

Rank: 5Rank: 5

沙发
发表于 2014-1-16 13:40:22 |只看该作者
只能在PY脚本里面修改定位(大概
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-11-22 12:28

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH