- UID
- 2546
- 积分
- 159
- 帖子
- 30
- 主题
- 5
- 论坛币
- 868
- 威望
- 0
- EP值
- 134
- MP值
- 0
- 阅读权限
- 50
- 注册时间
- 2015-5-9
- 在线时间
- 52 小时
- 最后登录
- 2024-10-20
|
本帖最后由 Seekladoom 于 2022-4-30 13:35 编辑
在线预览:
【歌词特效】公主连结 OP
【PyonFX 特效】公主连结_OP.rar
(21.86 KB, 下载次数: 2315)
- from pyonfx import *
- from math import *
- from random import *
- io = Ass("公主连结_OP_K.ass", "公主连结_OPFX.ass")
- meta, styles, lines = io.get_data()
- # 模板分区
- def Princess_OPJP(line, l):
- if line.actor == "phase 1":
- shape = "m 0 0 l 2 0 l 2 50 l 0 50 l 0 0","m 100 0 b 100 -55 55 -100 0 -100 b -55 -100 -100 -55 -100 0 b -100 55 -55 100 0 100 b 55 100 100 55 100 0","m -5 0 l -5 0 l 5 0 l 5 22 l -5 22"
-
- # 常规文字部分
- l.layer = 0
-
- # syl2end
- l.start_time = _lstart + _send - _sdur
- l.end_time = _lend + _si*30
-
- l.text = "{\\an5\\pos(%.f,%.f)\\blur2\\shad0\\fad(200,200)}%s" % (_center, _middle, syl.text)
- io.write_line(l)
-
- # 圆点
- for j in range(3):
- l.layer = 1
-
- # syl
- l.start_time = _lstart + _sstart + (-j-1)*100
- l.end_time = _lstart + _send + 1000
-
- l.text = "{\\an5\\move(%.f,%.f,%.f,%.f)\\1a%s\\blur%.f\\bord0\\shad0\\fad(200,500)\\p%.f}%s" % (
- _center - randint(0,50), _middle - randint(0,50), _center + randint(0,50), _middle + randint(0,50),
- Convert.alpha_dec_to_ass(randint(50,150)), randint(1,2), randint(4,6), shape[1])
- io.write_line(l)
-
- for j in range(3):
- l.layer = 1
-
- # syl
- l.start_time = _lstart + _sstart + (-j-1)*100
- l.end_time = _lstart + _send + 1000
-
- l.text = "{\\an5\\move(%.f,%.f,%.f,%.f)\\1a%s\\blur%.f\\bord0\\shad0\\fad(200,500)\\p%.f}%s" % (
- _center - randint(0,50), _middle + randint(0,50), _center + randint(0,50), _middle - randint(0,50),
- Convert.alpha_dec_to_ass(randint(50,150)), randint(3,4), randint(4,6), shape[1])
- io.write_line(l)
-
- if line.actor == "phase 2":
- eye_color = ["00AF50","E1E100","AF69E1"]
- l.layer = 2
-
- # preline
- l.start_time = _lstart - 500
- l.end_time = _lstart
- l.text = "{\\an5\\move(%.f,%.f,%.f,%.f)\\3c&H%s&\\blur2\\frz-30\\shad0}%s" % (_center + 1300, _middle - 100, _center, _middle, eye_color[_si%3], syl.text)
- io.write_line(l)
-
- # start2syl
- l.start_time = _lstart + _si*30
- l.end_time = _lstart + _sstart
- l.text = "{\\an5\\pos(%.f,%.f)\\3c&H%s&\\blur2}%s" % (_center, _middle, eye_color[_si%3], syl.text)
- io.write_line(l)
-
- # syl
- l.start_time = _lstart + _sstart
- l.end_time = _lstart + _send
- l.text = "{\\an5\\pos(%.f,%.f)\\3c&H%s&\\blur2\\fs65\\t(0,%.f,\\fs85)\\t(%.f,%.f,\\fs65)}%s" % ( _center, _middle, eye_color[_si%3], _sdur/2, _sdur/2, _sdur, syl.text)
- io.write_line(l)
-
- # syl2end
- l.start_time = _lstart + _send
- l.end_time = _lend
- l.text = "{\\an5\\pos(%.f,%.f)\\3c&H%s&\\blur2\\fad(0,200)}%s" % (_center, _middle, eye_color[_si%3], syl.text)
- io.write_line(l)
-
- # 在第一个音节底部添加飞叶滑板
- if syl.i == 0:
- leaf = "m 0 0 b -9 2 -16 5 -17 8 b -19 17 -11 16 -11 16 b -3 13 -4 7 0 0"
- l.layer = 1
- l.start_time = _lstart
- l.end_time = _lend
- l.text = "{\\an7\\pos(%.f,%.f)\\1c&H32B99B&\\blur2\\bord2\\frx-75\\frz-30\\fscx300\\fscy200\\p1}%s" % (_center + 17, _middle + 26, leaf) # 注:PyonFX的字幕行生成的先后顺序由l.text和io.write_line(l)决定,越在前面的越先生成
- io.write_line(l)
-
- sand = "m 0 0 b 25 0 60 0 100 0 b 88 -2 75 -3 75 -20 b 65 -3 50 -3 50 -15 b 40 -3 25 -3 25 -10 b 15 -2 11 -1 0 0 m 100 0 b 125 0 160 0 200 0 b 191 -3 175 -3 175 -20 b 165 -3 150 -3 150 -15 b 140 -3 125 -3 125 -10 b 115 -2 111 -1 100 0 m 200 0 b 225 0 260 0 300 0 b 288 -2 275 -3 275 -20 b 265 -3 250 -3 250 -15 b 240 -3 225 -3 225 -10 b 215 -2 211 -1 200 0 m 300 0 b 325 0 360 0 400 0 b 391 -3 375 -3 375 -20 b 365 -3 350 -3 350 -15 b 340 -3 325 -3 325 -10 b 315 -2 311 -1 300 0 m 400 0 b 425 0 460 0 500 0 b 488 -2 475 -3 475 -20 b 465 -3 450 -3 450 -15 b 440 -3 425 -3 425 -10 b 415 -2 411 -1 400 0 m 500 0 b 525 0 560 0 600 0 b 591 -3 575 -3 575 -20 b 565 -3 550 -3 550 -15 b 540 -3 525 -3 525 -10 b 515 -2 511 -1 500 0 m 600 0 b 625 0 660 0 700 0 b 688 -2 675 -3 675 -20 b 665 -3 650 -3 650 -15 b 640 -3 625 -3 625 -10 b 615 -2 611 -1 600 0 m 700 0 b 725 0 760 0 800 0 b 791 -3 775 -3 775 -20 b 765 -3 750 -3 750 -15 b 740 -3 725 -3 725 -10 b 715 -2 711 -1 700 0 m 800 0 b 825 0 860 0 900 0 b 888 -2 875 -3 875 -20 b 865 -3 850 -3 850 -15 b 840 -3 825 -3 825 -10 b 815 -2 811 -1 800 0 m 900 0 b 925 0 960 0 1000 0 b 991 -3 975 -3 975 -20 b 965 -3 950 -3 950 -15 b 940 -3 925 -3 925 -10 b 915 -2 911 -1 900 0 m 1000 0 b 1025 0 1060 0 1100 0 b 1088 -2 1075 -3 1075 -20 b 1065 -3 1050 -3 1050 -15 b 1040 -3 1025 -3 1025 -10 b 1015 -2 1011 -1 1000 0 m 1100 0 b 1125 0 1160 0 1200 0 b 1191 -3 1175 -3 1175 -20 b 1165 -3 1150 -3 1150 -15 b 1140 -3 1125 -3 1125 -10 b 1115 -2 1111 -1 1100 0 m 1200 0 b 1225 0 1260 0 1300 0 b 1288 -2 1275 -3 1275 -20 b 1265 -3 1250 -3 1250 -15 b 1240 -3 1225 -3 1225 -10 b 1215 -2 1211 -1 1200 0 m 1300 0 b 1325 0 1360 0 1400 0 b 1391 -3 1375 -3 1375 -20 b 1365 -3 1350 -3 1350 -15 b 1340 -3 1325 -3 1325 -10 b 1315 -2 1311 -1 1300 0 m 1400 0 b 1425 0 1460 0 1500 0 b 1488 -2 1475 -3 1475 -20 b 1465 -3 1450 -3 1450 -15 b 1440 -3 1425 -3 1425 -10 b 1415 -2 1411 -1 1400 0 m 1500 0 b 1525 0 1560 0 1600 0 b 1591 -3 1575 -3 1575 -20 b 1565 -3 1550 -3 1550 -15 b 1540 -3 1525 -3 1525 -10 b 1515 -2 1511 -1 1500 0 m 1600 0 b 1625 0 1660 0 1700 0 b 1688 -2 1675 -3 1675 -20 b 1665 -3 1650 -3 1650 -15 b 1640 -3 1625 -3 1625 -10 b 1615 -2 1611 -1 1600 0 m 1700 0 b 1725 0 1760 0 1800 0 b 1791 -3 1775 -3 1775 -20 b 1765 -3 1750 -3 1750 -15 b 1740 -3 1725 -3 1725 -10 b 1715 -2 1711 -1 1700 0 m 1800 0 b 1825 0 1860 0 1900 0 b 1888 -2 1875 -3 1875 -20 b 1865 -3 1850 -3 1850 -15 b 1840 -3 1825 -3 1825 -10 b 1815 -2 1811 -1 1800 0 m 1900 0 b 1925 0 1960 0 2000 0 b 1991 -3 1975 -3 1975 -20 b 1965 -3 1950 -3 1950 -15 b 1940 -3 1925 -3 1925 -10 b 1915 -2 1911 -1 1900 0 m 2000 0 b 2025 0 2060 0 2100 0 b 2088 -2 2075 -3 2075 -20 b 2065 -3 2050 -3 2050 -15 b 2040 -3 2025 -3 2025 -10 b 2015 -2 2011 -1 2000 0 m 2100 0 b 2125 0 2160 0 2200 0 b 2191 -3 2175 -3 2175 -20 b 2165 -3 2150 -3 2150 -15 b 2140 -3 2125 -3 2125 -10 b 2115 -2 2111 -1 2100 0 m 2200 0 b 2225 0 2260 0 2300 0 b 2288 -2 2275 -3 2275 -20 b 2265 -3 2250 -3 2250 -15 b 2240 -3 2225 -3 2225 -10 b 2215 -2 2211 -1 2200 0 m 2300 0 b 2325 0 2360 0 2400 0 b 2391 -3 2375 -3 2375 -20 b 2365 -3 2350 -3 2350 -15 b 2340 -3 2325 -3 2325 -10 b 2315 -2 2311 -1 2300 0 m 2400 0 b 2425 0 2460 0 2500 0 b 2488 -2 2475 -3 2475 -20 b 2465 -3 2450 -3 2450 -15 b 2440 -3 2425 -3 2425 -10 b 2415 -2 2411 -1 2400 0 m 2500 0 b 2525 0 2560 0 2600 0 b 2591 -3 2575 -3 2575 -20 b 2565 -3 2550 -3 2550 -15 b 2540 -3 2525 -3 2525 -10 b 2515 -2 2511 -1 2500 0 m 2600 0 b 2625 0 2660 0 2700 0 b 2688 -2 2675 -3 2675 -20 b 2665 -3 2650 -3 2650 -15 b 2640 -3 2625 -3 2625 -10 b 2615 -2 2611 -1 2600 0 m 2700 0 b 2725 0 2760 0 2800 0 b 2791 -3 2775 -3 2775 -20 b 2765 -3 2750 -3 2750 -15 b 2740 -3 2725 -3 2725 -10 b 2715 -2 2711 -1 2700 0 m 2800 0 b 2825 0 2860 0 2900 0 b 2888 -2 2875 -3 2875 -20 b 2865 -3 2850 -3 2850 -15 b 2840 -3 2825 -3 2825 -10 b 2815 -2 2811 -1 2800 0 m 2900 0 b 2925 0 2960 0 3000 0 b 2991 -3 2975 -3 2975 -20 b 2965 -3 2950 -3 2950 -15 b 2940 -3 2925 -3 2925 -10 b 2915 -2 2911 -1 2900 0 m 3000 0 b 3025 0 3060 0 3100 0 b 3088 -2 3075 -3 3075 -20 b 3065 -3 3050 -3 3050 -15 b 3040 -3 3025 -3 3025 -10 b 3015 -2 3011 -1 3000 0 m 3100 0 b 3125 0 3160 0 3200 0 b 3191 -3 3175 -3 3175 -20 b 3165 -3 3150 -3 3150 -15 b 3140 -3 3125 -3 3125 -10 b 3115 -2 3111 -1 3100 0 m 3200 0 b 3225 0 3260 0 3300 0 b 3288 -2 3275 -3 3275 -20 b 3265 -3 3250 -3 3250 -15 b 3240 -3 3225 -3 3225 -10 b 3215 -2 3211 -1 3200 0 m 3300 0 b 3325 0 3360 0 3400 0 b 3391 -3 3375 -3 3375 -20 b 3365 -3 3350 -3 3350 -15 b 3340 -3 3325 -3 3325 -10 b 3315 -2 3311 -1 3300 0 m 3400 0 b 3425 0 3460 0 3500 0 b 3488 -2 3475 -3 3475 -20 b 3465 -3 3450 -3 3450 -15 b 3440 -3 3425 -3 3425 -10 b 3415 -2 3411 -1 3400 0 m 3500 0 b 3525 0 3560 0 3600 0 b 3591 -3 3575 -3 3575 -20 b 3565 -3 3550 -3 3550 -15 b 3540 -3 3525 -3 3525 -10 b 3515 -2 3511 -1 3500 0 m 3600 0 b 3625 0 3660 0 3700 0 b 3688 -2 3675 -3 3675 -20 b 3665 -3 3650 -3 3650 -15 b 3640 -3 3625 -3 3625 -10 b 3615 -2 3611 -1 3600 0 m 3700 0 b 3725 0 3760 0 3800 0 b 3791 -3 3775 -3 3775 -20 b 3765 -3 3750 -3 3750 -15 b 3740 -3 3725 -3 3725 -10 b 3715 -2 3711 -1 3700 0 m 3800 0 b 3825 0 3860 0 3900 0 b 3888 -2 3875 -3 3875 -20 b 3865 -3 3850 -3 3850 -15 b 3840 -3 3825 -3 3825 -10 b 3815 -2 3811 -1 3800 0 m 3900 0 b 3925 0 3960 0 4000 0 b 3991 -3 3975 -3 3975 -20 b 3965 -3 3950 -3 3950 -15 b 3940 -3 3925 -3 3925 -10 b 3915 -2 3911 -1 3900 0 m 4000 0 b 4025 0 4060 0 4100 0 b 4088 -2 4075 -3 4075 -20 b 4065 -3 4050 -3 4050 -15 b 4040 -3 4025 -3 4025 -10 b 4015 -2 4011 -1 4000 0 m 4100 0 b 4125 0 4160 0 4200 0 b 4191 -3 4175 -3 4175 -20 b 4165 -3 4150 -3 4150 -15 b 4140 -3 4125 -3 4125 -10 b 4115 -2 4111 -1 4100 0 m 4200 0 b 4225 0 4260 0 4300 0 b 4288 -2 4275 -3 4275 -20 b 4265 -3 4250 -3 4250 -15 b 4240 -3 4225 -3 4225 -10 b 4215 -2 4211 -1 4200 0 m 4300 0 b 4325 0 4360 0 4400 0 b 4391 -3 4375 -3 4375 -20 b 4365 -3 4350 -3 4350 -15 b 4340 -3 4325 -3 4325 -10 b 4315 -2 4311 -1 4300 0 m 4400 0 b 4425 0 4460 0 4500 0 b 4488 -2 4475 -3 4475 -20 b 4465 -3 4450 -3 4450 -15 b 4440 -3 4425 -3 4425 -10 b 4415 -2 4411 -1 4400 0 m 4500 0 b 4525 0 4560 0 4600 0 b 4591 -3 4575 -3 4575 -20 b 4565 -3 4550 -3 4550 -15 b 4540 -3 4525 -3 4525 -10 b 4515 -2 4511 -1 4500 0 m 4600 0 b 4625 0 4660 0 4700 0 b 4688 -2 4675 -3 4675 -20 b 4665 -3 4650 -3 4650 -15 b 4640 -3 4625 -3 4625 -10 b 4615 -2 4611 -1 4600 0 m 4700 0 b 4725 0 4760 0 4800 0 b 4791 -3 4775 -3 4775 -20 b 4765 -3 4750 -3 4750 -15 b 4740 -3 4725 -3 4725 -10 b 4715 -2 4711 -1 4700 0 m 4800 0 b 4825 0 4860 0 4900 0 b 4888 -2 4875 -3 4875 -20 b 4865 -3 4850 -3 4850 -15 b 4840 -3 4825 -3 4825 -10 b 4815 -2 4811 -1 4800 0 m 4900 0 b 4925 0 4960 0 5000 0 b 4991 -3 4975 -3 4975 -20 b 4965 -3 4950 -3 4950 -15 b 4940 -3 4925 -3 4925 -10 b 4915 -2 4911 -1 4900 0 m 5000 0 b 5025 0 5060 0 5100 0 b 5088 -2 5075 -3 5075 -20 b 5065 -3 5050 -3 5050 -15 b 5040 -3 5025 -3 5025 -10 b 5015 -2 5011 -1 5000 0 m 5100 0 b 5125 0 5160 0 5200 0 b 5191 -3 5175 -3 5175 -20 b 5165 -3 5150 -3 5150 -15 b 5140 -3 5125 -3 5125 -10 b 5115 -2 5111 -1 5100 0 m 5200 0 b 5225 0 5260 0 5300 0 b 5288 -2 5275 -3 5275 -20 b 5265 -3 5250 -3 5250 -15 b 5240 -3 5225 -3 5225 -10 b 5215 -2 5211 -1 5200 0 m 5300 0 b 5325 0 5360 0 5400 0 b 5391 -3 5375 -3 5375 -20 b 5365 -3 5350 -3 5350 -15 b 5340 -3 5325 -3 5325 -10 b 5315 -2 5311 -1 5300 0 m 5400 0 b 5425 0 5460 0 5500 0 b 5488 -2 5475 -3 5475 -20 b 5465 -3 5450 -3 5450 -15 b 5440 -3 5425 -3 5425 -10 b 5415 -2 5411 -1 5400 0 m 5500 0 b 5525 0 5560 0 5600 0 b 5591 -3 5575 -3 5575 -20 b 5565 -3 5550 -3 5550 -15 b 5540 -3 5525 -3 5525 -10 b 5515 -2 5511 -1 5500 0 m 5600 0 b 5625 0 5660 0 5700 0 b 5688 -2 5675 -3 5675 -20 b 5665 -3 5650 -3 5650 -15 b 5640 -3 5625 -3 5625 -10 b 5615 -2 5611 -1 5600 0 m 5700 0 b 5725 0 5760 0 5800 0 b 5791 -3 5775 -3 5775 -20 b 5765 -3 5750 -3 5750 -15 b 5740 -3 5725 -3 5725 -10 b 5715 -2 5711 -1 5700 0 m 5800 0 b 5825 0 5860 0 5900 0 b 5888 -2 5875 -3 5875 -20 b 5865 -3 5850 -3 5850 -15 b 5840 -3 5825 -3 5825 -10 b 5815 -2 5811 -1 5800 0 m 5900 0 b 5925 0 5960 0 6000 0 b 5991 -3 5975 -3 5975 -20 b 5965 -3 5950 -3 5950 -15 b 5940 -3 5925 -3 5925 -10 b 5915 -2 5911 -1 5900 0 m 6000 0 b 6025 0 6060 0 6100 0 b 6088 -2 6075 -3 6075 -20 b 6065 -3 6050 -3 6050 -15 b 6040 -3 6025 -3 6025 -10 b 6015 -2 6011 -1 6000 0 m 6100 0 b 6125 0 6160 0 6200 0 b 6191 -3 6175 -3 6175 -20 b 6165 -3 6150 -3 6150 -15 b 6140 -3 6125 -3 6125 -10 b 6115 -2 6111 -1 6100 0 m 6200 0 b 6225 0 6260 0 6300 0 b 6288 -2 6275 -3 6275 -20 b 6265 -3 6250 -3 6250 -15 b 6240 -3 6225 -3 6225 -10 b 6215 -2 6211 -1 6200 0 m 6300 0 b 6325 0 6360 0 6400 0 b 6391 -3 6375 -3 6375 -20 b 6365 -3 6350 -3 6350 -15 b 6340 -3 6325 -3 6325 -10 b 6315 -2 6311 -1 6300 0"
- l.layer = 0
- l.start_time = _lstart
- l.end_time = _lstart + 3500
- l.text = "{\\an7\\move(%.f,%.f,%.f,%.f,0,3500)\\1c&H64DCEC&\\blur1\\bord0\\fscy200\\clip(%.f,%.f,%.f,%.f)\\p1}%s" % (
- _center - 4000, _middle + 26, _center - 1000, _middle + 26,
- _lleft + 34, _ltop, _lright, _lbottom,
- sand)
-
- io.write_line(l)
-
- # postline
- l.start_time = _lend
- l.end_time = _lend + 500
- l.text = "{\\an5\\move(%.f,%.f,%.f,%.f)\\3c&H%s&\\blur2\\frz30}%s" % (_center, _middle, _center + 1300, _middle + 100, eye_color[_si%3], syl.text)
- io.write_line(l)
-
- def Princess_OPCN(line, l):
- eye_color = ["00AF50","E1E100","AF69E1"]
- if line.actor == "phase 1":
- # Main Effect - 整体特效
- l.layer = 1
- l.start_time = line.start_time + _si*30 - 200
- l.end_time = line.end_time + _si*30 + 200
- l.text = "{\\an5\\pos(%.f,%.f)\\blur2\\fad(200,200)}%s" % (_center, _middle, syl.text)
- io.write_line(l)
-
- if line.actor == "phase 2":
- # Main Effect - 整体特效
- l.layer = 1
- l.start_time = line.start_time + _si*30 - 200
- l.end_time = line.end_time + _si*30 + 200
- l.text = "{\\an5\\pos(%.f,%.f)\\3c&H%s&\\blur2\\fad(200,200)}%s" % (_center, _middle, eye_color[_si%3], syl.text)
- io.write_line(l)
-
- # 行分区判断 + 音节拆分模式
- for line in lines:
- _lstart = line.start_time
- _lend = line.end_time
- _ldur = line.end_time - line.start_time
- _lleft = line.left
- _lright = line.right
- _ltop = line.top
- _lbottom = line.bottom
- for syl in line.syls: # 音节拆分模式:简化内联变量(作全局变量使用)
- _si = syl.i
- _sstart = syl.start_time
- _send = syl.end_time
- _sdur = syl.duration
- _syln = len(line.syls)+1
- _center = syl.center
- _middle = syl.middle
- _text = syl.text
- # Generating lines - 生成字幕行
- if line.styleref.alignment == 8: # 行分区判断(OPJP)
- Princess_OPJP(line, line.copy())
- if line.styleref.alignment == 2: # 行分区判断(OPCN)
- Princess_OPCN(line, line.copy())
-
- io.save()
- io.open_aegisub()
复制代码 |
|