summaryrefslogtreecommitdiff
path: root/anim/tools
diff options
context:
space:
mode:
Diffstat (limited to 'anim/tools')
-rw-r--r--anim/tools/chart.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/anim/tools/chart.py b/anim/tools/chart.py
index 720e356..320ba90 100644
--- a/anim/tools/chart.py
+++ b/anim/tools/chart.py
@@ -57,6 +57,10 @@ motion.REGIONS.update({
"zoom": {**none, **words},
"gallery": {**beside, **words},
})
+# `cut`: the gallery is the catalogue's pages, cut from one to the next (scenes/gallery.zig: 1, 2, 3.6, 6, 8 and
+# 10.8 s), not a scene: a page's first frame changes everything at once by design.
+PAGES = {60, 120, 216, 360, 480, 648}
+motion.EXEMPT["cut"] = lambda name, t, moved: lint.scene == "gallery" and any(abs(t - p) <= 1 for p in PAGES)
_regions_for = motion.regions_for
scene = lambda video: os.path.basename(video).split("-")[0].split(".")[0]
motion.regions_for = lambda video, name: _regions_for(video, name or scene(video))
@@ -84,8 +88,17 @@ def shown(text):
text = re.sub(r"\\(.)", r"\1", text.replace("\\n", ""))
return len(text.replace("`", ""))
+# A scene that opens on the map dives (scenes/list.zig: at 2.5 s, 150 f): the falling map passes under the
+# caption, which does not change. Its frames are no caption's arrival or leaving.
+DIVES = {"list": (150, 300)}
+
_lint = motion.lint
def lint(names, counts, soft, sizes, fps, ev):
+ if lint.scene in DIVES and "caption" in names:
+ a, b = DIVES[lint.scene]
+ counts, soft = counts.copy(), soft.copy()
+ counts[a:b, names.index("caption")] = 0
+ soft[a:b, names.index("caption")] = 0
out = [line for line in _lint(names, counts, soft, sizes, fps, ev) if line != " none"]
said = captions(lint.scene) if lint.scene else None
cap = names.index("caption") if "caption" in names else None