mrmcd intro/outro
This commit is contained in:
parent
8a5913d655
commit
4c90654e39
8 changed files with 3403 additions and 0 deletions
113
mrmcd2014/__init__.py
Normal file
113
mrmcd2014/__init__.py
Normal file
|
@ -0,0 +1,113 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import svg.path, random
|
||||
from lxml import etree
|
||||
from renderlib import *
|
||||
|
||||
# URL to Schedule-XML
|
||||
scheduleUrl = 'http://fahrplan.mrmcd.net/schedule.xml'
|
||||
|
||||
def introFrames(parameters):
|
||||
title = parameters['$title']
|
||||
rnd = random.Random()
|
||||
rnd.seed(title)
|
||||
frames = 0
|
||||
|
||||
yield (
|
||||
('namesbar', 'style', 'opacity', 0),
|
||||
('title', 'text', None, ''),
|
||||
)
|
||||
|
||||
for char in range(0, len(title) + 1):
|
||||
for holdframe in range(0, rnd.randint(2, 10)):
|
||||
frames += 1
|
||||
yield (
|
||||
('title', 'text', None, title[:char]),
|
||||
)
|
||||
|
||||
frames = 4*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('namesbar', 'style', 'opacity', 1),
|
||||
)
|
||||
|
||||
def outroFrames(parameters):
|
||||
|
||||
frames = int(0.5*fps)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('license', 'style', 'opacity', 0),
|
||||
('bar1', 'style', 'opacity', 0),
|
||||
('bar2', 'style', 'opacity', 0),
|
||||
('bar3', 'style', 'opacity', 0),
|
||||
)
|
||||
|
||||
frames = int(0.5*fps)+1
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('license', 'style', 'opacity', 1),
|
||||
('bar1', 'style', 'opacity', 0),
|
||||
('bar2', 'style', 'opacity', 0),
|
||||
('bar3', 'style', 'opacity', 0),
|
||||
)
|
||||
|
||||
frames = int(0.5*fps)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('license', 'style', 'opacity', 1),
|
||||
('bar1', 'style', 'opacity', 1),
|
||||
('bar2', 'style', 'opacity', 0),
|
||||
('bar3', 'style', 'opacity', 0),
|
||||
)
|
||||
|
||||
frames = int(0.5*fps)+1
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('license', 'style', 'opacity', 1),
|
||||
('bar1', 'style', 'opacity', 1),
|
||||
('bar2', 'style', 'opacity', 1),
|
||||
('bar3', 'style', 'opacity', 0),
|
||||
)
|
||||
|
||||
frames = int(3.5*fps)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('license', 'style', 'opacity', 1),
|
||||
('bar1', 'style', 'opacity', 1),
|
||||
('bar2', 'style', 'opacity', 1),
|
||||
('bar3', 'style', 'opacity', 1),
|
||||
)
|
||||
|
||||
def debug():
|
||||
# render('intro.svg',
|
||||
# '../intro.dv',
|
||||
# introFrames,
|
||||
# {
|
||||
# '$id': 5985,
|
||||
# '$title': 'Dem Stromnetz auf die Finger geguckt',
|
||||
# '$subtitle': 'Netzfrequenz messen for fun and profit',
|
||||
# '$personnames': 'gonium'
|
||||
# }
|
||||
# )
|
||||
|
||||
render('outro.svg',
|
||||
'../outro.dv',
|
||||
outroFrames
|
||||
)
|
||||
|
||||
def tasks(queue):
|
||||
# iterate over all events extracted from the schedule xml-export
|
||||
for event in events(scheduleUrl):
|
||||
|
||||
# generate a task description and put them into the queue
|
||||
queue.put(Rendertask(
|
||||
infile = 'intro.svg',
|
||||
outfile = str(event['id'])+".dv",
|
||||
sequence = introFrames,
|
||||
parameters = {
|
||||
'$id': event['id'],
|
||||
'$title': event['title'],
|
||||
'$subtitle': event['subtitle'],
|
||||
'$personnames': event['personnames']
|
||||
}
|
||||
))
|
Loading…
Add table
Add a link
Reference in a new issue