updated vcfb to current init.py

updated svg to reflect changes in init.py
This commit is contained in:
derpeter 2017-10-07 13:38:03 +02:00
parent 3da918e65a
commit 70de6f6e2e
2 changed files with 218 additions and 154 deletions

View file

@ -4,148 +4,213 @@ from renderlib import *
from easing import * from easing import *
# URL to Schedule-XML # URL to Schedule-XML
scheduleUrl = 'http://geruempel.ddns.net/schedule_voc.xml' scheduleUrl = 'http://vcfb.de/2017/schedule.xml'
# For (really) too long titles
titlemap = {
#708: "Neue WEB-Anwendungen des LGRB Baden-Württemberg im Überblick"
}
def introFrames(params):
move=40
# 0.5 Seconds
frames = int(0.5*fps)
for i in range(0, frames):
yield (
('title', 'style', 'opacity', "%.4f" % 0),
('subtitle', 'style', 'opacity', "%.4f" % 0),
('personnames', 'style', 'opacity', "%.4f" % 0),
)
# 3 Sekunde Text Fadein
frames = 3*fps
for i in range(0, frames):
yield (
('title', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 0*fps, i, 0, 1, 2*fps)),
('title', 'attr', 'transform', 'translate(%.4f, 0)' % easeDelay(easeOutQuad, 0*fps, i, -move, move, 2*fps)),
('subtitle', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 0*fps, i, 0, 1, 2*fps)),
('subtitle', 'attr', 'transform', 'translate(%.4f, 0)' % easeDelay(easeOutQuad, 0*fps, i, -move, move, 2*fps)),
('personnames', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 1*fps, i, 0, 1, 2*fps)),
('personnames', 'attr', 'transform', 'translate(%.4f, 0)' % easeDelay(easeOutQuad, 1*fps, i, -move, move, 2*fps)),
)
# 2 Sekunden stillstand
frames = 2*fps
for i in range(0, frames):
yield tuple()
# 1 Sekunde fadeout
frames = 1*fps
for i in range(0, frames):
yield (
('title', 'style', 'opacity', "%.4f" % easeLinear(i, 1, -1, frames)),
('subtitle', 'style', 'opacity', "%.4f" % easeLinear(i, 1, -1, frames)),
('personnames', 'style', 'opacity', "%.4f" % easeLinear(i, 1, -1, frames)),
)
# 0.5 Sekunden stillstand
frames = int(0.5*fps)
for i in range(0, frames):
yield (
('title', 'style', 'opacity', "%.4f" % 0),
('subtitle', 'style', 'opacity', "%.4f" % 0),
('personnames', 'style', 'opacity', "%.4f" % 0),
)
def outroFrames(params):
move=50
# 1 Sekunden stillstand
frames = 1*fps
for i in range(0, frames):
yield (
('license', 'style', 'opacity', "%.4f" % 0),
)
# 4 Sekunde Text Fadein
frames = 4*fps
for i in range(0, frames):
yield (
('license', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 0*fps, i, 0, 1, 2*fps)),
('license', 'attr', 'transform', 'translate(%.4f, 0)' % easeDelay(easeOutQuad, 0*fps, i, -move, move, 2*fps)),
)
# 2 Sekunden stillstand
frames = 2*fps
for i in range(0, frames):
yield (
('license', 'style', 'opacity', "%.4f" % 1),
)
def pauseFrames(params): def introFrames(args):
# 1 Sekunden fade down # fade in title, subtitle, persons and id
frames = 1*fps frames = 3 * fps
for i in range(0, frames): for i in range(0, frames):
yield ( yield (
('break', 'style', 'opacity', "%.4f" % easeLinear(i, 0.5, +0.5, frames)), ('title', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
) ('subtitle', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
('persons', 'style', 'opacity', easeInQuad(i, 0, 1, frames)),
)
# show whole image for 5 seconds
frames = 5 * fps
for i in range(0, frames):
yield (
('title', 'style', 'opacity', 1),
('subtitle', 'style', 'opacity', 1),
('persons', 'style', 'opacity', 1),
)
def backgroundFrames(parameters):
# 40 Sekunden
frames = 20 * fps
for i in range(0, frames):
xshift = (i + 1) * 300 / frames
yshift = ((i + 1) * (150 / frames))
yield (
('pillgroup', 'attr', 'transform', 'translate(%.4f, %.4f)' % (xshift, yshift)),
)
frames = 20 * fps
for i in range(0, frames):
xshift = 300 - ((i + 1) * (300 / frames))
yshift = 150 - ((i + 1) * (150 / frames))
yield (
('pillgroup', 'attr', 'transform', 'translate(%.4f, %.4f)' % (xshift, yshift)),
)
def outroFrames(args):
# fadein outro graphics
frames = 3 * fps
for i in range(0, frames):
yield (
('pillgroup', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('logotext', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('c3voclogo', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('c3voctext', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('bysalogo', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
('bysatext', 'style', 'opacity', easeInQuad(i, 0.01, 1, frames)),
)
frames = 3 * fps
for i in range(0, frames):
yield (
('pillgroup', 'style', 'opacity', 1),
('logotext', 'style', 'opacity', 1),
('c3voclogo', 'style', 'opacity', 1),
('c3voctext', 'style', 'opacity', 1),
('bysalogo', 'style', 'opacity', 1),
('bysatext', 'style', 'opacity', 1),
)
def pauseFrames(args):
# fade heartgroups
frames = int(0.5 * fps)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 0.25, 0.75, frames)),
)
for i in range(0, frames):
yield (
('heartgroup1', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup2', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
('heartgroup3', 'style', 'opacity', easeInQuad(i, 1, -0.75, frames)),
)
# 1 Sekunden fade up
frames = 1*fps
for i in range(0, frames):
yield (
('break', 'style', 'opacity', "%.4f" % easeLinear(i, 1, -0.5, frames)),
)
def debug(): def debug():
# render( render('intro.svg',
# 'outro.svg', '../intro.ts',
# '../outro.ts', introFrames,
# outroFrames {
# ) '$id': 7776,
'$title': 'StageWar live!',
'$subtitle': 'Metal Konzert',
'$persons': 'www.stagewar.de'
}
)
# render( render('outro.svg',
# 'pause.svg', '../outro.ts',
# '../pause.ts', outroFrames
# pauseFrames )
# )
render( render(
'intro.svg', 'background.svg',
'../intro.ts', '../background.ts',
introFrames, backgroundFrames
{ )
'$id': 904,
'$title': 'Was ist Open Source, wie funktioniert das?',
'$subtitle': 'Die Organisation der Open Geo- und GIS-Welt. Worauf man achten sollte.',
'$personnames': 'Arnulf Christl, Astrid Emde, Dominik Helle, Till Adams'
}
)
def tasks(queue, params): render('pause.svg',
# iterate over all events extracted from the schedule xml-export '../pause.ts',
for event in events(scheduleUrl, titlemap): pauseFrames
)
# generate a task description and put them into the queue
queue.put(Rendertask(
infile = 'intro.svg',
outfile = str(event['id'])+".ts",
sequence = introFrames,
parameters = {
'$id': event['id'],
'$title': event['title'],
'$subtitle': event['subtitle'],
'$personnames': event['personnames']
}
))
# place a task for the outro into the queue def tasks(queue, args, idlist, skiplist):
queue.put(Rendertask( # iterate over all events extracted from the schedule xml-export
infile = 'outro.svg', for event in events(scheduleUrl):
outfile = 'outro.ts', if event['room'] not in ('Bildungsraum'):
sequence = outroFrames print("skipping room %s (%s [%s])" % (event['room'], event['title'], event['id']))
)) continue
if not (idlist == []):
if 000000 in idlist:
print("skipping id (%s [%s])" % (event['title'], event['id']))
continue
if int(event['id']) not in idlist:
print("skipping id (%s [%s])" % (event['title'], event['id']))
continue
# generate a task description and put them into the queue
queue.put(Rendertask(
infile='intro.svg',
outfile=str(event['id']) + ".ts",
sequence=introFrames,
parameters={
'$id': event['id'],
'$title': event['title'],
'$subtitle': event['subtitle'],
'$persons': event['personnames']
}
))
# place a task for the outro into the queue
if not "out" in skiplist:
queue.put(Rendertask(
infile='outro.svg',
outfile='outro.ts',
sequence=outroFrames
))
# place the pause-sequence into the queue
if not "pause" in skiplist:
queue.put(Rendertask(
infile='pause.svg',
outfile='pause.ts',
sequence=pauseFrames
))
# place the background-sequence into the queue
if not "bg" in skiplist:
queue.put(Rendertask(
infile='background.svg',
outfile='background.ts',
sequence=backgroundFrames
))

View file

@ -14,7 +14,7 @@
viewBox="0 0 1920 1080" viewBox="0 0 1920 1080"
id="svg3532" id="svg3532"
version="1.1" version="1.1"
inkscape:version="0.91 r13725" inkscape:version="0.92.1 r15371"
inkscape:export-filename="/home/derpeter/projects/VOC/events/vcfb16/background.png" inkscape:export-filename="/home/derpeter/projects/VOC/events/vcfb16/background.png"
inkscape:export-xdpi="90" inkscape:export-xdpi="90"
inkscape:export-ydpi="90" inkscape:export-ydpi="90"
@ -43,17 +43,18 @@
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="false" showgrid="false"
units="px" units="px"
inkscape:window-width="1920" inkscape:window-width="1366"
inkscape:window-height="1004" inkscape:window-height="704"
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="24" inkscape:window-y="27"
inkscape:window-maximized="1" inkscape:window-maximized="1"
showguides="true" showguides="true"
inkscape:guide-bbox="true"> inkscape:guide-bbox="true">
<sodipodi:guide <sodipodi:guide
position="84.852814,376.18081" position="84.852814,376.18081"
orientation="1,0" orientation="1,0"
id="guide5769" /> id="guide5769"
inkscape:locked="false" />
</sodipodi:namedview> </sodipodi:namedview>
<metadata <metadata
id="metadata3537"> id="metadata3537">
@ -15524,43 +15525,41 @@
inkscape:connector-curvature="0" /> inkscape:connector-curvature="0" />
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#dcdcdc;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#dcdcdc;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="76.367538" x="76.367538"
y="217.97614" y="217.97614"
id="text5761" id="text5761"><tspan
sodipodi:linespacing="125%"><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan5763" id="tspan5763"
x="76.367538" x="76.367538"
y="217.97614" y="217.97614"
style="font-size:180px;fill:#dcdcdc" /></text> style="font-size:180px;line-height:1.25;fill:#dcdcdc"> </tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="88.166519" x="88.166519"
y="961.85254" y="961.85254"
id="personnames" id="persons"><tspan
sodipodi:linespacing="125%"><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan5767" id="tspan5767"
x="88.166519" x="88.166519"
y="961.85254" y="961.85254"
style="font-size:60px;fill:#dcdcdc;-inkscape-font-specification:'TeX Gyre Adventor';font-family:'TeX Gyre Adventor';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">$personnames</tspan></text> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:60px;line-height:1.25;font-family:'TeX Gyre Adventor';-inkscape-font-specification:'TeX Gyre Adventor';fill:#dcdcdc">$persons</tspan></text>
<flowRoot <flowRoot
xml:space="preserve" xml:space="preserve"
id="subtitle" id="subtitle"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0.01%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion
id="flowRegion5773"><rect id="flowRegion5773"><rect
id="rect5775" id="rect5775"
width="1368.9586" width="1368.9586"
height="463.86206" height="463.86206"
x="84.852814" x="84.852814"
y="443.5257" /></flowRegion><flowPara y="443.5257" /></flowRegion><flowPara
style="font-size:80px;fill:#dcdcdc" style="font-size:80px;line-height:1.25;fill:#dcdcdc"
id="flowPara7388">$subtitle</flowPara></flowRoot> <flowRoot id="flowPara7388">$subtitle</flowPara></flowRoot> <flowRoot
xml:space="preserve" xml:space="preserve"
id="title" id="title"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;line-height:125%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0.01%;font-family:Umpush;-inkscape-font-specification:Umpush;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion
id="flowRegion5781"><rect id="flowRegion5781"><rect
id="rect5783" id="rect5783"
width="1801.708" width="1801.708"
@ -15568,8 +15567,8 @@
x="84.852814" x="84.852814"
y="115.50635" y="115.50635"
style="font-size:90px" /></flowRegion><flowPara style="font-size:90px" /></flowRegion><flowPara
style="font-size:125px;fill:#d3d3d3;-inkscape-font-specification:'TeX Gyre Adventor';font-family:'TeX Gyre Adventor';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:125px;line-height:1.25;font-family:'TeX Gyre Adventor';-inkscape-font-specification:'TeX Gyre Adventor';fill:#d3d3d3"
id="flowPara27326">$title</flowPara><flowPara id="flowPara27326">$title</flowPara><flowPara
style="font-size:125px;fill:#d3d3d3" style="font-size:125px;line-height:1.25;fill:#d3d3d3"
id="flowPara7385" /></flowRoot> </g> id="flowPara7385"> </flowPara></flowRoot> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB