From ed857d5feb79fa4ba2beb5090ae5427fbcd9b82f Mon Sep 17 00:00:00 2001 From: Seekladoom <35969469+Seekladoom@users.noreply.github.com> Date: Wed, 1 Jun 2022 21:26:32 +0800 Subject: [PATCH] Update Effector-utils-lib-3.6.lua change include to require --- Effector-utils-lib-3.6.lua | 1432 ++++++++++++++++++------------------ 1 file changed, 716 insertions(+), 716 deletions(-) diff --git a/Effector-utils-lib-3.6.lua b/Effector-utils-lib-3.6.lua index 003c8a1..f3c8062 100644 --- a/Effector-utils-lib-3.6.lua +++ b/Effector-utils-lib-3.6.lua @@ -16,7 +16,7 @@ log = math.log10 ceil = math.ceil script_update = " legacy" -- include Yutils by Christoph Spanknebel "Youka" -------------------------------------------------------- - Yutils = include( "Yutils.lua" ) -- https://github.com/Youka/Yutils -- + Yutils = require "Yutils" -- https://github.com/Youka/Yutils -- ---------------------------------------------------------------------------------------------------------- -- Effector-utils-lib-3.6 functions ---------------------------------------------------------------------- @@ -101,13 +101,13 @@ / Rsr( Rand_i, Rand_f, Step ) / Rdr( Rand_i, Rand_f, Step ) / Rcr( Rand_i, Rand_f, Step ) - / Rmr( Rand_i, Rand_f, Step ) - / Rds( Rand_i, Rand_f, Step ) - / Rcs( Rand_i, Rand_f, Step ) - / Rms( Rand_i, Rand_f, Step ) - / Rdrs( Rand_i, Rand_f, Step ) - / Rcrs( Rand_i, Rand_f, Step ) - / Rmrs( Rand_i, Rand_f, Step ) + / Rmr( Rand_i, Rand_f, Step ) + / Rds( Rand_i, Rand_f, Step ) + / Rcs( Rand_i, Rand_f, Step ) + / Rms( Rand_i, Rand_f, Step ) + / Rdrs( Rand_i, Rand_f, Step ) + / Rcrs( Rand_i, Rand_f, Step ) + / Rmrs( Rand_i, Rand_f, Step ) / Re( Table ) - math.Rfake( Rand_i, Rand_f, Counter ) math.Rfake2( Rand_i, Rand_f, Counter, Counter2, Mode ) @@ -151,13 +151,13 @@ math.count( ) librería tag - + tag.redefine( String ) - + tag.dark( String ) - + tag.timefx( String ) - + tag.modify( String ) + + tag.redefine( String ) + + tag.dark( String ) + + tag.timefx( String ) + + tag.modify( String ) + tag.default( String ) + tag.default2( String ) - + tag.inverse( String ) + + tag.inverse( String ) + tag.natsu( String ) + tag.do_alpha( String ) + tag.HTML_to_ass( String ) @@ -750,8 +750,8 @@ if info.what == "C" then return format( "%q", so .. ", C function" ) end - return format( "%q, defined in (lines: %s - %s), ubication %s", - so, info.linedefined, info.lastlinedefined, info.source + return format( "%q, defined in (lines: %s - %s), ubication %s", + so, info.linedefined, info.lastlinedefined, info.source ) elseif type( o ) == "number" or type( o ) == "boolean" then @@ -3274,7 +3274,7 @@ end return R( Rnd_i, Rnd_f, Rnd_s ) * ratio * (-1) ^ R( 2 ) end - Rsr = math.Rsr + Rsr = math.Rsr Rrs = Rsr function math.Rdr( Rand_i, Rand_f, Step ) @@ -3356,169 +3356,169 @@ end return R( Rnd_i, Rnd_f, Rnd_s ) * ratio / 1000 end - Rmr = math.Rmr - - function math.Rds( Rand_i, Rand_f, Step ) - local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step - if type( Rnd_i ) == "function" then - Rnd_i = Rnd_i( ) - end - if type( Rnd_f ) == "function" then - Rnd_f = Rnd_f( ) - end - if type( Rnd_s ) == "function" then - Rnd_s = Rnd_s( ) - end - if Rnd_i then - effector.print_error( Rnd_i, "number", "Rds", 1 ) - Rnd_i = Rnd_i * 10 - end - if Rnd_f then - effector.print_error( Rnd_f, "number", "Rds", 2 ) - Rnd_f = Rnd_f * 10 - end - if Rnd_s then - effector.print_error( Rnd_s, "number", "Rds", 3 ) - Rnd_s = Rnd_s * 10 - end - return R( Rnd_i, Rnd_f, Rnd_s ) * 0.1 * (-1) ^ R( 2 ) - end - Rds = math.Rds - - function math.Rcs( Rand_i, Rand_f, Step ) - local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step - if type( Rnd_i ) == "function" then - Rnd_i = Rnd_i( ) - end - if type( Rnd_f ) == "function" then - Rnd_f = Rnd_f( ) - end - if type( Rnd_s ) == "function" then - Rnd_s = Rnd_s( ) - end - if Rnd_i then - effector.print_error( Rnd_i, "number", "Rcs", 1 ) - Rnd_i = Rnd_i * 100 - end - if Rnd_f then - effector.print_error( Rnd_f, "number", "Rcs", 2 ) - Rnd_f = Rnd_f * 100 - end - if Rnd_s then - effector.print_error( Rnd_s, "number", "Rcs", 3 ) - Rnd_s = Rnd_s * 100 - end - return R( Rnd_i, Rnd_f, Rnd_s ) * 0.01 * (-1) ^ R( 2 ) - end - Rcs = math.Rcs - - function math.Rms( Rand_i, Rand_f, Step ) - local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step - if type( Rnd_i ) == "function" then - Rnd_i = Rnd_i( ) - end - if type( Rnd_f ) == "function" then - Rnd_f = Rnd_f( ) - end - if type( Rnd_s ) == "function" then - Rnd_s = Rnd_s( ) - end - if Rnd_i then - effector.print_error( Rnd_i, "number", "Rms", 1 ) - Rnd_i = Rnd_i * 1000 - end - if Rnd_f then - effector.print_error( Rnd_f, "number", "Rms", 2 ) - Rnd_f = Rnd_f * 1000 - end - if Rnd_s then - effector.print_error( Rnd_s, "number", "Rms", 3 ) - Rnd_s = Rnd_s * 1000 - end - return R( Rnd_i, Rnd_f, Rnd_s ) * 0.001 * (-1) ^ R( 2 ) - end - Rms = math.Rms - - function math.Rdrs( Rand_i, Rand_f, Step ) - local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step - if type( Rnd_i ) == "function" then - Rnd_i = Rnd_i( ) - end - if type( Rnd_f ) == "function" then - Rnd_f = Rnd_f( ) - end - if type( Rnd_s ) == "function" then - Rnd_s = Rnd_s( ) - end - if Rnd_i then - effector.print_error( Rnd_i, "number", "Rdrs", 1 ) - Rnd_i = Rnd_i * 10 - end - if Rnd_f then - effector.print_error( Rnd_f, "number", "Rdrs", 2 ) - Rnd_f = Rnd_f * 10 - end - if Rnd_s then - effector.print_error( Rnd_s, "number", "Rdrs", 3 ) - Rnd_s = Rnd_s * 10 - end - return R( Rnd_i, Rnd_f, Rnd_s ) * 0.1 * ratio * (-1) ^ R( 2 ) - end - Rdrs = math.Rdrs - - function math.Rcrs( Rand_i, Rand_f, Step ) - local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step - if type( Rnd_i ) == "function" then - Rnd_i = Rnd_i( ) - end - if type( Rnd_f ) == "function" then - Rnd_f = Rnd_f( ) - end - if type( Rnd_s ) == "function" then - Rnd_s = Rnd_s( ) - end - if Rnd_i then - effector.print_error( Rnd_i, "number", "Rcrs", 1 ) - Rnd_i = Rnd_i * 100 - end - if Rnd_f then - effector.print_error( Rnd_f, "number", "Rcrs", 2 ) - Rnd_f = Rnd_f * 100 - end - if Rnd_s then - effector.print_error( Rnd_s, "number", "Rcrs", 3 ) - Rnd_s = Rnd_s * 100 - end - return R( Rnd_i, Rnd_f, Rnd_s ) * 0.01 * ratio * (-1) ^ R( 2 ) - end - Rcrs = math.Rcrs - - function math.Rmrs( Rand_i, Rand_f, Step ) - local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step - if type( Rnd_i ) == "function" then - Rnd_i = Rnd_i( ) - end - if type( Rnd_f ) == "function" then - Rnd_f = Rnd_f( ) - end - if type( Rnd_s ) == "function" then - Rnd_s = Rnd_s( ) - end - if Rnd_i then - effector.print_error( Rnd_i, "number", "Rmrs", 1 ) - Rnd_i = Rnd_i * 1000 - end - if Rnd_f then - effector.print_error( Rnd_f, "number", "Rmrs", 2 ) - Rnd_f = Rnd_f * 1000 - end - if Rnd_s then - effector.print_error( Rnd_s, "number", "Rmrs", 3 ) - Rnd_s = Rnd_s * 1000 - end - return R( Rnd_i, Rnd_f, Rnd_s ) * 0.001 * ratio * (-1) ^ R( 2 ) - end - Rmrs = math.Rmrs + Rmr = math.Rmr + + function math.Rds( Rand_i, Rand_f, Step ) + local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step + if type( Rnd_i ) == "function" then + Rnd_i = Rnd_i( ) + end + if type( Rnd_f ) == "function" then + Rnd_f = Rnd_f( ) + end + if type( Rnd_s ) == "function" then + Rnd_s = Rnd_s( ) + end + if Rnd_i then + effector.print_error( Rnd_i, "number", "Rds", 1 ) + Rnd_i = Rnd_i * 10 + end + if Rnd_f then + effector.print_error( Rnd_f, "number", "Rds", 2 ) + Rnd_f = Rnd_f * 10 + end + if Rnd_s then + effector.print_error( Rnd_s, "number", "Rds", 3 ) + Rnd_s = Rnd_s * 10 + end + return R( Rnd_i, Rnd_f, Rnd_s ) * 0.1 * (-1) ^ R( 2 ) + end + Rds = math.Rds + + function math.Rcs( Rand_i, Rand_f, Step ) + local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step + if type( Rnd_i ) == "function" then + Rnd_i = Rnd_i( ) + end + if type( Rnd_f ) == "function" then + Rnd_f = Rnd_f( ) + end + if type( Rnd_s ) == "function" then + Rnd_s = Rnd_s( ) + end + if Rnd_i then + effector.print_error( Rnd_i, "number", "Rcs", 1 ) + Rnd_i = Rnd_i * 100 + end + if Rnd_f then + effector.print_error( Rnd_f, "number", "Rcs", 2 ) + Rnd_f = Rnd_f * 100 + end + if Rnd_s then + effector.print_error( Rnd_s, "number", "Rcs", 3 ) + Rnd_s = Rnd_s * 100 + end + return R( Rnd_i, Rnd_f, Rnd_s ) * 0.01 * (-1) ^ R( 2 ) + end + Rcs = math.Rcs + + function math.Rms( Rand_i, Rand_f, Step ) + local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step + if type( Rnd_i ) == "function" then + Rnd_i = Rnd_i( ) + end + if type( Rnd_f ) == "function" then + Rnd_f = Rnd_f( ) + end + if type( Rnd_s ) == "function" then + Rnd_s = Rnd_s( ) + end + if Rnd_i then + effector.print_error( Rnd_i, "number", "Rms", 1 ) + Rnd_i = Rnd_i * 1000 + end + if Rnd_f then + effector.print_error( Rnd_f, "number", "Rms", 2 ) + Rnd_f = Rnd_f * 1000 + end + if Rnd_s then + effector.print_error( Rnd_s, "number", "Rms", 3 ) + Rnd_s = Rnd_s * 1000 + end + return R( Rnd_i, Rnd_f, Rnd_s ) * 0.001 * (-1) ^ R( 2 ) + end + Rms = math.Rms + + function math.Rdrs( Rand_i, Rand_f, Step ) + local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step + if type( Rnd_i ) == "function" then + Rnd_i = Rnd_i( ) + end + if type( Rnd_f ) == "function" then + Rnd_f = Rnd_f( ) + end + if type( Rnd_s ) == "function" then + Rnd_s = Rnd_s( ) + end + if Rnd_i then + effector.print_error( Rnd_i, "number", "Rdrs", 1 ) + Rnd_i = Rnd_i * 10 + end + if Rnd_f then + effector.print_error( Rnd_f, "number", "Rdrs", 2 ) + Rnd_f = Rnd_f * 10 + end + if Rnd_s then + effector.print_error( Rnd_s, "number", "Rdrs", 3 ) + Rnd_s = Rnd_s * 10 + end + return R( Rnd_i, Rnd_f, Rnd_s ) * 0.1 * ratio * (-1) ^ R( 2 ) + end + Rdrs = math.Rdrs + + function math.Rcrs( Rand_i, Rand_f, Step ) + local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step + if type( Rnd_i ) == "function" then + Rnd_i = Rnd_i( ) + end + if type( Rnd_f ) == "function" then + Rnd_f = Rnd_f( ) + end + if type( Rnd_s ) == "function" then + Rnd_s = Rnd_s( ) + end + if Rnd_i then + effector.print_error( Rnd_i, "number", "Rcrs", 1 ) + Rnd_i = Rnd_i * 100 + end + if Rnd_f then + effector.print_error( Rnd_f, "number", "Rcrs", 2 ) + Rnd_f = Rnd_f * 100 + end + if Rnd_s then + effector.print_error( Rnd_s, "number", "Rcrs", 3 ) + Rnd_s = Rnd_s * 100 + end + return R( Rnd_i, Rnd_f, Rnd_s ) * 0.01 * ratio * (-1) ^ R( 2 ) + end + Rcrs = math.Rcrs + + function math.Rmrs( Rand_i, Rand_f, Step ) + local Rnd_i, Rnd_f, Rnd_s = Rand_i, Rand_f, Step + if type( Rnd_i ) == "function" then + Rnd_i = Rnd_i( ) + end + if type( Rnd_f ) == "function" then + Rnd_f = Rnd_f( ) + end + if type( Rnd_s ) == "function" then + Rnd_s = Rnd_s( ) + end + if Rnd_i then + effector.print_error( Rnd_i, "number", "Rmrs", 1 ) + Rnd_i = Rnd_i * 1000 + end + if Rnd_f then + effector.print_error( Rnd_f, "number", "Rmrs", 2 ) + Rnd_f = Rnd_f * 1000 + end + if Rnd_s then + effector.print_error( Rnd_s, "number", "Rmrs", 3 ) + Rnd_s = Rnd_s * 1000 + end + return R( Rnd_i, Rnd_f, Rnd_s ) * 0.001 * ratio * (-1) ^ R( 2 ) + end + Rmrs = math.Rmrs function math.Re( Table ) --retorna el valor de un elemento al azar de la tabla ingresada @@ -4097,7 +4097,7 @@ Blength = Blength + math.distance( Bx[ i ], By[ i ], Bx[ i - 1 ], By[ i - 1 ] ) end end - Blength = remember( "mLength", Blength ) + Blength = remember( "mLength", Blength ) end return Blength end --math.length_bezier( shape.circle ) @@ -8175,40 +8175,40 @@ function tag.oscill2( Times, ... ) local tags_oscll2 = ... if tags_oscll2 == nil then - local comb_ini = { - [ 01 ] = "\\xyshadRdrs( 20 )\\4cR( nil, { 60, 86 } )", - [ 02 ] = "\\xybordRdr( 3, 12 )\\3cR( nil, { 60, 86 } )", - [ 03 ] = "\\frRds( 10 )\\frxyRds( 40 )", - [ 04 ] = "\\faxyRcs( 0.25 )", - [ 05 ] = "\\fscxyrRc( 0.75, 1.25 )", - } - local comb_fin = { - [ 01 ] = "\\xyshadRdrs( 20 )\\4cR( nil, { 60, 86 } )", - [ 02 ] = "\\xshadRdrs( 20 )", - [ 03 ] = "\\yshadRdrs( 20 )", - [ 04 ] = "\\4cR( nil, { 60, 86 } )", - [ 05 ] = "\\xybordRdr( 3, 12 )\\3cR( nil, { 60, 86 } )", - [ 06 ] = "\\xbordRdr( 3, 12 )", - [ 07 ] = "\\ybordRdr( 3, 12 )", - [ 08 ] = "\\3cR( nil, { 60, 86 } )", - [ 09 ] = "\\frRds( 10 )\\frxyRds( 40 )", - [ 10 ] = "\\frRds( 10 )", - [ 11 ] = "\\frxRds( 40 )", - [ 12 ] = "\\fryRds( 40 )", - [ 13 ] = "\\faxyRcs( 0.25 )", - [ 14 ] = "\\faxRcs( 0.25 )", - [ 15 ] = "\\fayRcs( 0.25 )", - [ 16 ] = ( R( 2 ) == 1 ) and "\\faxRcs( 0.25 )\\frRds( 10 )" or "\\fayRcs( 0.25 )\\fspRrs( 4 )", - [ 17 ] = "\\fscxyrRc( 0.75, 1.25 )", - [ 18 ] = "\\fscxrRc( 0.75, 1.25 )", - [ 19 ] = "\\fscyrRc( 0.75, 1.25 )", - [ 20 ] = ( R( 2 ) == 1 ) and "\\fscxrRc( 0.75, 1.25 )\\fspRrs( 4 )" or "\\fscyrRc( 0.75, 1.25 )\\fspRrs( 10 )", - [ 21 ] = "\\blurRd( 0, 6 )", - [ 22 ] = "\\fspRrs( 8 )", - [ 23 ] = "\\1cR( nil, { 60, 86 } )", - [ 24 ] = "\\1cR( nil, { 60, 86 } )\\blurRd( 0, 6 )", - } - local comb_r1 = R( 5 ) + local comb_ini = { + [ 01 ] = "\\xyshadRdrs( 20 )\\4cR( nil, { 60, 86 } )", + [ 02 ] = "\\xybordRdr( 3, 12 )\\3cR( nil, { 60, 86 } )", + [ 03 ] = "\\frRds( 10 )\\frxyRds( 40 )", + [ 04 ] = "\\faxyRcs( 0.25 )", + [ 05 ] = "\\fscxyrRc( 0.75, 1.25 )", + } + local comb_fin = { + [ 01 ] = "\\xyshadRdrs( 20 )\\4cR( nil, { 60, 86 } )", + [ 02 ] = "\\xshadRdrs( 20 )", + [ 03 ] = "\\yshadRdrs( 20 )", + [ 04 ] = "\\4cR( nil, { 60, 86 } )", + [ 05 ] = "\\xybordRdr( 3, 12 )\\3cR( nil, { 60, 86 } )", + [ 06 ] = "\\xbordRdr( 3, 12 )", + [ 07 ] = "\\ybordRdr( 3, 12 )", + [ 08 ] = "\\3cR( nil, { 60, 86 } )", + [ 09 ] = "\\frRds( 10 )\\frxyRds( 40 )", + [ 10 ] = "\\frRds( 10 )", + [ 11 ] = "\\frxRds( 40 )", + [ 12 ] = "\\fryRds( 40 )", + [ 13 ] = "\\faxyRcs( 0.25 )", + [ 14 ] = "\\faxRcs( 0.25 )", + [ 15 ] = "\\fayRcs( 0.25 )", + [ 16 ] = ( R( 2 ) == 1 ) and "\\faxRcs( 0.25 )\\frRds( 10 )" or "\\fayRcs( 0.25 )\\fspRrs( 4 )", + [ 17 ] = "\\fscxyrRc( 0.75, 1.25 )", + [ 18 ] = "\\fscxrRc( 0.75, 1.25 )", + [ 19 ] = "\\fscyrRc( 0.75, 1.25 )", + [ 20 ] = ( R( 2 ) == 1 ) and "\\fscxrRc( 0.75, 1.25 )\\fspRrs( 4 )" or "\\fscyrRc( 0.75, 1.25 )\\fspRrs( 10 )", + [ 21 ] = "\\blurRd( 0, 6 )", + [ 22 ] = "\\fspRrs( 8 )", + [ 23 ] = "\\1cR( nil, { 60, 86 } )", + [ 24 ] = "\\1cR( nil, { 60, 86 } )\\blurRd( 0, 6 )", + } + local comb_r1 = R( 5 ) local comb_r1 = R( 5 ) local comb_r2 = R( 24 ) local comb_r3 = R( 24 ) @@ -8234,7 +8234,7 @@ local Tags = { tags_oscll2 } if type( tags_oscll2 ) == "table" then Tags = tags_oscll2 - end + end local tags_os2 = "" local time_ini, time_fin, tags_dft if Times[ 1 ] == "random" then @@ -8257,43 +8257,43 @@ if type( Times[ 1 ] ) == "number" then if type( Tags[ 1 ] ) == "function" then Tags[ 1 ] = Tags[ 1 ]( i ) - end - time_ini, time_fin = Times[ 1 ], Times[ 2 ] + end + time_ini, time_fin = Times[ 1 ], Times[ 2 ] tags_dft = format( "\\t(%s,%s,%s)", time_fin, time_fin, tag.default( Tags[ 1 ] ) ) if Times[ 4 ] then tags_dft = "" end tags_os2 = tag.oscill( { time_ini, time_fin }, Times[ 3 ], Tags[ 1 ] ) .. tags_dft - elseif type( Times[ 1 ] ) == "table" then + elseif type( Times[ 1 ] ) == "table" then time_ini, time_fin, tags_dft = { }, { }, { } for i = 1, #Times do time_ini[ i ], time_fin[ i ] = Times[ i ][ 1 ], Times[ i ][ 2 ] if type( Tags[ (i - 1) % #Tags + 1 ] ) == "function" then Tags[ (i - 1) % #Tags + 1 ] = Tags[ (i - 1) % #Tags + 1 ]( i ) end - tags_dft[ i ] = format( "\\t(%s,%s,%s)", - time_fin[ i ], time_fin[ i ], tag.default( Tags[ (i - 1) % #Tags + 1 ] ) + tags_dft[ i ] = format( "\\t(%s,%s,%s)", + time_fin[ i ], time_fin[ i ], tag.default( Tags[ (i - 1) % #Tags + 1 ] ) ) if Times[ i ][ 4 ] then tags_dft[ i ] = "" end end for i = 1, #Times do - tags_os2 = tags_os2 .. tag.oscill( - { time_ini[ i ], time_fin[ i ] }, - Times[ i ][ 3 ], - Tags[ (i - 1) % #Tags + 1 ] + tags_os2 = tags_os2 .. tag.oscill( + { time_ini[ i ], time_fin[ i ] }, + Times[ i ][ 3 ], + Tags[ (i - 1) % #Tags + 1 ] ) .. tags_dft[ i ] end end tags_os2 = tags_os2:gsub( "(\\t%(%d+[%.%d]*%,%d+[%.%d]*%,)1%,", "%1" ) - return tags_os2 + return tags_os2 --tag.oscill2( { 0, 6f, 1.5f }, "\\frRcs( 7 )\\faxyRcs( 0.2 )" ) --tag.oscill2( { 0, 4f, 1f }, "\\fscxyr( 1 + 0.25 * (-1) ^ (i + 1) )\\frRs( 10 )" ) --tag.oscill2( { { 0, 6f, { { 1.5f, 1 } } }, { fx.dur - 8f, fx.dur - 2f, 1.5f } }, "\\frRcs( 7 )" ) --tag.oscill2( { "random" }, "\\frRcs( 30 )\\frxyRcs( 70 )" ) end - + function tag.glitter( DurTotal, ExtraTags_i, ExtraTags_f ) local time_ini, t, t1, t2, t3, t4, Tag_fx = 0, 0, 0, 0, 0, 0, "\\shad0" local GT_i, GT_f @@ -8334,10 +8334,10 @@ t4 = time_tot end -- march 12th 2018 -- - Tag_fx = Tag_fx .. format( "\\t(%d,%d,%s\\fscx%d\\fscy%d)\\t(%d,%d,%s\\fscx%d\\fscy%d)", + Tag_fx = Tag_fx .. format( "\\t(%d,%d,%s\\fscx%d\\fscy%d)\\t(%d,%d,%s\\fscx%d\\fscy%d)", time_ini + t1, time_ini + t2, GT_i, size1, size1, - time_ini + t3, time_ini + t4, GT_f, size2, size2 - ) + time_ini + t3, time_ini + t4, GT_f, size2, size2 + ) t = t4 i = i + 1 end @@ -8503,8 +8503,8 @@ end ) else - clips_tag = format( "\\clip(%s,%s,%s,%s)", - math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) + clips_tag = format( "\\clip(%s,%s,%s,%s)", + math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) ) end if tags_shpmv then @@ -8513,8 +8513,8 @@ clips_tag = tags_moves .. clips_tag .. clip_trans end else - clips_tag = format( "\\clip(%s,%s,%s,%s)", - math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) + clips_tag = format( "\\clip(%s,%s,%s,%s)", + math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) ) end return clips_tag @@ -8632,8 +8632,8 @@ end ) else - clips_tag = format( "\\clip(%s,%s,%s,%s)", - math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) + clips_tag = format( "\\clip(%s,%s,%s,%s)", + math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) ) end if tags_shpmv then @@ -8642,8 +8642,8 @@ clips_tag = tags_moves .. clips_tag .. clip_trans end else - clips_tag = format( "\\clip(%s,%s,%s,%s)", - math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) + clips_tag = format( "\\clip(%s,%s,%s,%s)", + math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) ) end return clips_tag @@ -8739,8 +8739,8 @@ cy1 = top_y + clip_H - pixelH[ (j - 1) % loop_H - 0 ] cy2 = top_y + clip_H - pixelH[ (j - 1) % loop_H - 1 ] end - return format( "\\clip(%s,%s,%s,%s)", - math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) + return format( "\\clip(%s,%s,%s,%s)", + math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) ) end @@ -8820,8 +8820,8 @@ cy1 = top_y + (loop_y - 1) * size_C[ 2 ] cy2 = top_y + (loop_y - 0) * size_C[ 2 ] end - return format( "\\clip(%s,%s,%s,%s)", - math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) + return format( "\\clip(%s,%s,%s,%s)", + math.round( cx1, 2 ), math.round( cy1, 2 ), math.round( cx2, 2 ), math.round( cy2, 2 ) ) end --tag.Pclip( { syl.width/6, syl.height/4 }, syl.left, syl.top, syl.width, syl.height ) @@ -8922,166 +8922,166 @@ --!tag.oscill( 500, {{100, 1 }}, "\\1cR( )" )! return String end - + function tag.to_temp( String ) --le da valor a las operaciones entre signos de admiración (!!) --local String = tag.do_tag( String ) --!tag.oscill( 500, {{100, 1 }}, "\\1cR( )" )! - local String = tag.temp2( String ) - String = String:gsub( "%b!!", - function( capture ) + local String = tag.temp2( String ) + String = String:gsub( "%b!!", + function( capture ) local capture = capture:gsub( "%!", "" ) if capture ~= string.toval( capture ) then return string.toval( capture ) end - return "!" .. capture .. "!" - end - ) - return String - end + return "!" .. capture .. "!" + end + ) + return String + end function tag.v_dollar( String ) - --asigna el valor correspondiente a cada una de las variables dólar ($var) - local var_dollar = { - [ 001 ] = "$layer", [ 002 ] = "$style", [ 003 ] = "$actor", [ 004 ] = "$margin_l", - [ 005 ] = "$margin_r", [ 006 ] = "$margin_v", [ 007 ] = "$margin_t", [ 008 ] = "$margin_b", - [ 009 ] = "$lstart", [ 010 ] = "$lend", [ 011 ] = "$lmid", [ 012 ] = "$ldur", - [ 013 ] = "$li", [ 014 ] = "$linen", [ 015 ] = "$lleft", [ 016 ] = "$lcenter", - [ 017 ] = "$lright", [ 018 ] = "$lbottom", [ 019 ] = "$lmiddle", [ 020 ] = "$ltop", - [ 021 ] = "$lwidth", [ 022 ] = "$lheight", [ 023 ] = "$lx", [ 024 ] = "$ly", - [ 025 ] = "$lkdur", --▲ variables de estilo y de línea - [ 026 ] = "$sstart", [ 027 ] = "$send", [ 028 ] = "$smid", [ 029 ] = "$sdur", - [ 030 ] = "$si", [ 031 ] = "$syln", [ 032 ] = "$sleft", [ 033 ] = "$scenter", - [ 034 ] = "$sright", [ 035 ] = "$sbottom", [ 036 ] = "$smiddle", [ 037 ] = "$stop", - [ 038 ] = "$swidth", [ 039 ] = "$sheight", [ 040 ] = "$sx", [ 041 ] = "$sy", - [ 042 ] = "$skdur", --▲ variables de sílaba - [ 043 ] = "$fstart", [ 044 ] = "$fend", [ 045 ] = "$fmid", [ 046 ] = "$fdur", - [ 047 ] = "$fi", [ 048 ] = "$furin", [ 049 ] = "$fleft", [ 050 ] = "$fcenter", - [ 051 ] = "$fright", [ 052 ] = "$fbottom", [ 053 ] = "$fmiddle", [ 054 ] = "$ftop", - [ 055 ] = "$fwidth", [ 056 ] = "$fheight", [ 057 ] = "$fx", [ 058 ] = "$fy", - [ 059 ] = "$fkdur", --▲ variables de furigana - [ 060 ] = "$cstart", [ 061 ] = "$cend", [ 062 ] = "$cmid", [ 063 ] = "$cdur", - [ 064 ] = "$ci", [ 065 ] = "$charn", [ 066 ] = "$cleft", [ 067 ] = "$ccenter", - [ 068 ] = "$cright", [ 069 ] = "$cbottom", [ 070 ] = "$cmiddle", [ 071 ] = "$ctop", - [ 072 ] = "$cwidth", [ 073 ] = "$cheight", [ 074 ] = "$cx", [ 075 ] = "$cy", - [ 076 ] = "$ckdur", --▲ variables de caracter - [ 077 ] = "$wstart", [ 078 ] = "$wend", [ 079 ] = "$wmid", [ 080 ] = "$wdur", - [ 081 ] = "$wi", [ 082 ] = "$wordn", [ 083 ] = "$wleft", [ 084 ] = "$wcenter", - [ 085 ] = "$wright", [ 086 ] = "$wbottom", [ 087 ] = "$wmiddle", [ 088 ] = "$wtop", - [ 089 ] = "$wwidth", [ 090 ] = "$wheight", [ 091 ] = "$wx", [ 092 ] = "$wy", - [ 093 ] = "$wkdur", --▲ variables de palabra - [ 094 ] = "$fxstart", [ 095 ] = "$fxend", [ 096 ] = "$fxmid", [ 097 ] = "$fxdur", - [ 098 ] = "$fxi", [ 099 ] = "$fxn", [ 100 ] = "$fxleft", [ 101 ] = "$fxcenter", - [ 102 ] = "$fxright", [ 103 ] = "$fxbottom", [ 104 ] = "$fxmiddle", [ 105 ] = "$fxtop", - [ 106 ] = "$fxwidth", [ 107 ] = "$fxheight", [ 108 ] = "$fxx", [ 109 ] = "$fxy", - [ 110 ] = "$fxkdur", --▲ variables de efecto - [ 111 ] = "$start", [ 112 ] = "$end", [ 113 ] = "$mid", [ 114 ] = "$dur", - [ 115 ] = "$i", [ 116 ] = "$n", [ 117 ] = "$left", [ 118 ] = "$center", - [ 119 ] = "$right", [ 120 ] = "$bottom", [ 121 ] = "$middle", [ 122 ] = "$top", - [ 123 ] = "$width", [ 124 ] = "$height", [ 125 ] = "$x", [ 126 ] = "$y", - [ 127 ] = "$kdur", --▲ variables generales - [ 128 ] = "$scale_x", [ 129 ] = "$scale_y", [ 130 ] = "$angle", [ 131 ] = "$outline", - [ 132 ] = "$shadow", [ 133 ] = "$fontsize", [ 134 ] = "$fontname", [ 135 ] = "$spacing", - [ 136 ] = "$color1", [ 137 ] = "$color2", [ 138 ] = "$color3", [ 139 ] = "$color4", - [ 140 ] = "$alpha1", [ 141 ] = "$alpha2", [ 142 ] = "$alpha3", [ 143 ] = "$alpha4", - [ 144 ] = "$align" --▲ variables extra de estilo - } - local var_kefx = { - [ 001 ] = l_layer, [ 002 ] = l_style, [ 003 ] = l_actor, [ 004 ] = l_ml, - [ 005 ] = l_mr, [ 006 ] = l_mv, [ 007 ] = l_mt, [ 008 ] = l_mb, - [ 009 ] = l_start, [ 010 ] = l_end, [ 011 ] = l_mid, [ 012 ] = l_dur, - [ 013 ] = l_i, [ 014 ] = l_n, [ 015 ] = l_left, [ 016 ] = l_center, - [ 017 ] = l_right, [ 018 ] = l_bottom, [ 019 ] = l_middle, [ 020 ] = l_top, - [ 021 ] = l_width, [ 022 ] = l_height, [ 023 ] = l_x, [ 024 ] = l_y, - [ 025 ] = l_dur / 10, --▲ variables de estilo y de línea - [ 026 ] = syl_start, [ 027 ] = syl_end, [ 028 ] = syl_mid, [ 029 ] = syl_dur, - [ 030 ] = syl_i, [ 031 ] = syl_n, [ 032 ] = syl_left, [ 033 ] = syl_center, - [ 034 ] = syl_right, [ 035 ] = syl_bottom, [ 036 ] = syl_middle, [ 037 ] = syl_top, - [ 038 ] = syl_width, [ 039 ] = syl_height, [ 040 ] = syl_center, [ 041 ] = syl_middle, - [ 042 ] = syl_dur / 10, --▲ variables de sílaba - [ 043 ] = furi_start, [ 044 ] = furi_end, [ 045 ] = furi_mid, [ 046 ] = furi_dur, - [ 047 ] = furi_i, [ 048 ] = furi_n, [ 049 ] = furi_left, [ 050 ] = furi_center, - [ 051 ] = furi_right, [ 052 ] = furi_bottom, [ 053 ] = furi_middle, [ 054 ] = furi_top, - [ 055 ] = furi_width, [ 056 ] = furi_height, [ 057 ] = furi_center, [ 058 ] = furi_middle, - [ 059 ] = furi_dur / 10, --▲ variables de furigana - [ 060 ] = char_start, [ 061 ] = char_end, [ 062 ] = char_mid, [ 063 ] = char_dur, - [ 064 ] = char_i, [ 065 ] = char_n, [ 066 ] = char_left, [ 067 ] = char_center, - [ 068 ] = char_right, [ 069 ] = char_bottom, [ 070 ] = char_middle, [ 071 ] = char_top, - [ 072 ] = char_width, [ 073 ] = char_height, [ 074 ] = char_center, [ 075 ] = char_middle, - [ 076 ] = char_dur / 10, --▲ variables de caracter - [ 077 ] = word_start, [ 078 ] = word_end, [ 079 ] = word_mid, [ 080 ] = word_dur, - [ 081 ] = word_i, [ 082 ] = word_n, [ 083 ] = word_left, [ 084 ] = word_center, - [ 085 ] = word_right, [ 086 ] = word_bottom, [ 087 ] = word_middle, [ 088 ] = word_top, - [ 089 ] = word_width, [ 090 ] = word_height, [ 091 ] = word_center, [ 092 ] = word_middle, - [ 093 ] = word_dur / 10, --▲ variables de palabra - [ 094 ] = fx_start, [ 095 ] = fx_end, [ 096 ] = fx_mid, [ 097 ] = fx_dur, - [ 098 ] = fx_i, [ 099 ] = fx_n, [ 100 ] = fx_left, [ 101 ] = fx_center, - [ 102 ] = fx_right, [ 103 ] = fx_bottom, [ 104 ] = fx_middle, [ 105 ] = fx_top, - [ 106 ] = fx_width, [ 107 ] = fx_height, [ 108 ] = fx_x, [ 109 ] = fx_y, - [ 110 ] = fx_dur / 10, --▲ variables de efecto - [ 111 ] = val_start, [ 112 ] = val_end, [ 113 ] = val_mid, [ 114 ] = val_dur, - [ 115 ] = val_i, [ 116 ] = val_n, [ 117 ] = val_left, [ 118 ] = val_center, - [ 119 ] = val_right, [ 120 ] = val_bottom, [ 121 ] = val_middle, [ 122 ] = val_top, - [ 123 ] = val_width, [ 124 ] = val_height, [ 125 ] = val_center, [ 126 ] = val_middle, - [ 127 ] = val_dur / 10, --▲ variables generales - [ 128 ] = l_scale_x, [ 129 ] = l_scale_y, [ 130 ] = l_angle, [ 131 ] = l_outline, - [ 132 ] = l_shadow, [ 133 ] = l_fsize, [ 134 ] = l_fname, [ 135 ] = l_spacing, - [ 136 ] = l_color1, [ 137 ] = l_color2, [ 138 ] = l_color3, [ 139 ] = l_color4, - [ 140 ] = l_alpha1, [ 141 ] = l_alpha2, [ 142 ] = l_alpha3, [ 143 ] = l_alpha4, - [ 144 ] = l_align --▲ variables extra de estilo - } - var_kefx = math.round( var_kefx, 2 ) - String = String:gsub( "%$%w+[_%w]*", - function( capture ) - return var_kefx[ table.index( var_dollar, capture ) ] - end - ) - return String - end - - function tag.coupling( String ) - local tag2_unrpt = { } - local tags_unrepeat = { - [ 1 ] = "\\an?%d", [ 2 ] = "\\org%b()", [ 3 ] = "\\pos%b()", - [ 4 ] = "\\move%b()", [ 5 ] = "\\moves3%b()", [ 6 ] = "\\moves4%b()", - [ 7 ] = "\\mover%b()", [ 8 ] = "\\movevc%b()", - } - local tag2_unrepeat = { - [ 1 ] = "\\pos%b()", [ 2 ] = "\\move%b()", [ 3 ] = "\\moves3%b()", - [ 4 ] = "\\moves4%b()", [ 5 ] = "\\mover%b()", - } - local function tag_coupling2( String2, tag_cap ) - local tags_unrpt = { } - for c_cou in String2:gmatch( tag_cap ) do - table.insert( tags_unrpt, c_cou ) - end - if #tags_unrpt > 1 then - String2 = String2:gsub( tag_cap, "", #tags_unrpt - 1 ) - end - return String2 - end - for i = 1, #tags_unrepeat do - String = tag_coupling2( String, tags_unrepeat[ i ] ) - end - for i = 1, #tag2_unrepeat do - for c_cou2 in String:gmatch( tag2_unrepeat[ i ] ) do - table.insert( tag2_unrpt, c_cou2 ) - end - end - if #tag2_unrpt > 1 then - for i = 1, #tag2_unrpt - 1 do - String = String:gsub( tag.operation( tag2_unrpt[ i ] ), "" ) - end - end - return String - end + --asigna el valor correspondiente a cada una de las variables dólar ($var) + local var_dollar = { + [ 001 ] = "$layer", [ 002 ] = "$style", [ 003 ] = "$actor", [ 004 ] = "$margin_l", + [ 005 ] = "$margin_r", [ 006 ] = "$margin_v", [ 007 ] = "$margin_t", [ 008 ] = "$margin_b", + [ 009 ] = "$lstart", [ 010 ] = "$lend", [ 011 ] = "$lmid", [ 012 ] = "$ldur", + [ 013 ] = "$li", [ 014 ] = "$linen", [ 015 ] = "$lleft", [ 016 ] = "$lcenter", + [ 017 ] = "$lright", [ 018 ] = "$lbottom", [ 019 ] = "$lmiddle", [ 020 ] = "$ltop", + [ 021 ] = "$lwidth", [ 022 ] = "$lheight", [ 023 ] = "$lx", [ 024 ] = "$ly", + [ 025 ] = "$lkdur", --▲ variables de estilo y de línea + [ 026 ] = "$sstart", [ 027 ] = "$send", [ 028 ] = "$smid", [ 029 ] = "$sdur", + [ 030 ] = "$si", [ 031 ] = "$syln", [ 032 ] = "$sleft", [ 033 ] = "$scenter", + [ 034 ] = "$sright", [ 035 ] = "$sbottom", [ 036 ] = "$smiddle", [ 037 ] = "$stop", + [ 038 ] = "$swidth", [ 039 ] = "$sheight", [ 040 ] = "$sx", [ 041 ] = "$sy", + [ 042 ] = "$skdur", --▲ variables de sílaba + [ 043 ] = "$fstart", [ 044 ] = "$fend", [ 045 ] = "$fmid", [ 046 ] = "$fdur", + [ 047 ] = "$fi", [ 048 ] = "$furin", [ 049 ] = "$fleft", [ 050 ] = "$fcenter", + [ 051 ] = "$fright", [ 052 ] = "$fbottom", [ 053 ] = "$fmiddle", [ 054 ] = "$ftop", + [ 055 ] = "$fwidth", [ 056 ] = "$fheight", [ 057 ] = "$fx", [ 058 ] = "$fy", + [ 059 ] = "$fkdur", --▲ variables de furigana + [ 060 ] = "$cstart", [ 061 ] = "$cend", [ 062 ] = "$cmid", [ 063 ] = "$cdur", + [ 064 ] = "$ci", [ 065 ] = "$charn", [ 066 ] = "$cleft", [ 067 ] = "$ccenter", + [ 068 ] = "$cright", [ 069 ] = "$cbottom", [ 070 ] = "$cmiddle", [ 071 ] = "$ctop", + [ 072 ] = "$cwidth", [ 073 ] = "$cheight", [ 074 ] = "$cx", [ 075 ] = "$cy", + [ 076 ] = "$ckdur", --▲ variables de caracter + [ 077 ] = "$wstart", [ 078 ] = "$wend", [ 079 ] = "$wmid", [ 080 ] = "$wdur", + [ 081 ] = "$wi", [ 082 ] = "$wordn", [ 083 ] = "$wleft", [ 084 ] = "$wcenter", + [ 085 ] = "$wright", [ 086 ] = "$wbottom", [ 087 ] = "$wmiddle", [ 088 ] = "$wtop", + [ 089 ] = "$wwidth", [ 090 ] = "$wheight", [ 091 ] = "$wx", [ 092 ] = "$wy", + [ 093 ] = "$wkdur", --▲ variables de palabra + [ 094 ] = "$fxstart", [ 095 ] = "$fxend", [ 096 ] = "$fxmid", [ 097 ] = "$fxdur", + [ 098 ] = "$fxi", [ 099 ] = "$fxn", [ 100 ] = "$fxleft", [ 101 ] = "$fxcenter", + [ 102 ] = "$fxright", [ 103 ] = "$fxbottom", [ 104 ] = "$fxmiddle", [ 105 ] = "$fxtop", + [ 106 ] = "$fxwidth", [ 107 ] = "$fxheight", [ 108 ] = "$fxx", [ 109 ] = "$fxy", + [ 110 ] = "$fxkdur", --▲ variables de efecto + [ 111 ] = "$start", [ 112 ] = "$end", [ 113 ] = "$mid", [ 114 ] = "$dur", + [ 115 ] = "$i", [ 116 ] = "$n", [ 117 ] = "$left", [ 118 ] = "$center", + [ 119 ] = "$right", [ 120 ] = "$bottom", [ 121 ] = "$middle", [ 122 ] = "$top", + [ 123 ] = "$width", [ 124 ] = "$height", [ 125 ] = "$x", [ 126 ] = "$y", + [ 127 ] = "$kdur", --▲ variables generales + [ 128 ] = "$scale_x", [ 129 ] = "$scale_y", [ 130 ] = "$angle", [ 131 ] = "$outline", + [ 132 ] = "$shadow", [ 133 ] = "$fontsize", [ 134 ] = "$fontname", [ 135 ] = "$spacing", + [ 136 ] = "$color1", [ 137 ] = "$color2", [ 138 ] = "$color3", [ 139 ] = "$color4", + [ 140 ] = "$alpha1", [ 141 ] = "$alpha2", [ 142 ] = "$alpha3", [ 143 ] = "$alpha4", + [ 144 ] = "$align" --▲ variables extra de estilo + } + local var_kefx = { + [ 001 ] = l_layer, [ 002 ] = l_style, [ 003 ] = l_actor, [ 004 ] = l_ml, + [ 005 ] = l_mr, [ 006 ] = l_mv, [ 007 ] = l_mt, [ 008 ] = l_mb, + [ 009 ] = l_start, [ 010 ] = l_end, [ 011 ] = l_mid, [ 012 ] = l_dur, + [ 013 ] = l_i, [ 014 ] = l_n, [ 015 ] = l_left, [ 016 ] = l_center, + [ 017 ] = l_right, [ 018 ] = l_bottom, [ 019 ] = l_middle, [ 020 ] = l_top, + [ 021 ] = l_width, [ 022 ] = l_height, [ 023 ] = l_x, [ 024 ] = l_y, + [ 025 ] = l_dur / 10, --▲ variables de estilo y de línea + [ 026 ] = syl_start, [ 027 ] = syl_end, [ 028 ] = syl_mid, [ 029 ] = syl_dur, + [ 030 ] = syl_i, [ 031 ] = syl_n, [ 032 ] = syl_left, [ 033 ] = syl_center, + [ 034 ] = syl_right, [ 035 ] = syl_bottom, [ 036 ] = syl_middle, [ 037 ] = syl_top, + [ 038 ] = syl_width, [ 039 ] = syl_height, [ 040 ] = syl_center, [ 041 ] = syl_middle, + [ 042 ] = syl_dur / 10, --▲ variables de sílaba + [ 043 ] = furi_start, [ 044 ] = furi_end, [ 045 ] = furi_mid, [ 046 ] = furi_dur, + [ 047 ] = furi_i, [ 048 ] = furi_n, [ 049 ] = furi_left, [ 050 ] = furi_center, + [ 051 ] = furi_right, [ 052 ] = furi_bottom, [ 053 ] = furi_middle, [ 054 ] = furi_top, + [ 055 ] = furi_width, [ 056 ] = furi_height, [ 057 ] = furi_center, [ 058 ] = furi_middle, + [ 059 ] = furi_dur / 10, --▲ variables de furigana + [ 060 ] = char_start, [ 061 ] = char_end, [ 062 ] = char_mid, [ 063 ] = char_dur, + [ 064 ] = char_i, [ 065 ] = char_n, [ 066 ] = char_left, [ 067 ] = char_center, + [ 068 ] = char_right, [ 069 ] = char_bottom, [ 070 ] = char_middle, [ 071 ] = char_top, + [ 072 ] = char_width, [ 073 ] = char_height, [ 074 ] = char_center, [ 075 ] = char_middle, + [ 076 ] = char_dur / 10, --▲ variables de caracter + [ 077 ] = word_start, [ 078 ] = word_end, [ 079 ] = word_mid, [ 080 ] = word_dur, + [ 081 ] = word_i, [ 082 ] = word_n, [ 083 ] = word_left, [ 084 ] = word_center, + [ 085 ] = word_right, [ 086 ] = word_bottom, [ 087 ] = word_middle, [ 088 ] = word_top, + [ 089 ] = word_width, [ 090 ] = word_height, [ 091 ] = word_center, [ 092 ] = word_middle, + [ 093 ] = word_dur / 10, --▲ variables de palabra + [ 094 ] = fx_start, [ 095 ] = fx_end, [ 096 ] = fx_mid, [ 097 ] = fx_dur, + [ 098 ] = fx_i, [ 099 ] = fx_n, [ 100 ] = fx_left, [ 101 ] = fx_center, + [ 102 ] = fx_right, [ 103 ] = fx_bottom, [ 104 ] = fx_middle, [ 105 ] = fx_top, + [ 106 ] = fx_width, [ 107 ] = fx_height, [ 108 ] = fx_x, [ 109 ] = fx_y, + [ 110 ] = fx_dur / 10, --▲ variables de efecto + [ 111 ] = val_start, [ 112 ] = val_end, [ 113 ] = val_mid, [ 114 ] = val_dur, + [ 115 ] = val_i, [ 116 ] = val_n, [ 117 ] = val_left, [ 118 ] = val_center, + [ 119 ] = val_right, [ 120 ] = val_bottom, [ 121 ] = val_middle, [ 122 ] = val_top, + [ 123 ] = val_width, [ 124 ] = val_height, [ 125 ] = val_center, [ 126 ] = val_middle, + [ 127 ] = val_dur / 10, --▲ variables generales + [ 128 ] = l_scale_x, [ 129 ] = l_scale_y, [ 130 ] = l_angle, [ 131 ] = l_outline, + [ 132 ] = l_shadow, [ 133 ] = l_fsize, [ 134 ] = l_fname, [ 135 ] = l_spacing, + [ 136 ] = l_color1, [ 137 ] = l_color2, [ 138 ] = l_color3, [ 139 ] = l_color4, + [ 140 ] = l_alpha1, [ 141 ] = l_alpha2, [ 142 ] = l_alpha3, [ 143 ] = l_alpha4, + [ 144 ] = l_align --▲ variables extra de estilo + } + var_kefx = math.round( var_kefx, 2 ) + String = String:gsub( "%$%w+[_%w]*", + function( capture ) + return var_kefx[ table.index( var_dollar, capture ) ] + end + ) + return String + end + + function tag.coupling( String ) + local tag2_unrpt = { } + local tags_unrepeat = { + [ 1 ] = "\\an?%d", [ 2 ] = "\\org%b()", [ 3 ] = "\\pos%b()", + [ 4 ] = "\\move%b()", [ 5 ] = "\\moves3%b()", [ 6 ] = "\\moves4%b()", + [ 7 ] = "\\mover%b()", [ 8 ] = "\\movevc%b()", + } + local tag2_unrepeat = { + [ 1 ] = "\\pos%b()", [ 2 ] = "\\move%b()", [ 3 ] = "\\moves3%b()", + [ 4 ] = "\\moves4%b()", [ 5 ] = "\\mover%b()", + } + local function tag_coupling2( String2, tag_cap ) + local tags_unrpt = { } + for c_cou in String2:gmatch( tag_cap ) do + table.insert( tags_unrpt, c_cou ) + end + if #tags_unrpt > 1 then + String2 = String2:gsub( tag_cap, "", #tags_unrpt - 1 ) + end + return String2 + end + for i = 1, #tags_unrepeat do + String = tag_coupling2( String, tags_unrepeat[ i ] ) + end + for i = 1, #tag2_unrepeat do + for c_cou2 in String:gmatch( tag2_unrepeat[ i ] ) do + table.insert( tag2_unrpt, c_cou2 ) + end + end + if #tag2_unrpt > 1 then + for i = 1, #tag2_unrpt - 1 do + String = String:gsub( tag.operation( tag2_unrpt[ i ] ), "" ) + end + end + return String + end function tag.operation( String ) - local String = String + local String = String :gsub( "%%","%%%%" ):gsub( "%*", "%%*" ):gsub( "%+", "%%+" ):gsub( "%-", "%%-" ) :gsub( "%(", "%%(" ):gsub( "%)", "%%)" ):gsub( "%[", "%%[" ):gsub( "%]", "%%]" ) return String end - + function tag.to_vsf( String, Is_Table ) local function from_error( String ) local error_tags_vsf = { @@ -9109,32 +9109,32 @@ end return String end - local String = from_error( String ) - String = String:gsub( "(\\%dv[ac]^*)(%b())", - function( tag_mod, coloralpha_mod ) - if coloralpha_mod:match( "%([&Hh ]*%x+[& ]*,[&Hh ]*%x+[& ]*,[&Hh ]*%x+[& ]*,[&Hh ]*%x+[& ]*%)" ) then - local coloralphas = { } - for c in coloralpha_mod:gmatch( "[&Hh ]*%x+[& ]*" ) do - table.insert( coloralphas, c ) - end - local col_alp1, col_alp2, colalpvf - if coloralphas[ 1 ]:len( ) >= 6 - and #coloralphas == 4 then - col_alp1 = color.interpolate( 0.5, coloralphas[ 1 ], coloralphas[ 4 ] ) - col_alp2 = color.interpolate( 0.5, coloralphas[ 2 ], coloralphas[ 3 ] ) - colalpvf = color.interpolate( 0.5, col_alp1, col_alp2 ) - elseif #coloralphas == 4 then - col_alp1 = alpha.interpolate( 0.5, coloralphas[ 1 ], coloralphas[ 4 ] ) - col_alp2 = alpha.interpolate( 0.5, coloralphas[ 2 ], coloralphas[ 3 ] ) - colalpvf = alpha.interpolate( 0.5, col_alp1, col_alp2 ) - end - tag_mod = tag_mod:gsub( "v", "" ) - coloralpha_mod = colalpvf - end - return tag_mod .. coloralpha_mod - end + local String = from_error( String ) + String = String:gsub( "(\\%dv[ac]^*)(%b())", + function( tag_mod, coloralpha_mod ) + if coloralpha_mod:match( "%([&Hh ]*%x+[& ]*,[&Hh ]*%x+[& ]*,[&Hh ]*%x+[& ]*,[&Hh ]*%x+[& ]*%)" ) then + local coloralphas = { } + for c in coloralpha_mod:gmatch( "[&Hh ]*%x+[& ]*" ) do + table.insert( coloralphas, c ) + end + local col_alp1, col_alp2, colalpvf + if coloralphas[ 1 ]:len( ) >= 6 + and #coloralphas == 4 then + col_alp1 = color.interpolate( 0.5, coloralphas[ 1 ], coloralphas[ 4 ] ) + col_alp2 = color.interpolate( 0.5, coloralphas[ 2 ], coloralphas[ 3 ] ) + colalpvf = color.interpolate( 0.5, col_alp1, col_alp2 ) + elseif #coloralphas == 4 then + col_alp1 = alpha.interpolate( 0.5, coloralphas[ 1 ], coloralphas[ 4 ] ) + col_alp2 = alpha.interpolate( 0.5, coloralphas[ 2 ], coloralphas[ 3 ] ) + colalpvf = alpha.interpolate( 0.5, col_alp1, col_alp2 ) + end + tag_mod = tag_mod:gsub( "v", "" ) + coloralpha_mod = colalpvf + end + return tag_mod .. coloralpha_mod + end ) - ------------------------------------------------------------- + ------------------------------------------------------------- if Is_Table == nil then --April 26th 2019 --evita que las llaves sean eliminadas cuando se retorna una tabla ^^' String = String:gsub( "%b{}", @@ -9174,9 +9174,9 @@ ) end --add: january 23rd 2019 ------------------------------------------------------------- - return tag.coupling( String ) - end - + return tag.coupling( String ) + end + function tag.ipol( Ipol_i, ... ) local valors = { ... } if type( ... ) == "table" then @@ -9295,59 +9295,59 @@ my_temp = my_temp:gsub( "%b||", "" ) end local var_temp_D = { - [ 001 ] = "$layer", [ 002 ] = "$style", [ 003 ] = "$actor", [ 004 ] = "$margin_l", - [ 005 ] = "$margin_r", [ 006 ] = "$margin_v", [ 007 ] = "$margin_t", [ 008 ] = "$margin_b", - [ 009 ] = "$scale_x", [ 010 ] = "$scale_y", [ 011 ] = "$angle", [ 012 ] = "$outline", - [ 013 ] = "$shadow", [ 014 ] = "$fontsize", [ 015 ] = "$fontname", [ 016 ] = "$spacing", + [ 001 ] = "$layer", [ 002 ] = "$style", [ 003 ] = "$actor", [ 004 ] = "$margin_l", + [ 005 ] = "$margin_r", [ 006 ] = "$margin_v", [ 007 ] = "$margin_t", [ 008 ] = "$margin_b", + [ 009 ] = "$scale_x", [ 010 ] = "$scale_y", [ 011 ] = "$angle", [ 012 ] = "$outline", + [ 013 ] = "$shadow", [ 014 ] = "$fontsize", [ 015 ] = "$fontname", [ 016 ] = "$spacing", [ 017 ] = "$color1", [ 018 ] = "$color2", [ 019 ] = "$color3", [ 020 ] = "$color4", - [ 021 ] = "$alpha1", [ 022 ] = "$alpha2", [ 023 ] = "$alpha3", [ 024 ] = "$alpha4", - [ 025 ] = "$align", [ 026 ] = "$lstart", [ 027 ] = "$lend", [ 028 ] = "$lmid", - [ 029 ] = "$ldur", [ 030 ] = "$li", [ 031 ] = "$linen", [ 032 ] = "$lleft", - [ 033 ] = "$lcenter", [ 034 ] = "$lright", [ 035 ] = "$lbottom", [ 036 ] = "$lmiddle", + [ 021 ] = "$alpha1", [ 022 ] = "$alpha2", [ 023 ] = "$alpha3", [ 024 ] = "$alpha4", + [ 025 ] = "$align", [ 026 ] = "$lstart", [ 027 ] = "$lend", [ 028 ] = "$lmid", + [ 029 ] = "$ldur", [ 030 ] = "$li", [ 031 ] = "$linen", [ 032 ] = "$lleft", + [ 033 ] = "$lcenter", [ 034 ] = "$lright", [ 035 ] = "$lbottom", [ 036 ] = "$lmiddle", [ 037 ] = "$ltop", [ 038 ] = "$lwidth", [ 039 ] = "$lheight", [ 040 ] = "$lx", - [ 041 ] = "$ly", [ 042 ] = "$lkdur", [ 043 ] = "$lpretime", [ 044 ] = "$lposttime", - [ 045 ] = "$ldescent", [ 046 ] = "$lextlead", [ 047 ] = "$sbottom", [ 048 ] = "$smiddle", - [ 049 ] = "$stop", [ 050 ] = "$sheight", [ 051 ] = "$cbottom", [ 052 ] = "$cmiddle", - [ 053 ] = "$ctop", [ 054 ] = "$cheight", [ 055 ] = "$wbottom", [ 056 ] = "$wmiddle", + [ 041 ] = "$ly", [ 042 ] = "$lkdur", [ 043 ] = "$lpretime", [ 044 ] = "$lposttime", + [ 045 ] = "$ldescent", [ 046 ] = "$lextlead", [ 047 ] = "$sbottom", [ 048 ] = "$smiddle", + [ 049 ] = "$stop", [ 050 ] = "$sheight", [ 051 ] = "$cbottom", [ 052 ] = "$cmiddle", + [ 053 ] = "$ctop", [ 054 ] = "$cheight", [ 055 ] = "$wbottom", [ 056 ] = "$wmiddle", [ 057 ] = "$wtop", [ 058 ] = "$wheight", [ 059 ] = "$fxbottom", [ 060 ] = "$fxmiddle", - [ 061 ] = "$fxtop", [ 062 ] = "$fxheight", [ 063 ] = "$bottom", [ 064 ] = "$middle", - [ 065 ] = "$top", [ 066 ] = "$height", [ 067 ] = "$sy", [ 068 ] = "$cy", - [ 069 ] = "$wy", [ 070 ] = "$fxy", [ 071 ] = "$y", [ 072 ] = "$sstart", - [ 073 ] = "$send", [ 074 ] = "$smid", [ 075 ] = "$sdur", [ 076 ] = "$sleft", + [ 061 ] = "$fxtop", [ 062 ] = "$fxheight", [ 063 ] = "$bottom", [ 064 ] = "$middle", + [ 065 ] = "$top", [ 066 ] = "$height", [ 067 ] = "$sy", [ 068 ] = "$cy", + [ 069 ] = "$wy", [ 070 ] = "$fxy", [ 071 ] = "$y", [ 072 ] = "$sstart", + [ 073 ] = "$send", [ 074 ] = "$smid", [ 075 ] = "$sdur", [ 076 ] = "$sleft", [ 077 ] = "$scenter", [ 078 ] = "$sright", [ 079 ] = "$swidth", [ 080 ] = "$sx", - [ 081 ] = "$skdur", [ 082 ] = "$cstart", [ 083 ] = "$cend", [ 084 ] = "$cmid", - [ 085 ] = "$cdur", [ 086 ] = "$cleft", [ 087 ] = "$ccenter", [ 088 ] = "$cright", - [ 089 ] = "$cwidth", [ 090 ] = "$cx", [ 091 ] = "$ckdur", [ 092 ] = "$wstart", - [ 093 ] = "$wend", [ 094 ] = "$wmid", [ 095 ] = "$wdur", [ 096 ] = "$wleft", + [ 081 ] = "$skdur", [ 082 ] = "$cstart", [ 083 ] = "$cend", [ 084 ] = "$cmid", + [ 085 ] = "$cdur", [ 086 ] = "$cleft", [ 087 ] = "$ccenter", [ 088 ] = "$cright", + [ 089 ] = "$cwidth", [ 090 ] = "$cx", [ 091 ] = "$ckdur", [ 092 ] = "$wstart", + [ 093 ] = "$wend", [ 094 ] = "$wmid", [ 095 ] = "$wdur", [ 096 ] = "$wleft", [ 097 ] = "$wcenter", [ 098 ] = "$wright", [ 099 ] = "$wwidth", [ 100 ] = "$wx", - [ 101 ] = "$wkdur", [ 102 ] = "$fxstart", [ 103 ] = "$fxend", [ 104 ] = "$fxmid", - [ 105 ] = "$fxdur", [ 106 ] = "$fxleft", [ 107 ] = "$fxcenter", [ 108 ] = "$fxright", - [ 109 ] = "$fxwidth", [ 110 ] = "$fxx", [ 111 ] = "$fxkdur", [ 112 ] = "$start", - [ 113 ] = "$end", [ 114 ] = "$mid", [ 115 ] = "$dur", [ 116 ] = "$left", + [ 101 ] = "$wkdur", [ 102 ] = "$fxstart", [ 103 ] = "$fxend", [ 104 ] = "$fxmid", + [ 105 ] = "$fxdur", [ 106 ] = "$fxleft", [ 107 ] = "$fxcenter", [ 108 ] = "$fxright", + [ 109 ] = "$fxwidth", [ 110 ] = "$fxx", [ 111 ] = "$fxkdur", [ 112 ] = "$start", + [ 113 ] = "$end", [ 114 ] = "$mid", [ 115 ] = "$dur", [ 116 ] = "$left", [ 117 ] = "$center", [ 118 ] = "$right", [ 119 ] = "$width", [ 120 ] = "$x", - [ 121 ] = "$kdur", [ 122 ] = "$si", [ 123 ] = "$syln", [ 124 ] = "$ci", - [ 125 ] = "$charn", [ 126 ] = "$wi", [ 127 ] = "$wordn", [ 128 ] = "$fxi", + [ 121 ] = "$kdur", [ 122 ] = "$si", [ 123 ] = "$syln", [ 124 ] = "$ci", + [ 125 ] = "$charn", [ 126 ] = "$wi", [ 127 ] = "$wordn", [ 128 ] = "$fxi", [ 129 ] = "$fxn", [ 130 ] = "$i", [ 131 ] = "$n", } local Tl, Ts, Tc, Tw = linefx[ ii ], linefx[ ii ].syl, linefx[ ii ].char, linefx[ ii ].word local var_temp_L = { - [ 001 ] = Tl.layer, [ 002 ] = Tl.style, [ 003 ] = Tl.actor, [ 004 ] = Tl.margin_l, - [ 005 ] = Tl.margin_r, [ 006 ] = Tl.margin_v, [ 007 ] = Tl.margin_t, [ 008 ] = Tl.margin_b, - [ 009 ] = Tl.scale_x, [ 010 ] = Tl.scale_y, [ 011 ] = Tl.angle, [ 012 ] = Tl.outline, - [ 013 ] = Tl.shadow, [ 014 ] = Tl.fontsize, [ 015 ] = Tl.fontname, [ 016 ] = Tl.spacing, + [ 001 ] = Tl.layer, [ 002 ] = Tl.style, [ 003 ] = Tl.actor, [ 004 ] = Tl.margin_l, + [ 005 ] = Tl.margin_r, [ 006 ] = Tl.margin_v, [ 007 ] = Tl.margin_t, [ 008 ] = Tl.margin_b, + [ 009 ] = Tl.scale_x, [ 010 ] = Tl.scale_y, [ 011 ] = Tl.angle, [ 012 ] = Tl.outline, + [ 013 ] = Tl.shadow, [ 014 ] = Tl.fontsize, [ 015 ] = Tl.fontname, [ 016 ] = Tl.spacing, [ 017 ] = Tl.color1, [ 018 ] = Tl.color2, [ 019 ] = Tl.color3, [ 020 ] = Tl.color4, - [ 021 ] = Tl.alpha1, [ 022 ] = Tl.alpha2, [ 023 ] = Tl.alpha3, [ 024 ] = Tl.alpha4, - [ 025 ] = Tl.align, [ 026 ] = Tl.start_time, [ 027 ] = Tl.end_time, [ 028 ] = Tl.mid_time, - [ 029 ] = Tl.duration, [ 030 ] = l_i, [ 031 ] = l_n, [ 032 ] = Tl.left, - [ 033 ] = Tl.center, [ 034 ] = Tl.right, [ 035 ] = Tl.bottom, [ 036 ] = Tl.middle, + [ 021 ] = Tl.alpha1, [ 022 ] = Tl.alpha2, [ 023 ] = Tl.alpha3, [ 024 ] = Tl.alpha4, + [ 025 ] = Tl.align, [ 026 ] = Tl.start_time, [ 027 ] = Tl.end_time, [ 028 ] = Tl.mid_time, + [ 029 ] = Tl.duration, [ 030 ] = l_i, [ 031 ] = l_n, [ 032 ] = Tl.left, + [ 033 ] = Tl.center, [ 034 ] = Tl.right, [ 035 ] = Tl.bottom, [ 036 ] = Tl.middle, [ 037 ] = Tl.top, [ 038 ] = Tl.width, [ 039 ] = Tl.height, [ 040 ] = Tl.center, - [ 041 ] = Tl.middle, [ 042 ] = Tl.duration / 10, [ 043 ] = Tl.pretime, [ 044 ] = Tl.posttime, - [ 045 ] = Tl.descent, [ 046 ] = Tl.extlead, [ 047 ] = Tl.bottom, [ 048 ] = Tl.middle, - [ 049 ] = Tl.top, [ 050 ] = Tl.height, [ 051 ] = Tl.bottom, [ 052 ] = Tl.middle, - [ 053 ] = Tl.top, [ 054 ] = Tl.height, [ 055 ] = Tl.bottom, [ 056 ] = Tl.middle, + [ 041 ] = Tl.middle, [ 042 ] = Tl.duration / 10, [ 043 ] = Tl.pretime, [ 044 ] = Tl.posttime, + [ 045 ] = Tl.descent, [ 046 ] = Tl.extlead, [ 047 ] = Tl.bottom, [ 048 ] = Tl.middle, + [ 049 ] = Tl.top, [ 050 ] = Tl.height, [ 051 ] = Tl.bottom, [ 052 ] = Tl.middle, + [ 053 ] = Tl.top, [ 054 ] = Tl.height, [ 055 ] = Tl.bottom, [ 056 ] = Tl.middle, [ 057 ] = Tl.top, [ 058 ] = Tl.height, [ 059 ] = Tl.bottom, [ 060 ] = Tl.middle, - [ 061 ] = Tl.top, [ 062 ] = Tl.height, [ 063 ] = Tl.bottom, [ 064 ] = Tl.middle, - [ 065 ] = Tl.top, [ 066 ] = Tl.height, [ 067 ] = Tl.middle, [ 068 ] = Tl.middle, + [ 061 ] = Tl.top, [ 062 ] = Tl.height, [ 063 ] = Tl.bottom, [ 064 ] = Tl.middle, + [ 065 ] = Tl.top, [ 066 ] = Tl.height, [ 067 ] = Tl.middle, [ 068 ] = Tl.middle, [ 069 ] = Tl.middle, [ 070 ] = Tl.middle, [ 071 ] = Tl.middle, [ 072 ] = { }, [ 073 ] = { }, [ 074 ] = { }, [ 075 ] = { }, [ 076 ] = { }, [ 077 ] = { }, [ 078 ] = { }, [ 079 ] = { }, [ 080 ] = { }, @@ -9437,9 +9437,9 @@ end local temp_line, temp_text, dollar_to_val = "", "", "" for i = 1, T2x.n do - temp_text = T2x[ i ].text1 - :gsub( "\\k%d+", "" ):gsub( "\\K%d+", "" ) - :gsub( "\\kf%d+", "" ):gsub( "\\ko%d+", "" ):gsub( "KEfx", "" ) + temp_text = T2x[ i ].text1 + :gsub( "\\k%d+", "" ):gsub( "\\K%d+", "" ) + :gsub( "\\kf%d+", "" ):gsub( "\\ko%d+", "" ):gsub( "KEfx", "" ) --dollar_to_val = dollar2val( my_temp, i ):gsub( "\\r", "" ) --temp_line = temp_line .. format( "{\\r%s%s}%s", tags_style, dollar_to_val, temp_text ) dollar_to_val = dollar2val( my_temp, i ) --fix: january 24th 2019 @@ -9463,13 +9463,13 @@ end return temp_line end - + function tag.delete_in_return( return_fx ) local return_kefx = return_fx or "" local delete_tags = { --si algunos de estos tags se colocan en Return[fx] --y también están en Add Tags, se eliminan de Return[fx] para evitar conflictos ^^' - [ 01 ] = "\\[xy]*bord%-?%d+[%.%d]*", [ 02 ] = "\\[xy]*shad%-?%d+[%.%d]*", - [ 03 ] = "\\[%d]*c%&H[%x]*%&", [ 04 ] = "\\%da%&H[%x]*%&", + [ 01 ] = "\\[xy]*bord%-?%d+[%.%d]*", [ 02 ] = "\\[xy]*shad%-?%d+[%.%d]*", + [ 03 ] = "\\[%d]*c%&H[%x]*%&", [ 04 ] = "\\%da%&H[%x]*%&", [ 05 ] = "\\alpha%&H[%x]*%&", [ 06 ] = "\\blur%d+[%.%d]*", [ 07 ] = "\\be%d+[%.%d]*", -- [ 08 ] = "\\p%d+", } @@ -11981,7 +11981,7 @@ for k = 1, #segms do tags = tags .. shape_lmove( segms[ k ], times[ k - 1 ], times[ k ] ) end - tags2 = remember( "shSmtag", format( "%s\\p1}m 0 0 m 100 100 {\\p0\\r%s", tags, tags_style .. effector.keeptags( fx__.t_type, fx__.keeptagsfx ) ) ) + tags2 = remember( "shSmtag", format( "%s\\p1}m 0 0 m 100 100 {\\p0\\r%s", tags, tags_style .. effector.keeptags( fx__.t_type, fx__.keeptagsfx ) ) ) end local fscxy, sizex, sizey = { }, { }, { } for c in tags2:gmatch( "fscx?y?(%-?%d+[%.%d]*)" ) do @@ -13748,180 +13748,180 @@ end return ShapeC end --shape.fxcircle( ) - + function shape.trim( Shape, Lines, Mark, Ratio ) - --divide en partes una shape según las rectas ingresadas - if type( Shape ) == "function" then - Shape = Shape( ) - end - if type( Lines ) == "function" then - Lines = Lines( ) - end - if type( Mark ) == "function" then - Mark = Mark( ) - end - if type( Ratio ) == "function" then - Ratio = Ratio( ) - end + --divide en partes una shape según las rectas ingresadas + if type( Shape ) == "function" then + Shape = Shape( ) + end + if type( Lines ) == "function" then + Lines = Lines( ) + end + if type( Mark ) == "function" then + Mark = Mark( ) + end + if type( Ratio ) == "function" then + Ratio = Ratio( ) + end local Shape = shape.ASSDraw3( Shape ) - effector.print_error( Shape, "shape", "shape.trim", 1 ) - local Mark = Mark or "" - local Ratio = Ratio or 1 - effector.print_error( Lines, "table", "shape.trim", 2 ) - effector.print_error( Mark, "numbershapetable", "shape.trim", 3 ) - effector.print_error( Ratio, "number", "shape.trim", 4 ) - shape.info( Shape) - if Mark == 1 then - Mark = format( "m %s %s m %s %s ", maxx, maxy, minx, miny ) - elseif type( Mark ) == "table" then - Mark = format( " m %s %s m 0 0 ", Mark[ 1 ] * Ratio, Mark[ 2 ] * Ratio ) - end - local trim_tbl = recall.trim_table - if j == 1 then - trim_tbl = remember( "trim_table", { Shape } ) - local trim_n - local function get_shapes( Shape, Line ) - local function get_var( Line ) - local x1, y1, x2, y2, m, b, ang - if type( Line ) == "table" then - x1, y1 = Line[ 1 ], Line[ 2 ] - if #Line == 4 then -- tabla de 2 puntos - x2, y2 = Line[ 3 ], Line[ 4 ] - elseif #Line == 3 then - if type( Line[ 3 ] ) == "number" then --table de punto y ángulo - x2 = x1 + math.polar( Line[ 3 ], 1, "x" ) - y2 = y1 + math.polar( Line[ 3 ], 1, "y" ) - elseif type( Line[ 3 ] ) == "table" then --tabla de punto y pendiente - x2 = x1 + 1 - y2 = y1 + Line[ 3 ][ 1 ] - end - else - ang = 5 + R( 36 ) * 10 - x2 = x1 + math.polar( ang, 1, "x" ) - y2 = y1 + math.polar( ang, 1, "y" ) - end - else - local coor = { } - for num in Line:gmatch( "%-?%d+[%.%d]*" ) do - table.insert( coor, tonumber( num ) ) - end - x1, y1, x2, y2 = coor[ 1 ], coor[ 2 ], coor[ 3 ], coor[ 4 ] - end - x1, y1, x2, y2 = x1 * Ratio, y1 * Ratio, x2 * Ratio, y2 * Ratio - if x1 ~= x2 then - m = (y2 - y1) / (x2 - x1) - b = y1 - m * x1 - else - m = x1 - b = nil - end - return m, b - end - local function get_point( Shape, Line ) - local shp_trim = { } - local m, b = get_var( Line ) - if b then - shp_trim[ 1 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", - function( c, x, y ) - if c and tonumber( y ) <= m * tonumber( x ) + b then - if tonumber( y ) + 0.99 * Ratio >= m * tonumber( x ) + b then - y = m * tonumber( x ) + b - end - return format( "%s %s %s ", c, x, y ) - end - return "" - end - ) - shp_trim[ 2 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", - function( c, x, y ) - if c and tonumber( y ) >= m * tonumber( x ) + b then - if tonumber( y ) + 0.99 * Ratio <= m * tonumber( x ) + b then - y = m * tonumber( x ) + b - end - return format( "%s %s %s ", c, x, y ) - end - return "" - end - ) - else - shp_trim[ 1 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", - function( c, x, y ) - if c and tonumber( x ) >= m then - if tonumber( x ) + 0.99 * Ratio <= m then - x = m - end - return format( "%s %s %s ", c, x, y ) - end - return "" - end - ) - shp_trim[ 2 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", - function( c, x, y ) - if c and tonumber( x ) <= m then - if tonumber( x ) + 0.99 * Ratio >= m then - x = m - end - return format( "%s %s %s ", c, x, y ) - end - return "" - end - ) - end - return shp_trim - end - local Line = Line or "m 0 0 l 1 0 " - local trims = { } - local shape_trims = { [ 1 ] = "", [ 2 ] = "" } - local Shapes = shape.divide( Shape ) - for i = 1, #Shapes do - Shapes[ i ] = shape.redraw( Shapes[ i ], Ratio ) - trims[ i ] = get_point( Shapes[ i ], Line ) - end - for i = 1, #trims do - trims[ i ][ 1 ] = "m" .. trims[ i ][ 1 ]:sub( 2, -1 ) - trims[ i ][ 2 ] = "m" .. trims[ i ][ 2 ]:sub( 2, -1 ) - if trims[ i ][ 1 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) then - trims[ i ][ 1 ] = trims[ i ][ 1 ] .. trims[ i ][ 1 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) - end - if trims[ i ][ 2 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) then - trims[ i ][ 2 ] = trims[ i ][ 2 ] .. trims[ i ][ 2 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) - end - if trims[ i ][ 1 ] == "m" then - trims[ i ][ 1 ] = "" - end - if trims[ i ][ 2 ] == "m" then - trims[ i ][ 2 ] = "" - end - end - for i = 1, #trims do - shape_trims[ 1 ] = shape_trims[ 1 ] .. trims[ i ][ 1 ] - shape_trims[ 2 ] = shape_trims[ 2 ] .. trims[ i ][ 2 ] - end - shape_trims[ 1 ] = shape.reduce( shape.ASSDraw3( shape_trims[ 1 ] ), 5 ) - shape_trims[ 2 ] = shape.reduce( shape.ASSDraw3( shape_trims[ 2 ] ), 5 ) - for i, v in pairs( shape_trims ) do - if v == "" then - table.remove( shape_trims, i ) - end - end - return shape_trims - end - local trim_aux = { } - for i = 1, #Lines do - trim_n = #trim_tbl - for k = 1, trim_n do - trim_aux = table.inserttable( trim_aux, get_shapes( trim_tbl[ k ], Lines[ i ] ) ) - end - trim_tbl = table.duplicate( trim_aux ) - trim_aux = { } - end - for i = 1, #trim_tbl do - trim_tbl[ i ] = shape.ASSDraw3( Mark ) .. trim_tbl[ i ] - end - end - return trim_tbl - end --tbl = shape.trim( shape.rectangle, { "m 0 100 l 100 0 ", "m 0 0 l 100 100 ", { 0, 20, 100, 20 } } ) - + effector.print_error( Shape, "shape", "shape.trim", 1 ) + local Mark = Mark or "" + local Ratio = Ratio or 1 + effector.print_error( Lines, "table", "shape.trim", 2 ) + effector.print_error( Mark, "numbershapetable", "shape.trim", 3 ) + effector.print_error( Ratio, "number", "shape.trim", 4 ) + shape.info( Shape) + if Mark == 1 then + Mark = format( "m %s %s m %s %s ", maxx, maxy, minx, miny ) + elseif type( Mark ) == "table" then + Mark = format( " m %s %s m 0 0 ", Mark[ 1 ] * Ratio, Mark[ 2 ] * Ratio ) + end + local trim_tbl = recall.trim_table + if j == 1 then + trim_tbl = remember( "trim_table", { Shape } ) + local trim_n + local function get_shapes( Shape, Line ) + local function get_var( Line ) + local x1, y1, x2, y2, m, b, ang + if type( Line ) == "table" then + x1, y1 = Line[ 1 ], Line[ 2 ] + if #Line == 4 then -- tabla de 2 puntos + x2, y2 = Line[ 3 ], Line[ 4 ] + elseif #Line == 3 then + if type( Line[ 3 ] ) == "number" then --table de punto y ángulo + x2 = x1 + math.polar( Line[ 3 ], 1, "x" ) + y2 = y1 + math.polar( Line[ 3 ], 1, "y" ) + elseif type( Line[ 3 ] ) == "table" then --tabla de punto y pendiente + x2 = x1 + 1 + y2 = y1 + Line[ 3 ][ 1 ] + end + else + ang = 5 + R( 36 ) * 10 + x2 = x1 + math.polar( ang, 1, "x" ) + y2 = y1 + math.polar( ang, 1, "y" ) + end + else + local coor = { } + for num in Line:gmatch( "%-?%d+[%.%d]*" ) do + table.insert( coor, tonumber( num ) ) + end + x1, y1, x2, y2 = coor[ 1 ], coor[ 2 ], coor[ 3 ], coor[ 4 ] + end + x1, y1, x2, y2 = x1 * Ratio, y1 * Ratio, x2 * Ratio, y2 * Ratio + if x1 ~= x2 then + m = (y2 - y1) / (x2 - x1) + b = y1 - m * x1 + else + m = x1 + b = nil + end + return m, b + end + local function get_point( Shape, Line ) + local shp_trim = { } + local m, b = get_var( Line ) + if b then + shp_trim[ 1 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", + function( c, x, y ) + if c and tonumber( y ) <= m * tonumber( x ) + b then + if tonumber( y ) + 0.99 * Ratio >= m * tonumber( x ) + b then + y = m * tonumber( x ) + b + end + return format( "%s %s %s ", c, x, y ) + end + return "" + end + ) + shp_trim[ 2 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", + function( c, x, y ) + if c and tonumber( y ) >= m * tonumber( x ) + b then + if tonumber( y ) + 0.99 * Ratio <= m * tonumber( x ) + b then + y = m * tonumber( x ) + b + end + return format( "%s %s %s ", c, x, y ) + end + return "" + end + ) + else + shp_trim[ 1 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", + function( c, x, y ) + if c and tonumber( x ) >= m then + if tonumber( x ) + 0.99 * Ratio <= m then + x = m + end + return format( "%s %s %s ", c, x, y ) + end + return "" + end + ) + shp_trim[ 2 ] = Shape:gsub( "([mlb]*) (%-?%d+[%.%d]*) (%-?%d+[%.%d]*) ", + function( c, x, y ) + if c and tonumber( x ) <= m then + if tonumber( x ) + 0.99 * Ratio >= m then + x = m + end + return format( "%s %s %s ", c, x, y ) + end + return "" + end + ) + end + return shp_trim + end + local Line = Line or "m 0 0 l 1 0 " + local trims = { } + local shape_trims = { [ 1 ] = "", [ 2 ] = "" } + local Shapes = shape.divide( Shape ) + for i = 1, #Shapes do + Shapes[ i ] = shape.redraw( Shapes[ i ], Ratio ) + trims[ i ] = get_point( Shapes[ i ], Line ) + end + for i = 1, #trims do + trims[ i ][ 1 ] = "m" .. trims[ i ][ 1 ]:sub( 2, -1 ) + trims[ i ][ 2 ] = "m" .. trims[ i ][ 2 ]:sub( 2, -1 ) + if trims[ i ][ 1 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) then + trims[ i ][ 1 ] = trims[ i ][ 1 ] .. trims[ i ][ 1 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) + end + if trims[ i ][ 2 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) then + trims[ i ][ 2 ] = trims[ i ][ 2 ] .. trims[ i ][ 2 ]:match( "m (%-?%d+[%.%d]* %-?%d+[%.%d]* )" ) + end + if trims[ i ][ 1 ] == "m" then + trims[ i ][ 1 ] = "" + end + if trims[ i ][ 2 ] == "m" then + trims[ i ][ 2 ] = "" + end + end + for i = 1, #trims do + shape_trims[ 1 ] = shape_trims[ 1 ] .. trims[ i ][ 1 ] + shape_trims[ 2 ] = shape_trims[ 2 ] .. trims[ i ][ 2 ] + end + shape_trims[ 1 ] = shape.reduce( shape.ASSDraw3( shape_trims[ 1 ] ), 5 ) + shape_trims[ 2 ] = shape.reduce( shape.ASSDraw3( shape_trims[ 2 ] ), 5 ) + for i, v in pairs( shape_trims ) do + if v == "" then + table.remove( shape_trims, i ) + end + end + return shape_trims + end + local trim_aux = { } + for i = 1, #Lines do + trim_n = #trim_tbl + for k = 1, trim_n do + trim_aux = table.inserttable( trim_aux, get_shapes( trim_tbl[ k ], Lines[ i ] ) ) + end + trim_tbl = table.duplicate( trim_aux ) + trim_aux = { } + end + for i = 1, #trim_tbl do + trim_tbl[ i ] = shape.ASSDraw3( Mark ) .. trim_tbl[ i ] + end + end + return trim_tbl + end --tbl = shape.trim( shape.rectangle, { "m 0 100 l 100 0 ", "m 0 0 l 100 100 ", { 0, 20, 100, 20 } } ) + function shape.reduce( Shape ) --elimina los puntos que le sobren a una shape if type( Shape ) == "function" then @@ -13943,14 +13943,14 @@ return format( "%s %s l %s %s", x1, y1, x3, y3 ) end end - ) + ) return Shape_red end while Shape ~= get_reduce( Shape ) do Shape = get_reduce( Shape ) end end - return Shape + return Shape --shape.reduce( shape.redraw( shape.rectangle, 4 ) ) end --shape.reduce( "m 0 0 l 0 2 l 0 3 l 0 5 l 0 6 l 0 8 l 0 9 l 0 11 l 0 12 l 0 14 " ) @@ -16019,18 +16019,18 @@ txt_2lw = txt_2lw:gsub( "KEfx", "" ) return txt_2lw end --Text:lower( ) - - function text.kara( ) - local text_2kara = "" - for i = 1, linefx[ ii ].syl.n do - if i < linefx[ ii ].syl.n - or linefx[ ii ].syl[ i ].text1:gsub( " ", "" ) ~= "" then - text_2kara = text_2kara .. format( "{\\k%s}%s", - math.round( linefx[ ii ].syl[ i ].duration / 10 ), linefx[ ii ].syl[ i ].text1 - ) - end - end - text_2kara = text_2kara:gsub( "\\k0", "" ):gsub( "{}", "" ) + + function text.kara( ) + local text_2kara = "" + for i = 1, linefx[ ii ].syl.n do + if i < linefx[ ii ].syl.n + or linefx[ ii ].syl[ i ].text1:gsub( " ", "" ) ~= "" then + text_2kara = text_2kara .. format( "{\\k%s}%s", + math.round( linefx[ ii ].syl[ i ].duration / 10 ), linefx[ ii ].syl[ i ].text1 + ) + end + end + text_2kara = text_2kara:gsub( "\\k0", "" ):gsub( "{}", "" ) text_2kara = text_2kara:gsub( "(%b{})(%b{})", function( capture1, capture2 ) local Times, Tag_k @@ -16045,14 +16045,14 @@ return format( "{%s%s}", capture1:sub( 2, -2 ), capture2:sub( 2, -2 ) ) end ) - text_2kara = text_2kara:gsub( "%b{} ", - function( capture ) - capture = capture:sub( 1, -2 ) - return " " .. capture .. "|" - end - ) - return text_2kara - end --Text:kara( ) + text_2kara = text_2kara:gsub( "%b{} ", + function( capture ) + capture = capture:sub( 1, -2 ) + return " " .. capture .. "|" + end + ) + return text_2kara + end --Text:kara( ) function text.infx( syl_in_fx, true_false ) -- encuentra las marcas +fx y -fx en las syls y le aplica fx solo a ellas @@ -16095,9 +16095,9 @@ function text.outfx( syl_out_fx ) return text.infx( syl_out_fx, 2 ) end --syl.text:outfx( ) - sylfx = { - infx = text.infx, - outfx = text.outfx, + sylfx = { + infx = text.infx, + outfx = text.outfx, } function text.tag( ... ) @@ -16740,54 +16740,54 @@ local K_mode_tbl = { "k", "kf", "ko" } if table.inside( K_mode_tbl, K_mode ) == false then K_mode = "k" - end - local romajis = { - ---------------------------------------------------------------------- - "kya", "kyu", "kyo", "sha", "shu", "sho", "cha", "chu", "cho", - "nya", "nyu", "nyo", "hya", "hyu", "hyo", "mya", "myu", "myo", - "rya", "ryu", "ryo", "gya", "gyu", "gyo", "bya", "byu", "byo", - "pya", "pyu", "pyo", "shi", "chi", "tsu", - ---------------------------------------------------------------------- - "ya", "yu", "yo", "ka", "ki", "ku", "ke", "ko", "sa", - "su", "se", "so", "ta", "te", "to", "na", "ni", "nu", - "ne", "no", "ha", "hi", "fu", "he", "ho", "ma", "mi", - "mu", "me", "mo", "ya", "yu", "yo", "ra", "ri", "ru", - "re", "ro", "wa", "wi", "we", "wo", "ga", "gi", "gu", - "ge", "go", "za", "ji", "zu", "ze", "zo", "ja", "ju", - "jo", "da", "di", "du", "de", "do", "ba", "bi", "bu", - "be", "bo", "pa", "pi", "pu", "pe", "po", - ---------------------------------------------------------------------- - "a", "i", "u", "e", "o", "n", "b", "c", "d", - "k", "p", "r", "s", "t", "z" - ---------------------------------------------------------------------- - } - local String = text.lower( String ) - String = String:gsub( "%b{}", "" ) - local words, times = text.text2word( String ) - local num = 0 - for i = 1, #words do - for k = 1, #romajis do - words[ i ] = words[ i ]:gsub( "[\128-\255]*" .. romajis[ k ], "[%1]" ) - end - words[ i ] = words[ i ]:gsub( "%b[]", - function( capture ) - capture = capture:gsub( "%[", "" ):gsub( "%]", "" ) - return "[" .. capture .. "]" - end - ) - words[ i ], num = words[ i ]:gsub( "%b[]", "%1" ) - if num > 0 then - words[ i ] = words[ i ]:gsub( "%b[]", - function( capture ) - capture = capture:gsub( "%[", "" ):gsub( "%]", "" ) - return format( "{\\%s%d}%s", K_mode, times[ i ] / (num * 10), capture ) - end - ) - end - end - String = table.op( words, "concat" ) - return String - end --text.to_kara( line.text_stripped ) + end + local romajis = { + ---------------------------------------------------------------------- + "kya", "kyu", "kyo", "sha", "shu", "sho", "cha", "chu", "cho", + "nya", "nyu", "nyo", "hya", "hyu", "hyo", "mya", "myu", "myo", + "rya", "ryu", "ryo", "gya", "gyu", "gyo", "bya", "byu", "byo", + "pya", "pyu", "pyo", "shi", "chi", "tsu", + ---------------------------------------------------------------------- + "ya", "yu", "yo", "ka", "ki", "ku", "ke", "ko", "sa", + "su", "se", "so", "ta", "te", "to", "na", "ni", "nu", + "ne", "no", "ha", "hi", "fu", "he", "ho", "ma", "mi", + "mu", "me", "mo", "ya", "yu", "yo", "ra", "ri", "ru", + "re", "ro", "wa", "wi", "we", "wo", "ga", "gi", "gu", + "ge", "go", "za", "ji", "zu", "ze", "zo", "ja", "ju", + "jo", "da", "di", "du", "de", "do", "ba", "bi", "bu", + "be", "bo", "pa", "pi", "pu", "pe", "po", + ---------------------------------------------------------------------- + "a", "i", "u", "e", "o", "n", "b", "c", "d", + "k", "p", "r", "s", "t", "z" + ---------------------------------------------------------------------- + } + local String = text.lower( String ) + String = String:gsub( "%b{}", "" ) + local words, times = text.text2word( String ) + local num = 0 + for i = 1, #words do + for k = 1, #romajis do + words[ i ] = words[ i ]:gsub( "[\128-\255]*" .. romajis[ k ], "[%1]" ) + end + words[ i ] = words[ i ]:gsub( "%b[]", + function( capture ) + capture = capture:gsub( "%[", "" ):gsub( "%]", "" ) + return "[" .. capture .. "]" + end + ) + words[ i ], num = words[ i ]:gsub( "%b[]", "%1" ) + if num > 0 then + words[ i ] = words[ i ]:gsub( "%b[]", + function( capture ) + capture = capture:gsub( "%[", "" ):gsub( "%]", "" ) + return format( "{\\%s%d}%s", K_mode, times[ i ] / (num * 10), capture ) + end + ) + end + end + String = table.op( words, "concat" ) + return String + end --text.to_kara( line.text_stripped ) function text.syl2hiragana( Text ) local idx @@ -16837,10 +16837,10 @@ function text.char_size( ) local char_DS = _ds or 0.85 local char_ds = char_DS * l.descent - local char_t1 = { - "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "R", - "S", "T", "U", "V", "W", "X", "Y", "Z", "á", "é", "í", "ó", "ú", "ü", "b", "d", "f", - "h", "i", "k", "l", "ñ", "t" + local char_t1 = { + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "R", + "S", "T", "U", "V", "W", "X", "Y", "Z", "á", "é", "í", "ó", "ú", "ü", "b", "d", "f", + "h", "i", "k", "l", "ñ", "t" } local char_t2 = { "Ñ", "Á", "É", "Í", "Ó", "Ú", "Ü" } local char_t3 = { "g", "p", "q", "y" } @@ -19211,7 +19211,7 @@ local Lua_file = Lua_file or "utils-auto4" Lua_file = Lua_file:gsub( "%.lua", "" ) include( Lua_file .. ".lua" ) - end + end import = effector.import function effector.addfx( Library_fx, Name_fx ) @@ -19245,7 +19245,7 @@ table.insert( effector.list, add_fx ) lines_comment = false end - end + end addfx = effector.addfx function effector.savefx( New_fxname, File_fx ) @@ -19605,7 +19605,7 @@ [:error:] The %s argument of the function must be a color string.]], name_function, arg_pos_nm1, arg_pos_nm2 ), 2 ) end elseif type_argument == "alpha" then - if type( name_argument ) ~= "string" + if type( name_argument ) ~= "string" and type( name_argument ) ~= "number" and type( name_argument ) ~= "table" and type( name_argument ) ~= "function" then @@ -20166,8 +20166,8 @@ ------------▼ line linefx.ii = i linefx[ i ].styleref = l_style - linefx[ i ].duration = linefx[ i ].end_time - linefx[ i ].start_time - linefx[ i ].dur = linefx[ i ].duration + linefx[ i ].duration = linefx[ i ].end_time - linefx[ i ].start_time + linefx[ i ].dur = linefx[ i ].duration linefx[ i ].mid_time = linefx[ i ].start_time + linefx[ i ].duration / 2 linefx[ i ].text_raw = linefx[ i ].text linefx[ i ].text_stripped = text.remove_extra_space( text.remove_tags( linefx[ i ].text ) ) @@ -21277,4 +21277,4 @@ or box_res == "Apply " .. sett.effect_mode or box_res == "Modify " .. sett.effect_mode or true ::config_ini_mode:: - end \ No newline at end of file + end