guadec16: initial commit
this adds intro, pause and outro art for the guadec16 conference.
This commit is contained in:
parent
d0e466653e
commit
d5fe3abc62
4 changed files with 2017 additions and 0 deletions
174
guadec16/__init__.py
Normal file
174
guadec16/__init__.py
Normal file
|
@ -0,0 +1,174 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import subprocess
|
||||
import os.path
|
||||
from renderlib import *
|
||||
from easing import *
|
||||
|
||||
# URL to Schedule-XML
|
||||
scheduleUrl = 'https://static.gnome.org/guadec-2016/schedule.xml'
|
||||
|
||||
# For (really) too long titles
|
||||
titlemap = {
|
||||
#
|
||||
}
|
||||
|
||||
def bounce(i, min, max, frames):
|
||||
if i == frames - 1:
|
||||
return 0
|
||||
|
||||
if i <= frames/2:
|
||||
return easeInOutQuad(i, min, max, frames/2)
|
||||
else:
|
||||
return max - easeInOutQuad(i - frames/2, min, max, frames/2)
|
||||
|
||||
def introFrames(parameters):
|
||||
firstmove=2100
|
||||
move=100
|
||||
|
||||
|
||||
# 0.5 seconds blue
|
||||
frames = int(fps/2)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('fadetoblack', 'style', 'opacity', "%.4f" % easeLinear(i, 1, -1, frames-1)),
|
||||
('title', 'style', 'opacity', "0"),
|
||||
('longtitle', 'style', 'opacity', "0"),
|
||||
('presentedby', 'style', 'opacity', "0"),
|
||||
('speaker', 'style', 'opacity', "0"),
|
||||
('longspeaker', 'style', 'opacity', "0"),
|
||||
('overlay', 'style', 'opacity', "0"),
|
||||
('guadeclogo', 'style', 'opacity', "0"),
|
||||
('onhold', 'style', 'opacity', "0"),
|
||||
('onlinediscussion', 'style', 'opacity', "0"),
|
||||
)
|
||||
|
||||
# 0.5 seconds background fade in
|
||||
frames = int(fps/2)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('guadeclogo', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('overlay', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('overlay', 'attr', 'transform', 'translate(0, %.4f)' % easeOutQuad(i, firstmove, -firstmove, frames-1)),
|
||||
)
|
||||
|
||||
# 0.6 seconds still
|
||||
frames = int(fps/1.75)
|
||||
for i in range(0, frames):
|
||||
yield ()
|
||||
|
||||
# 0.2 seconds title text fade in
|
||||
frames = int(fps/5)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('title', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('longtitle', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('titletranslator', 'attr', 'transform', 'translate(0, %.4f)' % easeOutQuad(i, -move, move, frames-1)),
|
||||
)
|
||||
|
||||
# 0.2 seconds presented by text fade in
|
||||
frames = int(fps/5)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('presentedby', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('presentedby', 'attr', 'transform', 'translate(0, %.4f)' % easeOutQuad(i, -move, move, frames-1)),
|
||||
)
|
||||
# 0.2 seconds speaker/onhold text fade in
|
||||
frames = int(fps/5)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('speaker', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('longspeaker', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('speakertranslator', 'attr', 'transform', 'translate(0, %.4f)' % easeOutQuad(i, -move, move, frames-1)),
|
||||
('onhold', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
('onhold', 'attr', 'transform', 'translate(0, %.4f)' % easeOutQuad(i, -move, move, frames-1)),
|
||||
('onlinediscussion', 'style', 'opacity', "%.4f" % easeLinear(i, 0, 1, frames-1)),
|
||||
)
|
||||
|
||||
# 4 seconds still
|
||||
frames = 4*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('title', 'style', 'opacity', "1"),
|
||||
('longtitle', 'style', 'opacity', "1"),
|
||||
('presentedby', 'style', 'opacity', "1"),
|
||||
('onhold', 'style', 'opacity', "1"),
|
||||
('speaker', 'style', 'opacity', "1"),
|
||||
('longspeaker', 'style', 'opacity', "1"),
|
||||
)
|
||||
|
||||
def outroFrames(p):
|
||||
# 7 seconds of slow scaling, fade to black at the end
|
||||
frames = 7*fps
|
||||
for i in range(0, frames):
|
||||
scale = easeLinear(i, 1.3, 0.3 , frames-1)
|
||||
opacity = 0
|
||||
if i > int(frames*0.7):
|
||||
opacity = easeLinear(int(i-frames*0.7), 0, 1, int(frames-frames*0.7)-1)
|
||||
yield (
|
||||
('guadeclogoscale', 'attr', 'transform', 'scale({scale},{scale})'.format(scale=scale),),
|
||||
('fadetoblack', 'style', 'opacity', '{opac}'.format(opac=opacity),),
|
||||
)
|
||||
|
||||
# 2 seconds of black
|
||||
frames = 2*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('fadetoblack', 'style', 'opacity', "1"),
|
||||
)
|
||||
|
||||
|
||||
def debug():
|
||||
render(
|
||||
'intro.svg',
|
||||
'../intro.ts',
|
||||
introFrames,
|
||||
{
|
||||
'$title': "Long Long Long title is LONG",
|
||||
'$sub': 'Long Long Long Long subtitle is LONGER',
|
||||
'$speaker': 'Long Name of Dr. Dr. Prof. Dr. Long Long'
|
||||
}
|
||||
)
|
||||
|
||||
render(
|
||||
'pause.svg',
|
||||
'../pause.ts',
|
||||
introFrames,
|
||||
)
|
||||
|
||||
render(
|
||||
'outro.svg',
|
||||
'../outro.ts',
|
||||
outroFrames
|
||||
)
|
||||
|
||||
def tasks(queue, args):
|
||||
# iterate over all events extracted from the schedule xml-export
|
||||
for event in events(scheduleUrl):
|
||||
|
||||
if len(args) > 0:
|
||||
if not str(event['id']) in args:
|
||||
continue
|
||||
|
||||
if len(event['title']) < 71:
|
||||
params = {
|
||||
'$title': event['title'],
|
||||
'$longtitle': '',
|
||||
'$speaker': '',
|
||||
'$longspeaker': event['personnames']
|
||||
}
|
||||
else:
|
||||
params = {
|
||||
'$title': '',
|
||||
'$longtitle': event['title'],
|
||||
'$speaker': '',
|
||||
'$longspeaker': event['personnames']
|
||||
}
|
||||
|
||||
# generate a task description and put it into the queue
|
||||
queue.put(Rendertask(
|
||||
infile = 'intro.svg',
|
||||
outfile = str(event['id'])+".ts",
|
||||
sequence = introFrames,
|
||||
parameters = params
|
||||
))
|
Loading…
Add table
Add a link
Reference in a new issue