TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua
标题:
【PyonFX相关】时间控制函数写法(参考Aegisub的retime)
[打印本页]
作者:
Seekladoom
时间:
2022-4-19 03:41:20
标题:
【PyonFX相关】时间控制函数写法(参考Aegisub的retime)
本帖最后由 Seekladoom 于 2022-4-19 03:43 编辑
from pyonfx import *
from random import *
io = Ass("番剧名_K.ass", "番剧名_FX.ass")
meta, styles, lines = io.get_data()
# 模板分区
def Princess_OPJP(line, l):
if line.style == "OPJP":
#以下是在Aegisub下的retime函数中的【开始时间】和【结束时间】均为0时,PyonFX中可以直接使用的【列表属性写法】。
# syl
l.start_time = line.start_time + syl.start_time
l.end_time = line.start_time + syl.end_time
# presyl
l.start_time = line.start_time + syl.start_time
l.end_time = line.start_time + syl.start_time
# postsyl
l.start_time = line.start_time + syl.end_time
l.end_time = line.start_time + syl.end_time
# line
l.start_time = line.start_time
l.end_time = line.end_time
# preline
l.start_time = line.start_time
l.end_time = line.start_time
# postline
l.start_time = line.end_time
l.end_time = line.end_time
# start2syl
l.start_time = line.start_time
l.end_time = line.start_time + syl.start_time
# syl2end
l.start_time = line.start_time + syl.end_time
l.end_time = line.end_time
# set or abs
l.start_time = 0
l.end_time = 0
# sylpct
l.start_time = line.start_time + syl.start_time
l.end_time = line.start_time + syl.start_time
#以下是在Aegisub下的retime函数中的【开始时间】和【结束时间】均为0时,PyonFX中可以考虑的【简化写法】。
# syl
l.start_time = _lstart + _sstart
l.end_time = _lstart + _send
# presyl
l.start_time = _lstart + _sstart
l.end_time = _lstart + _sstart
# postsyl
l.start_time = _lstart + _send
l.end_time = _lstart + _send
# line
l.start_time = _lstart
l.end_time = _lend
# preline
l.start_time = _lstart
l.end_time = _lstart
# postline
l.start_time = _lend
l.end_time = _lend
# start2syl
l.start_time = _lstart
l.end_time = _lstart + _sstart
# syl2end
l.start_time = _lstart + _send
l.end_time = _lend
# set or abs(完全自定义)
l.start_time = 0
l.end_time = 0
# sylpct
l.start_time = _lstart + _sstart
l.end_time = _lstart + _sstart
复制代码
欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/)
Powered by Discuz! X2