Commit d9a48305 authored by gijs's avatar gijs

Script to generate the frames

parent ba6cbf90
......@@ -38,7 +38,8 @@ with open('timeline.inkscape.svg', 'r') as handle:
# lines = []
keypoints_layer = get_group_by_label(soup, 'keypoints')
keypoints = get_keypoints(soup)
keypoints = sorted(get_keypoints(soup), key=lambda point: point.real)
# for segment in segments:
# if isinstance(segment, Line):
......@@ -59,7 +60,11 @@ with open('timeline.inkscape.svg', 'r') as handle:
animation['transform'] = 'translate({}, {})'.format(-1 * (center.real - (width / 2)), 150)
# print(path, 'translate({}, {})'.format(center.real - (width / 2), 0))
with open('frames/{}.svg'.format(i), 'w') as o:
o.write(svg.prettify(formatter=None))
o.write(svg.prettify(formatter=None)
.replace('lineargradient', 'linearGradient')
.replace('gradienttransform', 'gradientTransform')
.replace('gradientunits', 'gradientUnits')
.replace('spreadmethod', 'spreadMethod'))
o.close()
# output = svgwrite.Drawing(filename="frames/output.svg", size=(width, height))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment