Skip to content

Instantly share code, notes, and snippets.

@derchrisuk
Created August 27, 2019 14:22
Show Gist options
  • Save derchrisuk/e8a6ac437d801b5bf54594df3f9604b2 to your computer and use it in GitHub Desktop.
Save derchrisuk/e8a6ac437d801b5bf54594df3f9604b2 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import subprocess
from renderlib import *
from easing import *
def pauseFrames(params):
# 2 sec Fadein Text1
frames = 2*fps
for i in range(0, frames):
yield (
('text1', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames)),
('text2', 'style', 'opacity', 0)
)
# 2 sec Text1
frames = 2*fps
for i in range(0, frames):
yield (
('text1', 'style', 'opacity', 1),
('text2', 'style', 'opacity', 0)
)
# 2 sec Fadeout Text1
frames = 2*fps
for i in range(0, frames):
yield (
('text1', 'style', 'opacity', "%.4f" % (1-easeOutCubic(i, 0, 1, frames))),
('text2', 'style', 'opacity', 0)
)
# 2 sec blank
frames = 2*fps
for i in range(0, frames):
yield (
('text1', 'style', 'opacity', 0),
('text2', 'style', 'opacity', 0)
)
# 2 sec Fadein Text2
frames = 2*fps
for i in range(0, frames):
yield (
('text2', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames)),
('text1', 'style', 'opacity', 0)
)
# 2 sec Text2
frames = 2*fps
for i in range(0, frames):
yield (
('text2', 'style', 'opacity', 1),
('text1', 'style', 'opacity', 0)
)
# 2 sec Fadeout Text2
frames = 2*fps
for i in range(0, frames):
yield (
('text2', 'style', 'opacity', "%.4f" % (1-easeOutCubic(i, 0, 1, frames))),
('text1', 'style', 'opacity', 0)
)
# 2 sec blank
frames = 2*fps
for i in range(0, frames):
yield (
('text1', 'style', 'opacity', 0),
('text2', 'style', 'opacity', 0)
)
def tasks(queue, args, idlist, skiplist):
# place the pause-sequence into the queue
queue.put(Rendertask(
infile = 'pause.svg',
outfile = 'pause.ts',
sequence = pauseFrames
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment