[mugenizer] change fonts and playback resolution

also no need to select the lines now
This commit is contained in:
odrling 2019-08-04 09:06:57 +02:00
parent 63203efe9a
commit bf568cc3de
2 changed files with 30 additions and 20 deletions

View file

@ -11,9 +11,11 @@ Adds a `{\k100}` at the beginning of your line so your line appears 1s earlier (
Mugenizer
---------
Select all the lines of your karaoke, launch the Mugenizer and it will remove our lead-ins and add mugen's karaoke script.
Launch the Mugenizer and it will remove our lead-ins, change the font to Arial and add mugen's karaoke script.
Then in "Automation" you can run "Apply karaoke template" and you're ready to submit your karaoke to Mugen.
PS: Maybe you'll still have to change the color of your subs, or change how the english words are written (like DOA → DOOR).
Split karaoke line
------------------

View file

@ -68,36 +68,44 @@ function adjust_1sec(subs, sel)
aegisub.set_undo_point(tr"1sec adjust lead-in")
end
function mugenizer(subs, sel)
local first = true
local line
for _, i in ipairs(sel) do
function mugenizer(subs)
local first = nil
-- add mugen's magic line
if first then
line = subs[i]
line.comment = true
line.start_time = 0
line.end_time = 0
line.effect = "template pre-line all keeptags"
line.text = '!retime("line",$start < 900 and -$start or -900,200)!{!$start < 900 and "\\\\k" .. ($start/10) or "\\\\k90"!\\fad(!$start < 900 and $start or 300!,200)}'
subs.insert(i, line)
line.text = cleantags(line.text)
first = false
for i, line in ipairs(subs) do
if line.class == "info" then
if line.key == "PlayResX" or line.key == "PlayResY" then
line.value = "0"
end
end
line = subs[i]
if (line.text:find(ktag)) then--don't do anything if there is no ktags in this line
if line.class == "style" then
line.fontname = "Arial"
line.fontsize = "24"
end
if line.class == "dialogue" then
if first == nil then
first = i
end
while hasleadin(line) do
if aegisub.progress.is_cancelled() then return end
line = removeleadin(line)
end
subs[i] = line
end
subs[i] = line
end
-- add mugen's magic line
line = subs[first]
line.comment = true
line.start_time = 0
line.end_time = 0
line.effect = "template pre-line all keeptags"
line.text = '!retime("line",$start < 900 and -$start or -900,200)!{!$start < 900 and "\\\\k" .. ($start/10) or "\\\\k90"!\\fad(!$start < 900 and $start or 300!,200)}'
subs.insert(first, line)
end
aegisub.register_macro(script_name, script_description, adjust_1sec)