Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
work.contour
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
osp
work.contour
Commits
bc8ba1cb
Commit
bc8ba1cb
authored
Apr 24, 2019
by
gijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated animation hollands kabinet
parent
511d050e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1496 additions
and
19952 deletions
+1496
-19952
communication/animation/1920x1080-weekend2-sara-sejin-chang/1920x1080-hollands-kabinet-sara-sejing-chang.mp4
...in-chang/1920x1080-hollands-kabinet-sara-sejing-chang.mp4
+0
-0
communication/animation/1920x1080-weekend2-sara-sejin-chang/1920x1080.mp4
...imation/1920x1080-weekend2-sara-sejin-chang/1920x1080.mp4
+0
-0
communication/animation/digital-city-poster-weekend2-sara-sejin-chang-1920x1080.svg
...gital-city-poster-weekend2-sara-sejin-chang-1920x1080.svg
+1464
-19947
communication/animation/make-frames-weekend2.py
communication/animation/make-frames-weekend2.py
+32
-5
No files found.
communication/animation/1920x1080-weekend2-sara-sejin-chang/1920x1080-hollands-kabinet-sara-sejing-chang.mp4
0 → 100644
View file @
bc8ba1cb
File added
communication/animation/1920x1080-weekend2-sara-sejin-chang/1920x1080.mp4
deleted
100644 → 0
View file @
511d050e
File deleted
communication/animation/digital-city-poster-weekend2-sara-sejin-chang-1920x1080.svg
View file @
bc8ba1cb
This diff is collapsed.
Click to expand it.
communication/animation/make-frames-weekend2.py
View file @
bc8ba1cb
...
...
@@ -12,8 +12,8 @@ sources = [
]
fps
=
25
still
=
[
0
,
3
]
transition
=
[.
75
,
.
5
]
still
=
[
0
,
2
,
5
,
5
,
5
,
5
,
2
,
3.5
,
0
]
transition
=
[.
6
,
.
5
,
.
5
,
.
5
,
.
5
,
.
5
,
.
5
,
.
6
]
def
parse_viewbox
(
viewboxstring
):
pattern
=
re
.
compile
(
r'(-?[\d\.]+) (-?[\d\.]+) (-?[\d\.]+) (-?[\d\.]+)'
)
...
...
@@ -56,11 +56,14 @@ def write_frame(f, svg, folder = ''):
with
open
(
os
.
path
.
join
(
folder
,
'{:05d}.svg'
.
format
(
f
)),
'w'
)
as
o
:
o
.
write
(
svg
.
prettify
(
formatter
=
None
)
.
replace
(
'lineargradient'
,
'linearGradient'
)
.
replace
(
'radialgradient'
,
'radialGradient'
)
.
replace
(
'gradienttransform'
,
'gradientTransform'
)
.
replace
(
'gradientunits'
,
'gradientUnits'
)
.
replace
(
'spreadmethod'
,
'spreadMethod'
)
.
replace
(
'viewbox'
,
'viewBox'
)
.
replace
(
'flowroot'
,
'flowRoot'
)
.
replace
(
'flowpara'
,
'flowPara'
)
.
replace
(
'flowregion'
,
'flowRegion'
)
.
replace
(
'textpath'
,
'textPath'
)
.
replace
(
'startoffset'
,
'startOffset'
)
.
replace
(
'spreadmethod'
,
'spreadMethod'
)
...
...
@@ -81,6 +84,8 @@ for drawing, target in sources:
keypoints_layer
=
get_group_by_label
(
soup
,
'keypoints'
)
keypoints
=
sorted
(
get_keypoints
(
soup
),
key
=
lambda
point
:
point
.
real
)
get_group_by_label
(
svg
,
'sticky_title_ghost'
).
extract
()
animation
=
get_group_by_label
(
soup
,
'animation'
)
translation
=
get_translation
(
animation
)
...
...
@@ -91,24 +96,46 @@ for drawing, target in sources:
for
k
,
center
in
enumerate
(
keypoints
):
if
k
>
0
:
# Generate transition
for
i
in
range
(
framecount
(
transition
[
min
(
k
,
len
(
transition
)
-
1
)])):
t
=
i
/
float
(
framecount
(
transition
[
min
(
k
,
len
(
transition
)
-
1
)]))
d
=
keypoints
[
k
].
real
-
keypoints
[
k
-
1
].
real
x
=
translation
[
0
]
-
keypoints
[
k
-
1
].
real
-
(
t
*
d
)
+
(
float
(
width
)
/
2
)
y
=
translation
[
1
]
animation
[
'transform'
]
=
'translate({}, {})'
.
format
(
x
,
y
)
if
k
>
2
and
k
<
6
:
# Compensate the movement of the animated layer to
# make the title 'stick' in its position
get_group_by_label
(
svg
,
'sticky_title'
)[
'transform'
]
=
'translate({},{})'
.
format
(
sticky_x
-
x
,
sticky_y
-
y
)
get_group_by_label
(
svg
,
'text'
)[
'style'
]
=
'display:none;visibility:hidden;'
write_frame
(
f
,
svg
,
folder
=
os
.
path
.
join
(
target
,
'svg'
))
f
+=
1
for
i
in
range
(
framecount
(
still
[
min
(
k
,
len
(
still
)
-
1
)])):
if
framecount
(
still
[
min
(
k
,
len
(
still
)
-
1
)])
>
0
:
# Generate still frames
x
=
translation
[
0
]
+
(
-
1
*
(
center
.
real
-
(
float
(
width
)
/
2
)))
y
=
translation
[
1
]
if
k
>
2
and
k
<
6
:
# Compensate the movement of the animated layer to
# make the title 'stick' in its position
get_group_by_label
(
svg
,
'sticky_title'
)[
'transform'
]
=
'translate({},{})'
.
format
(
sticky_x
-
x
,
sticky_y
-
y
)
animation
[
'transform'
]
=
'translate({}, {})'
.
format
(
x
,
y
)
get_group_by_label
(
svg
,
'text'
)[
'style'
]
=
'display:inline;visibility:visible;'
write_frame
(
f
,
svg
,
folder
=
os
.
path
.
join
(
target
,
'svg'
))
f
+=
1
for
i
in
range
(
framecount
(
still
[
min
(
k
,
len
(
still
)
-
1
)])):
write_frame
(
f
,
svg
,
folder
=
os
.
path
.
join
(
target
,
'svg'
))
f
+=
1
# print(path, 'translate({}, {})'.format(center.real - (width / 2), 0))
if
k
==
2
:
# Title hollands kabinet from frame 2 needs to stick untill
# frame 5
sticky_x
=
translation
[
0
]
sticky_y
=
translation
[
1
]
# output = svgwrite.Drawing(filename="frames/output.svg", size=(width, height))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment