"""The demo's trailer: the main trailer's cold open, its first and last choruses and its ending, about 55 seconds, with an end card for the free demo. Same takes, same song, same grades, only less of it. py -I cut.py edl_demo.py ../../Builds/Trailer/GrassCuttersTogether_Demo_Trailer.mp4 """ import importlib.util import os from cut import Logo, Type # cut.py loads whichever edl it is given under the name "edl", so the main one is loaded here under its own name _spec = importlib.util.spec_from_file_location("edl_main", os.path.join(os.path.dirname(os.path.abspath(__file__)), "edl.py")) _main = importlib.util.module_from_spec(_spec) _spec.loader.exec_module(_main) ROLLS, SHOTS, PUNCH, SHAKE, ABERRATE, LOGO = _main.ROLLS, _main.SHOTS, _main.PUNCH, _main.SHAKE, _main.ABERRATE, _main.LOGO SFX, _TYPE = _main.SFX, _main.TYPE # cold open (the planet), the first chorus, the last chorus, the ending KEEP = [(2.2, 13.4), (22.9, 38.23), (116.1, 131.03), (147.72, 170.0)] FLASH = [(22.9, 0.5), (116.1, 0.6), (159.0, 0.7)] def REACT(t): if t < 22.9: return 0.25 if t < 38.3: return 0.6 if t < 147.7: return 0.7 if t < 159: return 0.0 return 0.4 def BLACK(t): if t < 2.7: return 1 - (t - 2.2) / 0.5 if t > 168.6: return min(1.0, (t - 168.6) / 1.2) return 0.0 TYPE = [ty for ty in _TYPE if not isinstance(ty, Logo) and ty.text not in ("WISHLIST NOW ON STEAM", "CO-OP FOR 1 TO 16 PLAYERS")] TYPE += [ Type("PLAY THE FREE DEMO", 160.6, 170.0, 84, y=0.74, how="rise"), Type("WISHLIST NOW ON STEAM", 162.0, 170.0, 54, y=0.84, how="rise", colour=(226, 240, 200)), Logo(LOGO, 159.0, 170.0, 1180, 0.38), ] SFX = [s for s in SFX if any(a <= s[0] < b for a, b in KEEP)]