After Dark and Horror block ident previews (Batch 2) for review
Five previews from the channels' own Blender scenes; channel assets unchanged. Not in the app. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@@ -0,0 +1,217 @@
|
||||
"""Block idents built on the channels' own 3D scenes: After Dark's night city and Horror's house under the blood moon.
|
||||
|
||||
blender -b -P build_block_ident.py -- <block> <out folder> [frame ...]
|
||||
|
||||
Reuses build_3d_ident.py's scene builders without changing it: everything above its scene list runs as is,
|
||||
then each block adds its own pieces and a short camera move that settles on (or near) the channel's final view.
|
||||
Renders frame_%04d.png up to the last frame that moves (the compositor holds it), and points.json: where the
|
||||
moon, the drive-in screen and the lit window land on screen, so the 2D titles and effects line up exactly.
|
||||
"""
|
||||
import bpy, json, math, os, random, sys
|
||||
from pathlib import Path
|
||||
from mathutils import Vector
|
||||
from bpy_extras.object_utils import world_to_camera_view
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
args = sys.argv[sys.argv.index('--') + 1:]
|
||||
BLOCK, BLOCK_OUT, BLOCK_FRAMES = args[0], args[1], [int(a) for a in args[2:]]
|
||||
source = (HERE / 'build_3d_ident.py').read_text()
|
||||
SCENE_FOR = {'presents': 'orbit-after-dark', 'bmovie': 'orbit-after-dark', 'cult': 'orbit-after-dark', 'drivein': 'orbit-after-dark', 'slasher': 'orbit-horror'}
|
||||
# Run the shared builders and render settings: the prefix reads sys.argv for its own scene and folder.
|
||||
sys.argv = [sys.argv[0], '--', SCENE_FOR[BLOCK], BLOCK_OUT]
|
||||
exec(compile(source[:source.index("\nif SCENE == 'orbit-1':")], 'build_3d_ident.py', 'exec'))
|
||||
|
||||
FPS, MOVE = 30, int(os.environ.get('MOVE_FRAMES', 96)) # 30 fps like the app; 3D motion ends at MOVE, then the frame is held
|
||||
scene.render.fps = FPS
|
||||
scene.frame_start, scene.frame_end = 1, MOVE
|
||||
scene.cycles.samples = int(os.environ.get('SAMPLES', 48))
|
||||
|
||||
|
||||
def keys(obj, path, frames, index=-1):
|
||||
for frame, value in frames:
|
||||
setattr(obj, path, value) if index < 0 else getattr(obj, path).__setitem__(index, value)
|
||||
obj.keyframe_insert(path, frame=frame, index=index)
|
||||
|
||||
|
||||
def socket_keys(socket, frames, linear=False):
|
||||
for frame, value in frames:
|
||||
socket.default_value = value; socket.keyframe_insert('default_value', frame=frame)
|
||||
|
||||
|
||||
def ease_hold(obj):
|
||||
"""Smooth ease in and out on every key, and nothing after the last one."""
|
||||
action = obj.animation_data.action
|
||||
curves = action.layers[0].strips[0].channelbag(obj.animation_data.action_slot).fcurves if hasattr(action, 'layers') else action.fcurves
|
||||
for curve in curves:
|
||||
for point in curve.keyframe_points:
|
||||
point.interpolation = 'BEZIER'; point.handle_left_type = point.handle_right_type = 'AUTO_CLAMPED'
|
||||
|
||||
|
||||
points = {}
|
||||
|
||||
|
||||
def track(name, obj_or_point, radius=0):
|
||||
points[name] = (obj_or_point, radius)
|
||||
|
||||
|
||||
def after_dark_city():
|
||||
global world_tint
|
||||
world_tint = ('#1A2868', '#5A2A90')
|
||||
stars_world()
|
||||
city('#E84CCB')
|
||||
return bpy.data.objects['flare']
|
||||
|
||||
|
||||
if BLOCK in ('presents', 'bmovie', 'cult'):
|
||||
moon = after_dark_city()
|
||||
# The channel's own last view, reached by a short settle from slightly lower and further back.
|
||||
camera_path([(1, (2, 84, 40), (12, 400, 92)), (MOVE - 6, (4, 98, 45), (12, 400, 96)), (MOVE, (4, 98, 45), (12, 400, 96))], lens=26)
|
||||
track('moon', moon.location.copy(), 30)
|
||||
if BLOCK == 'presents':
|
||||
# The projector beam: a soft shaft opening from the moon, down and across the skyline.
|
||||
shaft = beam('projector', tuple(moon.location), 460, 90, '#DCD6FF', 1.1, aim=(-170, 260, 30), narrow=.06)
|
||||
shaft.scale = (.02, .02, .02); keys(shaft, 'scale', [(18, (.02, .02, .02)), (60, (1, 1, 1))]); ease_hold(shaft)
|
||||
if BLOCK == 'bmovie':
|
||||
# A toy flying saucer on a visible wire, swinging across the moon and coming to rest beside it.
|
||||
tin, n, l = material('tin'); bsdf = n['Principled BSDF']; bsdf.inputs['Base Color'].default_value = hexrgb('#B8C0D0'); bsdf.inputs['Metallic'].default_value = .4; bsdf.inputs['Roughness'].default_value = .38
|
||||
bsdf.inputs['Emission Color'].default_value = hexrgb('#8E98B0'); bsdf.inputs['Emission Strength'].default_value = .35 # painted tin that reads against the night
|
||||
dome, n, l = material('dome'); bsdf = n['Principled BSDF']; bsdf.inputs['Base Color'].default_value = hexrgb('#9FE8C8'); bsdf.inputs['Roughness'].default_value = .1
|
||||
bsdf.inputs['Emission Color'].default_value = hexrgb('#7CFFB0'); bsdf.inputs['Emission Strength'].default_value = 1.2
|
||||
lights = glowing('saucerlights', '#FFE27A', 12)
|
||||
wire, n, l = material('wire'); bsdf = n['Principled BSDF']; bsdf.inputs['Base Color'].default_value = hexrgb('#D8DCE6'); bsdf.inputs['Roughness'].default_value = .4
|
||||
pivot = bpy.data.objects.new('pivot', None); bpy.context.collection.objects.link(pivot)
|
||||
# It comes to rest just right of the moon, close to the camera so it reads at moon size; the wire's top is out of frame.
|
||||
cam_at = Vector((4, 98, 45)); towards = (moon.location - cam_at).normalized()
|
||||
rest = cam_at + towards * 80 + Vector((13, 0, 3))
|
||||
pivot.location = rest + Vector((0, 0, 40))
|
||||
body = sphere('saucer', 8.5, 64); body.scale = (1, 1, .26); body.data.materials.append(tin)
|
||||
cap = sphere('cap', 3.6, 48); cap.location = (0, 0, 1.2); cap.data.materials.append(dome); cap.parent = body
|
||||
for i in range(10):
|
||||
a = i / 10 * math.tau
|
||||
bulb = sphere(f'bulb{i}', .75, 16); bulb.location = (math.cos(a) * 8, math.sin(a) * 8, -.1); bulb.data.materials.append(lights); bulb.parent = body
|
||||
body.parent = pivot; body.location = (0, 0, -40)
|
||||
bpy.ops.mesh.primitive_cylinder_add(vertices=8, radius=.06, depth=40, location=(0, 0, -20)); string = bpy.context.active_object
|
||||
string.data.materials.append(wire); string.parent = pivot
|
||||
body.rotation_euler = (0, math.radians(8), 0)
|
||||
# The swing: wide, then smaller, then at rest, a little tilted. Wobble on its string as it goes.
|
||||
swing = [(1, 38), (22, -30), (42, 20), (60, -11), (75, 5), (MOVE - 8, -1.5), (MOVE, -1.5)]
|
||||
keys(pivot, 'rotation_euler', [(f, (0, math.radians(d), 0)) for f, d in swing]); ease_hold(pivot)
|
||||
# Paul, 3 November: it wobbles, nearly slips off its string, then awkwardly straightens itself just as the
|
||||
# title appears (1.9 s, frame 57): a lurch to a steep tilt with a small drop, then jerky corrections to rest.
|
||||
tilt = lambda f, x, y, z: (f, (math.radians(x), math.radians(y), z))
|
||||
keys(body, 'rotation_euler', [tilt(1, 0, 14, 0), tilt(22, 4, -7, .2), tilt(38, -3, 6, .35), tilt(46, 2, 10, .4), tilt(52, 6, 36, .45),
|
||||
tilt(57, 5, 34, .47), tilt(61, -2, -9, .5), tilt(65, 1, 6, .52), tilt(69, 0, 1, .54), tilt(MOVE, 0, 3, .55)]); ease_hold(body)
|
||||
keys(body, 'location', [(1, (0, 0, -40)), (46, (0, 0, -40)), (52, (.6, 0, -41.6)), (57, (.7, 0, -41.8)), (62, (.2, 0, -40.4)), (MOVE, (0, 0, -40.6))]); ease_hold(body)
|
||||
track('saucer', body, 6)
|
||||
data = bpy.data.lights.new('toylight', 'POINT'); data.energy = 60000; data.color = hexrgb('#E8E4FF')[:3]
|
||||
toylight = bpy.data.objects.new('toylight', data); bpy.context.collection.objects.link(toylight); toylight.location = rest + Vector((-20, -40, 25))
|
||||
if BLOCK == 'cult':
|
||||
# The eye is drawn over the moon in 2D; the moon itself dims a little so the eye's white reads.
|
||||
pass
|
||||
|
||||
elif BLOCK == 'drivein':
|
||||
# The Midnight Drive-In: a car park on the city's edge, rows of parked cars, one outdoor screen and a lit marquee.
|
||||
# Nothing like OrbitOffice's Drive-In: no curtains, no auditorium; outdoors, under the After Dark sky.
|
||||
world_tint = ('#1A2868', '#5A2A90')
|
||||
stars_world()
|
||||
flare((-150, 900, 260), 34, '#E8E4F5', 1.5)
|
||||
asphalt, n, l = material('asphalt'); bsdf = n['Principled BSDF']; bsdf.inputs['Base Color'].default_value = hexrgb('#07080E'); bsdf.inputs['Roughness'].default_value = .35; bsdf.inputs['Metallic'].default_value = .2
|
||||
box('lot', 0, 150, 900, 900, .1, asphalt, -.1)
|
||||
wall = window_wall('#242E58', 1.6, ('#FF9A4A', '#FFD27A', '#9AC8FF'), .14, (1.1, 1.7))
|
||||
rng = random.Random(7)
|
||||
for x in range(-420, 420, 30):
|
||||
box(f'skyline{x}', x + rng.uniform(-6, 6), 520 + rng.uniform(0, 80), rng.uniform(20, 34), 26, rng.uniform(40, 150), wall)
|
||||
# The screen on two steel legs, lit from behind: dark first, then one flicker on, then steady.
|
||||
steel = stone('steel', '#1A1C26', .6, .6)
|
||||
sx, sy, sz, sw, sh = 0, 150, 12, 64, 30
|
||||
for side in (-1, 1):
|
||||
box(f'leg{side}', side * sw * .36, sy + 1.5, 1.6, 1.6, sz, steel)
|
||||
box('frame', sx, sy + 1, sw + 2.4, 1.2, sh + 2.4, steel, sz - 1.2)
|
||||
screen_mat, n, l = material('screen'); out = n['Material Output']; n.remove(n['Principled BSDF'])
|
||||
emit = n.new('ShaderNodeEmission'); emit.inputs['Color'].default_value = hexrgb('#C9D2FF'); l.new(emit.outputs[0], out.inputs['Surface'])
|
||||
socket_keys(emit.inputs['Strength'], [(1, .05), (30, .05), (34, 2.2), (37, .9), (41, 2.6), (MOVE, 2.6)])
|
||||
screen = box('screen', sx, sy - .2, sw, .3, sh, screen_mat, sz)
|
||||
# The marquee under the screen: a lit panel framed by bulbs that come on in a run, left to right.
|
||||
panel = box('marquee', sx, sy - 4, sw * .78, 1, 6, glowing('panel', '#FFF1C8', 1.6), 2.6)
|
||||
for i, x in enumerate([sx - sw * .39 + j * sw * .78 / 31 for j in range(32)]):
|
||||
for z in (2.2, 9.0):
|
||||
bulb = sphere(f'bulb{i}{z}', .32, 12); bulb.location = (x, sy - 4.7, z)
|
||||
m = glowing(f'bulb{i}{z}', '#FFC86A', 0); bulb.data.materials.append(m)
|
||||
socket_keys(m.node_tree.nodes['Emission'].inputs['Strength'], [(1, 0), (44 + i, 0), (47 + i, 14)])
|
||||
# Rows of parked cars seen from behind, dark shapes with a little rim light from the screen.
|
||||
paint, n, l = material('paint'); bsdf = n['Principled BSDF']; bsdf.inputs['Base Color'].default_value = hexrgb('#0C0D16'); bsdf.inputs['Roughness'].default_value = .25; bsdf.inputs['Metallic'].default_value = .6
|
||||
tail = glowing('tail', '#FF3048', 1.2)
|
||||
for row, y in enumerate((52, 78, 104)):
|
||||
for col in range(-5, 6):
|
||||
x = col * 11 + (row % 2) * 5 + rng.uniform(-1.2, 1.2)
|
||||
if abs(x) < 4 and row == 0:
|
||||
continue # an aisle, so the screen reads down the middle
|
||||
box(f'car{row}{col}', x, y, 5.2, 10, 1.5, paint, .5)
|
||||
box(f'cab{row}{col}', x, y + .6, 4.4, 5, 1.2, paint, 2)
|
||||
for side in (-1, 1):
|
||||
box(f'tl{row}{col}{side}', x + side * 2.1, y - 5.02, .7, .05, .3, tail, 1.3)
|
||||
data = bpy.data.lights.new('screenlight', 'AREA'); data.energy = 30000; data.size = 60; data.color = hexrgb('#C9D2FF')[:3]
|
||||
light = bpy.data.objects.new('screenlight', data); bpy.context.collection.objects.link(light); light.location = (0, sy - 2, sz + 15); light.rotation_euler = (math.radians(90), 0, 0)
|
||||
socket_keys_light = lambda frames: [setattr(data, 'energy', v) or data.keyframe_insert('energy', frame=f) for f, v in frames]
|
||||
socket_keys_light([(1, 0), (30, 0), (34, 24000), (37, 9000), (41, 30000)])
|
||||
camera_path([(1, (-4, -6, 3.5), (0, 150, 14)), (MOVE - 6, (0, 2, 9), (0, 150, 22)), (MOVE, (0, 2, 9), (0, 150, 22))], lens=28)
|
||||
track('screen', screen); track('marquee', panel); track('moon', Vector((-150, 900, 260)), 34)
|
||||
|
||||
elif BLOCK == 'slasher':
|
||||
haunted()
|
||||
# The house goes quiet: its windows stop flickering and sit low and dull, except one upstairs.
|
||||
windows = bpy.data.materials['windows']
|
||||
windows.node_tree.animation_data_clear()
|
||||
windows.node_tree.nodes['Emission'].inputs['Strength'].default_value = .35
|
||||
hx, hy = 16, 30
|
||||
front = hy - 5.6
|
||||
lit = glowing('upstairs', '#FF7A4A', 0)
|
||||
socket_keys(lit.node_tree.nodes['Emission'].inputs['Strength'], [(1, 0), (14, 0), (26, 9), (70, 9), (82, 0)])
|
||||
wx = hx - 6 # the left upstairs window: clear of the trees from this side
|
||||
pane = box('upstairs', wx, front - .08, 1.7, .1, 2.6, lit, 7)
|
||||
# A plain figure, head and shoulders, crossing behind the glass while the light is on.
|
||||
shade = glowing('shade', '#000000', 0)
|
||||
figure = [[(-.5, 0), (.5, 0), (.48, .55), (.3, .78), (.16, .82), (.18, 1.15), (0, 1.3), (-.18, 1.15), (-.16, .82), (-.3, .78), (-.48, .55)]]
|
||||
person = flat('figure', figure, (wx - 2.6, front - .14, 7.1), (wx - 2.6, front - 10, 7.1), shade)
|
||||
person.scale = (1.3, 1, 1.3)
|
||||
# It walks in, stops in the window for a moment, then walks on.
|
||||
keys(person, 'location', [(1, (wx - 2.6, front - .14, 7.1)), (32, (wx - 2.6, front - .14, 7.1)), (44, (wx, front - .14, 7.1)), (54, (wx, front - .14, 7.1)), (66, (wx + 2.6, front - .14, 7.1))])
|
||||
camera_path([(1, (7, -13, 3), (14, 30, 13)), (MOVE - 6, (10, -6, 3.6), (17, 30, 14)), (MOVE, (10, -6, 3.6), (17, 30, 14))], lens=30) # off to the side, so the blood moon clears the roof
|
||||
track('window', pane)
|
||||
track('moon', bpy.data.objects['moon'], 26)
|
||||
else:
|
||||
raise SystemExit('unknown block')
|
||||
|
||||
|
||||
def screen_points():
|
||||
"""Each tracked thing's corners (or centre and radius) in 1280x720 pixels, at every frame."""
|
||||
out = {}
|
||||
cam = scene.camera
|
||||
for frame in range(1, MOVE + 1):
|
||||
scene.frame_set(frame)
|
||||
here = {}
|
||||
for name, (thing, radius) in points.items():
|
||||
if isinstance(thing, Vector):
|
||||
centre = world_to_camera_view(scene, cam, thing)
|
||||
edge = world_to_camera_view(scene, cam, thing + Vector((radius, 0, 0)))
|
||||
here[name] = dict(x=centre.x * 1280, y=(1 - centre.y) * 720, r=abs(edge.x - centre.x) * 1280)
|
||||
else:
|
||||
corners = [thing.matrix_world @ Vector(c) for c in thing.bound_box]
|
||||
xy = [world_to_camera_view(scene, cam, c) for c in corners]
|
||||
xs, ys = [p.x * 1280 for p in xy], [(1 - p.y) * 720 for p in xy]
|
||||
here[name] = dict(left=min(xs), right=max(xs), top=min(ys), bottom=max(ys))
|
||||
out[frame] = here
|
||||
return out
|
||||
|
||||
|
||||
Path(BLOCK_OUT).mkdir(parents=True, exist_ok=True)
|
||||
(Path(BLOCK_OUT) / 'points.json').write_text(json.dumps(screen_points(), indent=0))
|
||||
if BLOCK_FRAMES:
|
||||
for frame in BLOCK_FRAMES:
|
||||
scene.frame_set(frame)
|
||||
scene.render.filepath = f'{BLOCK_OUT}/still_{frame:04d}.png'
|
||||
bpy.ops.render.render(write_still=True)
|
||||
else:
|
||||
scene.render.filepath = f'{BLOCK_OUT}/frame_'
|
||||
scene.frame_start = int(os.environ.get('START_FRAME', 1))
|
||||
bpy.ops.render.render(animation=True)
|
||||
@@ -0,0 +1,474 @@
|
||||
#!/usr/bin/env python3
|
||||
"""After Dark and Horror block idents, Batch 2 previews for Paul's review (3 November 2026 brief).
|
||||
|
||||
The 3D comes from blender/build_block_ident.py (the channels' own scenes, with each block's additions); this lays
|
||||
the sharp 2D on top, as compose_ident.sh does for the channel idents: the channel logo, the After Dark Presents
|
||||
frame, each event's title, the eye in the moon, the ticket, the film weave, and an original quiet sting.
|
||||
The channel logos and scenes are read only. Writes orbit-after-dark-blocks/ and orbit-horror-blocks/.
|
||||
|
||||
build-dark-blocks.py <blender-blocks folder> [presents|bmovie|drivein|cult|slasher] ...
|
||||
"""
|
||||
from pathlib import Path
|
||||
import importlib.util, json, math, random, shutil, subprocess, sys
|
||||
from PIL import Image, ImageChops, ImageDraw, ImageFilter, ImageFont
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
ROOT = HERE.parent.parent
|
||||
spec = importlib.util.spec_from_file_location('riot', HERE / 'build-riot-blocks.py')
|
||||
riot = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(riot)
|
||||
kf, ease_out, ease_in, ease_io, glow, fade, tint = riot.kf, riot.ease_out, riot.ease_in, riot.ease_io, riot.glow, riot.fade, riot.tint
|
||||
|
||||
DESIGNS = Path('/home/pauljd/Documents/Codex/2026-10-31/referenced-chatgpt-conversation-this-is-an/Orbit-Channel-Designs')
|
||||
FONTS = ROOT / '.tooling/font-data/fonts'
|
||||
W, H, FPS, LENGTH, MOVE = 1280, 720, 30, 4.0, 96
|
||||
SILVER, PINK, GREEN, RED, CREAM, INK = (226, 230, 245), (232, 76, 203), (156, 255, 58), (242, 78, 87), (246, 236, 212), (12, 10, 18)
|
||||
|
||||
BLOCKS = {
|
||||
'presents': dict(title='After Dark Presents', folder='orbit-after-dark-blocks/after-dark-presents', channel='orbit-after-dark'),
|
||||
'bmovie': dict(title='B-Movie Throwbacks', folder='orbit-after-dark-blocks/b-movie-throwbacks', channel='orbit-after-dark'),
|
||||
'drivein': dict(title='After Dark Presents: The Midnight Drive-In', folder='orbit-after-dark-blocks/the-midnight-drive-in', channel='orbit-after-dark'),
|
||||
'cult': dict(title='Cult Classics', folder='orbit-after-dark-blocks/cult-classics', channel='orbit-after-dark'),
|
||||
'slasher': dict(title='Slasher Saturday', folder='orbit-horror-blocks/slasher-saturday', channel='orbit-horror'),
|
||||
}
|
||||
|
||||
|
||||
def font(name, size):
|
||||
return ImageFont.truetype(str(FONTS / name), size)
|
||||
|
||||
|
||||
def text_layer(words, face, fill, spacing=0, stroke=0, stroke_fill=None):
|
||||
"""Words on their own transparent layer, tight to the letters, with optional letter spacing."""
|
||||
widths = [face.getbbox(c)[2] for c in words]
|
||||
width = sum(widths) + spacing * (len(words) - 1) + 2 * stroke + 8
|
||||
asc, desc = face.getmetrics()
|
||||
layer = Image.new('RGBA', (int(width), asc + desc + 2 * stroke + 8))
|
||||
d, x = ImageDraw.Draw(layer), stroke + 4
|
||||
for c, w in zip(words, widths):
|
||||
d.text((x, stroke + 4), c, font=face, fill=fill, stroke_width=stroke, stroke_fill=stroke_fill)
|
||||
x += w + spacing
|
||||
return layer.crop(layer.getbbox())
|
||||
|
||||
|
||||
def place(canvas, layer, x, y, alpha=1.0, anchor='lt'):
|
||||
if layer is None or alpha <= 0:
|
||||
return
|
||||
if anchor == 'mt':
|
||||
x -= layer.width / 2
|
||||
if alpha < 1:
|
||||
layer = fade(layer, alpha)
|
||||
canvas.alpha_composite(layer, (round(x), round(y)))
|
||||
|
||||
|
||||
def scaled(layer, sx, sy=None, rot=0):
|
||||
sy = sx if sy is None else sy
|
||||
out = layer.resize((max(1, round(layer.width * sx)), max(1, round(layer.height * sy))), Image.LANCZOS)
|
||||
return out.rotate(rot, Image.BICUBIC, expand=True) if rot else out
|
||||
|
||||
|
||||
class Block:
|
||||
def __init__(self, key, frames):
|
||||
self.key, self.cfg, self.frames = key, BLOCKS[key], Path(frames) / key
|
||||
self.points = json.loads((self.frames / 'points.json').read_text())
|
||||
logo = Image.open(DESIGNS / self.cfg['channel'] / 'exports' / f"{self.cfg['channel'].replace('-', '_')}_primary.png").convert('RGBA')
|
||||
self.logo = logo.crop(logo.getbbox())
|
||||
self.cache = {}
|
||||
|
||||
def scene(self, t):
|
||||
n = min(MOVE, max(1, int(t * FPS) + 1))
|
||||
if n not in self.cache:
|
||||
self.cache = {n: Image.open(self.frames / f'frame_{n:04d}.png').convert('RGBA')}
|
||||
return self.cache[n].copy(), self.points[str(n)]
|
||||
|
||||
def logo_at(self, width):
|
||||
key = ('logo', width)
|
||||
if key not in self.cache:
|
||||
self.cache[key] = scaled(self.logo, width / self.logo.width)
|
||||
return self.cache[key]
|
||||
|
||||
def shadowed(self, layer, amount=.8, blur=14):
|
||||
"""A soft dark shadow under a layer, as the channel ident does over a busy city."""
|
||||
shade = Image.new('RGBA', layer.size, (0, 0, 0, 0))
|
||||
shade.putalpha(layer.getchannel('A').point(lambda v: round(v * amount)))
|
||||
pad = blur * 3
|
||||
out = Image.new('RGBA', (layer.width + 2 * pad, layer.height + 2 * pad))
|
||||
out.alpha_composite(shade, (pad, pad))
|
||||
out = out.filter(ImageFilter.GaussianBlur(blur))
|
||||
out.alpha_composite(layer, (pad, pad))
|
||||
return out, pad
|
||||
|
||||
def frame(self, t):
|
||||
canvas, pts = self.scene(t)
|
||||
getattr(self, f'draw_{self.key}')(canvas, pts, t)
|
||||
out = Image.new('RGBA', (W, H), (0, 0, 0, 255))
|
||||
out.alpha_composite(canvas)
|
||||
return fade_in(out, t)
|
||||
|
||||
# ---- After Dark Presents: the shared frame ------------------------------------------------------------------
|
||||
def after_dark_frame(self, canvas, t, start=1.0, presents=True):
|
||||
"""The logo, then PRESENTS in thin, wide silver capitals that draw together, then a fine rule."""
|
||||
logo = self.logo_at(720)
|
||||
shadowed, pad = self.cache.setdefault('logo_shadow', self.shadowed(logo))
|
||||
place(canvas, shadowed, 70 - pad, 54 - pad, kf(t, [(start, 0), (start + .5, 1)], ease_io))
|
||||
if presents:
|
||||
spacing = round(kf(t, [(start + .5, 34), (start + 1.1, 18)], ease_out))
|
||||
word = text_layer('PRESENTS', font('barlow-regular.ttf', 34), SILVER + (255,), spacing)
|
||||
shade, p2 = self.shadowed(word, .9, 8)
|
||||
place(canvas, shade, 300 - p2, 330 - p2, kf(t, [(start + .5, 0), (start + .9, 1)], ease_io))
|
||||
rule = kf(t, [(start + .8, 0), (start + 1.3, 1)], ease_io)
|
||||
if rule > 0:
|
||||
d = ImageDraw.Draw(canvas)
|
||||
d.line((300, 378, 300 + 420 * rule, 378), fill=PINK + (230,), width=2)
|
||||
return 392 # where an event's own title can start
|
||||
|
||||
def draw_presents(self, canvas, pts, t):
|
||||
self.after_dark_frame(canvas, t)
|
||||
|
||||
# ---- B-Movie Throwbacks ------------------------------------------------------------------------------------
|
||||
def draw_bmovie(self, canvas, pts, t):
|
||||
top = self.after_dark_frame(canvas, t)
|
||||
title = self.cache.get('bmovie_title')
|
||||
if title is None:
|
||||
face = font('anton-regular.ttf', 74)
|
||||
green = text_layer('B-MOVIE THROWBACKS', face, GREEN + (255,), 3)
|
||||
deep = text_layer('B-MOVIE THROWBACKS', face, (20, 40, 12, 255), 3)
|
||||
title = Image.new('RGBA', (green.width + 12, green.height + 12))
|
||||
title.alpha_composite(deep, (10, 10))
|
||||
halo = Image.new('RGBA', title.size); halo.alpha_composite(green, (0, 0))
|
||||
title.alpha_composite(glow(halo, 12, 1.4))
|
||||
title.alpha_composite(green, (0, 0))
|
||||
self.cache['bmovie_title'] = title
|
||||
# The title rises in with a cheap wobble, like a hand-cut title card.
|
||||
a = kf(t, [(1.9, 0), (2.2, 1)], ease_io)
|
||||
rise = kf(t, [(1.9, 26), (2.35, 0)], ease_out)
|
||||
wob = 2.2 * math.sin((t - 1.9) * 14) * kf(t, [(1.9, 1), (2.8, 0)], ease_io) if t > 1.9 else 0
|
||||
place(canvas, scaled(title, 1, rot=wob) if abs(wob) > .05 else title, 292, top + 6 + rise, a)
|
||||
|
||||
# ---- The Midnight Drive-In ---------------------------------------------------------------------------------
|
||||
def draw_drivein(self, canvas, pts, t):
|
||||
s, m = pts['screen'], pts['marquee']
|
||||
# The picture on the screen follows the screen's own light: dark, one flicker, then on.
|
||||
n = min(MOVE, int(t * FPS) + 1)
|
||||
level = kf(n, [(30, 0), (34, .85), (37, .35), (41, 1)], lambda u: u)
|
||||
if level > 0:
|
||||
w, h = round(s['right'] - s['left']), round(s['bottom'] - s['top'])
|
||||
picture = self.cache.get('screen_picture')
|
||||
if picture is None or picture.size != (w, h):
|
||||
picture = Image.new('RGBA', (w, h))
|
||||
d = ImageDraw.Draw(picture)
|
||||
for y in range(h):
|
||||
u = y / h
|
||||
d.line((0, y, w, y), fill=(round(16 + 30 * u), round(18 + 10 * u), round(52 + 50 * u), 255))
|
||||
logo = scaled(self.logo, w * .74 / self.logo.width)
|
||||
picture.alpha_composite(logo, (round((w - logo.width) / 2), round(h * .1)))
|
||||
word = text_layer('PRESENTS', font('barlow-regular.ttf', max(12, round(h * .1))), SILVER + (255,), round(h * .05))
|
||||
picture.alpha_composite(word, (round((w - word.width) / 2), round(h * .1 + logo.height + h * .05)))
|
||||
self.cache['screen_picture'] = picture
|
||||
inset = 3
|
||||
place(canvas, picture.resize((w - 2 * inset, h - 2 * inset)), s['left'] + inset, s['top'] + inset, level)
|
||||
# The marquee's lettering, set on the lit panel as its bulbs come on.
|
||||
mw, mh = m['right'] - m['left'], m['bottom'] - m['top']
|
||||
title = self.cache.get('marquee_title')
|
||||
if title is None or title.width > mw * .92:
|
||||
title = text_layer('THE MIDNIGHT DRIVE-IN', font('anton-regular.ttf', round(mh * .66)), INK + (255,), round(mh * .1))
|
||||
title = scaled(title, min(1, mw * .9 / title.width))
|
||||
self.cache['marquee_title'] = title
|
||||
place(canvas, title, (m['left'] + m['right']) / 2, m['top'] + (mh - title.height) / 2, kf(t, [(1.6, 0), (1.9, 1)], ease_io), 'mt')
|
||||
# Above it all, the After Dark Presents line in small silver capitals, so the frame stays the shared one.
|
||||
top = text_layer('AFTER DARK PRESENTS', font('barlow-regular.ttf', 28), SILVER + (255,), 14)
|
||||
shade, p2 = self.shadowed(top, .9, 8)
|
||||
place(canvas, shade, W / 2 - p2, 72 - p2, kf(t, [(2.0, 0), (2.5, 1)], ease_io), 'mt')
|
||||
|
||||
# ---- Cult Classics -----------------------------------------------------------------------------------------
|
||||
def draw_cult(self, canvas, pts, t):
|
||||
moon = pts['moon']
|
||||
self.eye(canvas, moon, t)
|
||||
top = self.after_dark_frame(canvas, t, start=1.0)
|
||||
# The ticket flips in like a card turned over, then settles at a slight angle.
|
||||
flip = kf(t, [(2.3, .02), (2.62, 1)], ease_out)
|
||||
if t > 2.3:
|
||||
ticket = self.cache.get('ticket') or self.cache.setdefault('ticket', make_ticket())
|
||||
card = scaled(ticket, flip, 1, rot=kf(t, [(2.3, 10), (2.75, -4)], ease_out))
|
||||
place(canvas, card, 300 + (ticket.width - card.width) / 2, top + 4, kf(t, [(2.3, 0), (2.45, 1)]))
|
||||
|
||||
def eye(self, canvas, moon, t):
|
||||
"""The moon opens like an eye, looks aside, then straight at us, blinks once, and stays open."""
|
||||
x, y, r = moon['x'], moon['y'], moon['r'] * 1.02
|
||||
opening = kf(t, [(.5, 0), (1.3, 1)], ease_io)
|
||||
if t > 1.9:
|
||||
opening = kf(t, [(1.9, 1), (2.0, .05), (2.08, .05), (2.22, 1)], ease_io)
|
||||
if opening <= 0:
|
||||
return
|
||||
size = round(r * 2 + 6)
|
||||
eye = Image.new('RGBA', (size * 4, size * 4))
|
||||
d = ImageDraw.Draw(eye)
|
||||
c, R = size * 2, r * 4
|
||||
look = kf(t, [(.5, -.42), (1.25, -.42), (1.55, 0)], ease_io)
|
||||
ix, iy = c + look * R * .5, c + R * .04
|
||||
d.ellipse((ix - R * .5, iy - R * .5, ix + R * .5, iy + R * .5), fill=(150, 60, 190, 255))
|
||||
d.ellipse((ix - R * .38, iy - R * .38, ix + R * .38, iy + R * .38), fill=(214, 92, 200, 255))
|
||||
d.ellipse((ix - R * .2, iy - R * .2, ix + R * .2, iy + R * .2), fill=(10, 6, 16, 255))
|
||||
d.ellipse((ix - R * .3, iy - R * .33, ix - R * .14, iy - R * .17), fill=(255, 255, 255, 230))
|
||||
# Only what the lids let through, inside the moon's disc.
|
||||
mask = Image.new('L', eye.size, 0)
|
||||
md = ImageDraw.Draw(mask)
|
||||
half = R * opening
|
||||
md.ellipse((c - R, c - half, c + R, c + half), fill=255)
|
||||
disc = Image.new('L', eye.size, 0)
|
||||
ImageDraw.Draw(disc).ellipse((c - R, c - R, c + R, c + R), fill=255)
|
||||
mask = ImageChops.multiply(mask, disc)
|
||||
eye.putalpha(ImageChops.multiply(eye.getchannel('A'), mask))
|
||||
lids = Image.new('RGBA', eye.size)
|
||||
ld = ImageDraw.Draw(lids)
|
||||
ld.arc((c - R, c - half, c + R, c + half), 180, 360, fill=(70, 50, 100, 220), width=round(R * .05))
|
||||
ld.arc((c - R, c - half, c + R, c + half), 0, 180, fill=(70, 50, 100, 160), width=round(R * .035))
|
||||
lids.putalpha(ImageChops.multiply(lids.getchannel('A'), disc))
|
||||
eye.alpha_composite(lids)
|
||||
small = eye.resize((size, size), Image.LANCZOS)
|
||||
canvas.alpha_composite(small, (round(x - size / 2), round(y - size / 2)))
|
||||
|
||||
# ---- Slasher Saturday --------------------------------------------------------------------------------------
|
||||
def draw_slasher(self, canvas, pts, t):
|
||||
logo = self.logo_at(640)
|
||||
place(canvas, logo, 40, 40, kf(t, [(2.4, 0), (2.9, 1)], ease_io))
|
||||
title = self.cache.get('slasher_title')
|
||||
if title is None:
|
||||
title = text_layer('SLASHER SATURDAY', font('barlow-condensed-medium.ttf', 64), RED + (255,), 10)
|
||||
self.cache['slasher_title'] = title
|
||||
# One clean blade glint sweeps left to right, cutting the title out of the black.
|
||||
u = kf(t, [(2.95, 0), (3.35, 1)], ease_io)
|
||||
if u > 0:
|
||||
x0, y0 = 196, 292
|
||||
edge = round(title.width * u)
|
||||
cut = title.copy()
|
||||
mask = Image.new('L', cut.size, 0)
|
||||
ImageDraw.Draw(mask).polygon([(0, 0), (edge + 20, 0), (edge - 20, cut.height), (0, cut.height)], fill=255)
|
||||
cut.putalpha(ImageChops.multiply(cut.getchannel('A'), mask))
|
||||
place(canvas, cut, x0, y0)
|
||||
if u < 1:
|
||||
g = Image.new('RGBA', (60, cut.height + 30))
|
||||
ImageDraw.Draw(g).line((40, 0, 20, cut.height + 30), fill=(255, 226, 226, 230), width=3)
|
||||
place(canvas, glow(g, 4, 1.6), x0 + edge - 30, y0 - 15)
|
||||
place(canvas, g, x0 + edge - 30, y0 - 15)
|
||||
|
||||
|
||||
def make_ticket():
|
||||
"""ADMIT ONE, stamped CULT CLASSICS: cream card, punched edge, pink ink slightly off register."""
|
||||
w, h = 340, 118
|
||||
card = Image.new('RGBA', (w, h))
|
||||
d = ImageDraw.Draw(card)
|
||||
d.rounded_rectangle((0, 0, w - 1, h - 1), 8, fill=CREAM + (255,))
|
||||
for y in range(10, h - 6, 16):
|
||||
d.ellipse((-6, y, 6, y + 10), fill=(0, 0, 0, 0)); d.ellipse((w - 7, y, w + 5, y + 10), fill=(0, 0, 0, 0))
|
||||
d.line((70, 10, 70, h - 10), fill=(200, 180, 160, 255), width=2)
|
||||
small = text_layer('ADMIT ONE', font('barlow-semibold.ttf', 18), (90, 60, 80, 255), 4)
|
||||
card.alpha_composite(small.rotate(90, expand=True), (30, round((h - small.width) / 2)))
|
||||
word = text_layer('CULT', font('anton-regular.ttf', 40), PINK + (255,), 6)
|
||||
word2 = text_layer('CLASSICS', font('anton-regular.ttf', 40), PINK + (255,), 6)
|
||||
under = (150, 40, 150, 140)
|
||||
for layer, y in ((word, 12), (word2, 60)):
|
||||
ghost = Image.new('RGBA', layer.size, under); ghost.putalpha(layer.getchannel('A').point(lambda v: v * 140 // 255))
|
||||
card.alpha_composite(ghost, (90, y + 3))
|
||||
card.alpha_composite(layer, (88, y))
|
||||
return card
|
||||
|
||||
|
||||
def fade_in(frame, t):
|
||||
a = kf(t, [(0, 0), (.3, 1)], ease_io)
|
||||
if a >= 1:
|
||||
return frame
|
||||
black = Image.new('RGBA', frame.size, (0, 0, 0, 255))
|
||||
return Image.blend(black, frame, a)
|
||||
|
||||
|
||||
# ---- Sound ----------------------------------------------------------------------------------------------------
|
||||
RATE = riot.RATE
|
||||
|
||||
|
||||
def whirr(n_sec, seed=21):
|
||||
"""A projector: soft motor hum, and noise fluttering at the shutter's 24 a second."""
|
||||
rng, n = random.Random(seed), int(n_sec * RATE)
|
||||
noise = riot.onepole([rng.uniform(-1, 1) for _ in range(n)], .05)
|
||||
return [(.5 * math.sin(2 * math.pi * 50 * i / RATE) * .4 + noise[i] * 3 * (.6 + .4 * math.sin(2 * math.pi * 24 * i / RATE))) * riot.env(i, n, .5, .7) for i in range(n)]
|
||||
|
||||
|
||||
def warble(n_sec=1.7):
|
||||
"""A cheap sci-fi warble: a sine sliding up and down with a wide, slow vibrato."""
|
||||
n, ph, out = int(n_sec * RATE), 0.0, []
|
||||
for i in range(n):
|
||||
t = i / RATE
|
||||
f = (520 + 260 * math.sin(math.pi * t / n_sec)) * (1 + .035 * math.sin(2 * math.pi * 6.5 * t))
|
||||
ph += 2 * math.pi * f / RATE
|
||||
out.append((math.sin(ph) + .15 * math.sin(2 * ph)) * riot.env(i, n, .15, .4))
|
||||
return out
|
||||
|
||||
|
||||
def ambience(n_sec, seed=22):
|
||||
rng, n = random.Random(seed), int(n_sec * RATE)
|
||||
return [s * 6 * riot.env(i, n, .4, .5) for i, s in enumerate(riot.onepole([rng.uniform(-1, 1) for _ in range(n)], .01))]
|
||||
|
||||
|
||||
def organ(n_sec=2.6):
|
||||
"""A low, slightly detuned diminished chord: not quite right, on purpose."""
|
||||
n, out = int(n_sec * RATE), []
|
||||
notes = [146.8, 174.6, 207.7]
|
||||
for i in range(n):
|
||||
t = i / RATE
|
||||
s = sum(math.sin(2 * math.pi * f * t) + math.sin(2 * math.pi * (f + .7) * t) + .3 * math.sin(4 * math.pi * f * t) for f in notes)
|
||||
out.append(s * riot.env(i, n, .5, .9))
|
||||
return out
|
||||
|
||||
|
||||
def phone(n_sec=.9, seed=23):
|
||||
"""An old bell telephone, heard through walls: two bells struck twenty times a second, muffled, a little room."""
|
||||
n, out = int(n_sec * RATE), []
|
||||
for i in range(n):
|
||||
t = i / RATE
|
||||
strike = .55 + .45 * math.sin(2 * math.pi * 20 * t)
|
||||
s = (math.sin(2 * math.pi * 900 * t) + .7 * math.sin(2 * math.pi * 1180 * t)) * strike
|
||||
out.append(s * riot.env(i, n, .01, .12))
|
||||
muffled = riot.onepole(riot.onepole(out, .06), .1)
|
||||
room = list(muffled) + [0.0] * int(.3 * RATE)
|
||||
for delay, gain in ((.037, .45), (.061, .32), (.089, .22), (.131, .14)):
|
||||
k = int(delay * RATE)
|
||||
for i in range(len(muffled)):
|
||||
room[i + k] += muffled[i] * gain
|
||||
return room
|
||||
|
||||
|
||||
def drone(n_sec):
|
||||
n = int(n_sec * RATE)
|
||||
return [(math.sin(2 * math.pi * 55 * i / RATE) + .4 * math.sin(2 * math.pi * 82.5 * i / RATE)) * riot.env(i, n, 1, 1) for i in range(n)]
|
||||
|
||||
|
||||
SOUNDS = {
|
||||
'presents': lambda: riot.mix(LENGTH, [(.6, whirr(3.2), 1)]),
|
||||
'bmovie': lambda: riot.mix(LENGTH, [(.3, whirr(3.5), .4), (.5, warble(), .5)]),
|
||||
'drivein': lambda: riot.mix(LENGTH, [(0, ambience(3.9), 1), (1.12, riot.thump(.2, 120, 60, .3, 9), .5), (1.55, riot.tick(9), .15)]),
|
||||
'cult': lambda: riot.mix(LENGTH, [(.4, organ(3.3), .5), (1.92, riot.thump(.12, 160, 90, .1, 10), .25)]),
|
||||
'slasher': lambda: riot.mix(LENGTH, [(0, drone(3.9), .25), (.35, phone(), 1), (1.6, phone(), 1)]),
|
||||
}
|
||||
|
||||
|
||||
# ---- Build ----------------------------------------------------------------------------------------------------
|
||||
|
||||
GUIDE = {
|
||||
'presents': lambda: [(text_layer('PRESENTS', font('barlow-regular.ttf', 30), SILVER + (255,), 6), None)],
|
||||
'bmovie': lambda: [(text_layer('B-MOVIE', font('anton-regular.ttf', 38), GREEN + (255,), 3), 'glow'), (text_layer('THROWBACKS', font('anton-regular.ttf', 30), GREEN + (255,), 2), 'glow')],
|
||||
'drivein': lambda: [(text_layer('MIDNIGHT', font('anton-regular.ttf', 30), INK + (255,), 3), 'panel'), (text_layer('DRIVE-IN', font('anton-regular.ttf', 30), INK + (255,), 3), 'panel')],
|
||||
'cult': lambda: [(scaled(make_ticket(), .52), None)],
|
||||
'slasher': lambda: [(text_layer('SLASHER', font('barlow-condensed-medium.ttf', 38), RED + (255,), 4), None), (text_layer('SATURDAY', font('barlow-condensed-medium.ttf', 38), RED + (255,), 4), None)],
|
||||
}
|
||||
|
||||
|
||||
def guide_card(key, d, stem):
|
||||
channel = BLOCKS[key]['channel']
|
||||
epg = Image.open(DESIGNS / channel / 'exports' / f"{channel.replace('-', '_')}_epg.png").convert('RGBA')
|
||||
epg = scaled(epg.crop(epg.getbbox()), .78)
|
||||
card = Image.new('RGBA', (512, 160))
|
||||
card.alpha_composite(epg, (10, round((160 - epg.height) / 2)))
|
||||
lines = GUIDE[key]()
|
||||
x0, total = 330, sum(l.height for l, _ in lines) + 8 * (len(lines) - 1)
|
||||
if lines[0][1] == 'panel':
|
||||
width = max(l.width for l, _ in lines) + 28
|
||||
d2 = ImageDraw.Draw(card)
|
||||
d2.rectangle((x0 - 6, (160 - total) / 2 - 12, x0 - 6 + width, (160 + total) / 2 + 12), fill=CREAM + (255,))
|
||||
for i in range(0, width, 14):
|
||||
for y in ((160 - total) / 2 - 12, (160 + total) / 2 + 12):
|
||||
d2.ellipse((x0 - 6 + i - 3, y - 3, x0 - 6 + i + 3, y + 3), fill=(255, 200, 106, 255))
|
||||
y = (160 - total) / 2
|
||||
for layer, style in lines:
|
||||
x = x0 + 8 if style == 'panel' else x0
|
||||
if style == 'glow':
|
||||
halo = Image.new('RGBA', card.size); halo.alpha_composite(layer, (x, round(y))); card.alpha_composite(glow(halo, 5, 1.5))
|
||||
card.alpha_composite(layer, (x, round(y)))
|
||||
y += layer.height + 8
|
||||
card.save(d / 'exports' / f'{stem}_guide.png')
|
||||
card.resize((256, 80), Image.LANCZOS).save(d / 'exports' / f'{stem}_guide_app.webp', quality=90)
|
||||
|
||||
|
||||
def build(key, frames):
|
||||
cfg = BLOCKS[key]
|
||||
d = HERE / cfg['folder']
|
||||
for sub in ('exports', 'review'):
|
||||
(d / sub).mkdir(parents=True, exist_ok=True)
|
||||
stem = Path(cfg['folder']).name.replace('-', '_')
|
||||
block = Block(key, frames)
|
||||
rendered = []
|
||||
tmp = d / 'review' / '.frames'
|
||||
if tmp.exists():
|
||||
shutil.rmtree(tmp)
|
||||
tmp.mkdir()
|
||||
rng = random.Random(5)
|
||||
for i in range(int(LENGTH * FPS)):
|
||||
t = i / FPS
|
||||
f = block.frame(t)
|
||||
if key == 'bmovie':
|
||||
f = film(f, t, rng)
|
||||
f = f.convert('RGB')
|
||||
f.save(tmp / f'{i:04d}.png')
|
||||
rendered.append(f)
|
||||
rendered[-1].save(d / 'review' / f'{stem}_final_still.png')
|
||||
silent = d / 'exports' / f'{stem}_ident.mp4'
|
||||
encode = ['-an', '-vf', 'fps=30', '-c:v', 'libx264', '-profile:v', 'main', '-pix_fmt', 'yuv420p', '-preset', 'veryslow', '-tune', 'animation', '-crf', riot.CRF, '-maxrate', '1400k', '-bufsize', '2800k', '-movflags', '+faststart']
|
||||
subprocess.run(['ffmpeg', '-y', '-v', 'error', '-framerate', str(FPS), '-i', str(tmp / '%04d.png'), *encode, str(silent)], check=True)
|
||||
sting = d / 'exports' / f'{stem}_sting.wav'
|
||||
samples = SOUNDS[key]()
|
||||
riot.write_wav(sting, samples)
|
||||
measured = riot.loudness(sting)
|
||||
riot.write_wav(sting, samples, -14.0 + min(riot.STING_LUFS - measured['integratedLufs'], riot.STING_PEAK - measured['truePeakDbfs']))
|
||||
with_sound = d / 'review' / f'{stem}_preview_with_sound.mp4'
|
||||
subprocess.run(['ffmpeg', '-y', '-v', 'error', '-i', str(silent), '-i', str(sting), '-map', '0:v', '-map', '1:a', '-c:v', 'copy', '-c:a', 'aac', '-b:a', '96k', '-shortest', '-movflags', '+faststart', str(with_sound)], check=True)
|
||||
shutil.copy(silent, d / 'review' / f'{stem}_preview_silent.mp4')
|
||||
guide_card(key, d, stem)
|
||||
picks = [0, .5, 1.0, 1.4, 1.8, 2.2, 2.6, 3.0, LENGTH - 1 / FPS]
|
||||
sheet = Image.new('RGB', (1920, 1080 + 70), (7, 22, 50))
|
||||
ImageDraw.Draw(sheet).text((20, 16), f"{cfg['title']} / block ident preview, {LENGTH:.0f} s", font=font('barlow-semibold.ttf', 32), fill='white')
|
||||
for n, t in enumerate(picks):
|
||||
tile = rendered[min(len(rendered) - 1, round(t * FPS))].resize((640, 360), Image.LANCZOS)
|
||||
riot.label(tile, f'{t:.1f} s' if n < 8 else 'final hold', 22)
|
||||
sheet.paste(tile, ((n % 3) * 640, 70 + (n // 3) * 360))
|
||||
sheet.save(d / 'review' / f'{stem}_contact_sheet.png')
|
||||
report = dict(status='preview-not-integrated', block=cfg['title'], seconds=LENGTH, fps=FPS, size=[W, H], crf=riot.CRF,
|
||||
identBytes=silent.stat().st_size, ssim=riot.ssim(silent, tmp), guideAppBytes=(d / 'exports' / f'{stem}_guide_app.webp').stat().st_size,
|
||||
finalHoldStillForHalfSecond=riot.hold_check(rendered), flash=riot.flash_check(silent), sting=riot.loudness(sting))
|
||||
(d / 'review' / 'checks.json').write_text(json.dumps(report, indent=1))
|
||||
shutil.rmtree(tmp)
|
||||
print(json.dumps(report))
|
||||
|
||||
|
||||
def film(frame, t, rng):
|
||||
"""B-movie print: a gentle gate weave and fine grain, both easing away before the hold so the last frame is clean."""
|
||||
amount = kf(t, [(0, 1), (2.9, 1), (3.4, 0)], ease_io)
|
||||
if amount <= 0:
|
||||
return frame
|
||||
dx, dy = 1.6 * amount * math.sin(t * 9.1), 1.2 * amount * math.sin(t * 6.3 + 1)
|
||||
moved = frame.transform(frame.size, Image.AFFINE, (1, 0, -dx, 0, 1, -dy), resample=Image.BICUBIC, fillcolor=(0, 0, 0, 255))
|
||||
grain = Image.effect_noise(frame.size, 40).convert('RGBA')
|
||||
return Image.blend(moved, ImageChops.overlay(moved, grain), .18 * amount)
|
||||
|
||||
|
||||
def review_board():
|
||||
"""One page for Paul: each block's final hold frame and its guide card at app size and at 2x."""
|
||||
small, big = font('barlow-semibold.ttf', 22), font('barlow-semibold.ttf', 30)
|
||||
board = Image.new('RGB', (1920, 100 + len(BLOCKS) * 400), (7, 22, 50))
|
||||
d = ImageDraw.Draw(board)
|
||||
d.text((40, 30), 'After Dark and Horror block idents, Batch 2 previews: final hold frames and guide cards', font=font('barlow-semibold.ttf', 36), fill='white')
|
||||
for i, (key, cfg) in enumerate(BLOCKS.items()):
|
||||
folder, stem, y = HERE / cfg['folder'], Path(cfg['folder']).name.replace('-', '_'), 100 + i * 400
|
||||
board.paste(Image.open(folder / 'review' / f'{stem}_final_still.png').resize((640, 360), Image.LANCZOS), (40, y))
|
||||
d.text((720, y), cfg['title'], font=big, fill='white')
|
||||
d.text((720, y + 46), 'Guide card at app size (256x80) on the guide panel, then at 2x', font=small, fill=(183, 203, 232))
|
||||
card = Image.open(folder / 'exports' / f'{stem}_guide_app.webp').convert('RGBA')
|
||||
for (x, w, h, size, at) in [(720, 300, 110, (256, 80), (22, 15)), (1060, 560, 200, (512, 160), (24, 20))]:
|
||||
panel = Image.new('RGBA', (w, h), (18, 53, 107, 255))
|
||||
panel.alpha_composite(card.resize(size, Image.LANCZOS), at)
|
||||
board.paste(panel.convert('RGB'), (x, y + 96))
|
||||
board.save(HERE / 'orbit-after-dark-blocks' / 'batch2_review.png')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
frames = sys.argv[1]
|
||||
for key in sys.argv[2:] or list(BLOCKS):
|
||||
build(key, frames)
|
||||
review_board()
|
||||
@@ -0,0 +1,17 @@
|
||||
# After Dark and Horror block idents, Batch 2 previews, 3 November 2026
|
||||
|
||||
Previews for Paul's visual review of the approved concepts. Nothing here is in the app. The channels' logos, scenes and idents are read only.
|
||||
|
||||
Built in two steps:
|
||||
- `../blender/build_block_ident.py <block> <folder>` reuses `build_3d_ident.py`'s After Dark city and Horror house without changing it, adds each block's 3D pieces and a short camera settle, and writes the frames plus `points.json` (where the moon, screen and window land on screen). Frames live in `Orbit-Channel-Designs/depth-native/blender-blocks/`.
|
||||
- `../build-dark-blocks.py <that folder>` lays on the sharp 2D (logo, After Dark Presents frame, titles, eye, ticket, film weave), the original stings, guide cards, checks and `batch2_review.png`.
|
||||
|
||||
Each block folder has `review/<block>_contact_sheet.png`, `_final_still.png`, `_preview_silent.mp4`, `_preview_with_sound.mp4` and `checks.json`, and `exports/` with the silent ident, the sting and the guide card.
|
||||
|
||||
**Shared:** 4 seconds, 1280x720, 30 fps, H.264 main, veryslow, CRF 34, same 1400k cap as the app's idents; 190 to 250 KB each (Slasher Saturday 46 KB, being mostly dark). The last half second is identical frame to frame. The rough flashing screen finds no frame change over 4%. Stings are synthesised in the script (no samples), levelled to -30 LUFS with true peaks of -17 dBTP or lower; the silent ident is the default.
|
||||
|
||||
- **After Dark Presents** (the shared frame): the camera settles on the channel's own last view; a projector beam opens from the moon; the logo, then PRESENTS in wide silver capitals and a fine pink rule. Sting: projector whirr.
|
||||
- **B-Movie Throwbacks:** a toy saucer swings on a visible wire, nearly slips off its string and awkwardly straightens just as the title appears (Paul's note); film weave and grain ease away before the hold; radioactive-green title. Sting: whirr and a sci-fi warble.
|
||||
- **After Dark Presents: The Midnight Drive-In:** a car park on the city's edge, rows of parked cars, an outdoor screen that flickers on once to show the After Dark logo, and the marquee lit bulb by bulb. No curtains or auditorium, so unlike the Drive-In channel; no host likeness, show name or branding, and the programme keeps its own title in the guide. Sting: car-park hum and a lamp clunk.
|
||||
- **Cult Classics:** the moon opens like an eye, looks aside, then at us, blinks once; an ADMIT ONE ticket flips in, stamped CULT CLASSICS. Sting: a detuned organ chord and a soft blink.
|
||||
- **Slasher Saturday** (in `../orbit-horror-blocks/`): the house goes quiet, one upstairs light comes on, a plain figure stops in the window, the light goes out; the Horror logo with its three droplets, and SLASHER SATURDAY cut in by one glint. Sting: a distant, muffled old bell telephone ringing twice over a low drone.
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 816 KiB |
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"status": "preview-not-integrated",
|
||||
"block": "After Dark Presents",
|
||||
"seconds": 4.0,
|
||||
"fps": 30,
|
||||
"size": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"crf": "34",
|
||||
"identBytes": 232218,
|
||||
"ssim": {
|
||||
"mean": 0.9567,
|
||||
"worst": 0.9388
|
||||
},
|
||||
"guideAppBytes": 5768,
|
||||
"finalHoldStillForHalfSecond": true,
|
||||
"flash": {
|
||||
"frames": 120,
|
||||
"largestFrameChange": 0.0131,
|
||||
"framesChangingOver10Percent": 0,
|
||||
"brightnessReversals": 0
|
||||
},
|
||||
"sting": {
|
||||
"integratedLufs": -30.0,
|
||||
"truePeakDbfs": -17.7
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 783 KiB |
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"status": "preview-not-integrated",
|
||||
"block": "B-Movie Throwbacks",
|
||||
"seconds": 4.0,
|
||||
"fps": 30,
|
||||
"size": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"crf": "34",
|
||||
"identBytes": 250138,
|
||||
"ssim": {
|
||||
"mean": 0.948,
|
||||
"worst": 0.9322
|
||||
},
|
||||
"guideAppBytes": 8894,
|
||||
"finalHoldStillForHalfSecond": true,
|
||||
"flash": {
|
||||
"frames": 120,
|
||||
"largestFrameChange": 0.0147,
|
||||
"framesChangingOver10Percent": 0,
|
||||
"brightnessReversals": 0
|
||||
},
|
||||
"sting": {
|
||||
"integratedLufs": -30.0,
|
||||
"truePeakDbfs": -22.2
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"status": "preview-not-integrated",
|
||||
"block": "Cult Classics",
|
||||
"seconds": 4.0,
|
||||
"fps": 30,
|
||||
"size": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"crf": "34",
|
||||
"identBytes": 238036,
|
||||
"ssim": {
|
||||
"mean": 0.9593,
|
||||
"worst": 0.9393
|
||||
},
|
||||
"guideAppBytes": 5588,
|
||||
"finalHoldStillForHalfSecond": true,
|
||||
"flash": {
|
||||
"frames": 120,
|
||||
"largestFrameChange": 0.0132,
|
||||
"framesChangingOver10Percent": 0,
|
||||
"brightnessReversals": 0
|
||||
},
|
||||
"sting": {
|
||||
"integratedLufs": -30.0,
|
||||
"truePeakDbfs": -19.4
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 771 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"status": "preview-not-integrated",
|
||||
"block": "After Dark Presents: The Midnight Drive-In",
|
||||
"seconds": 4.0,
|
||||
"fps": 30,
|
||||
"size": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"crf": "34",
|
||||
"identBytes": 190627,
|
||||
"ssim": {
|
||||
"mean": 0.9555,
|
||||
"worst": 0.9443
|
||||
},
|
||||
"guideAppBytes": 7092,
|
||||
"finalHoldStillForHalfSecond": true,
|
||||
"flash": {
|
||||
"frames": 120,
|
||||
"largestFrameChange": 0.0325,
|
||||
"framesChangingOver10Percent": 0,
|
||||
"brightnessReversals": 0
|
||||
},
|
||||
"sting": {
|
||||
"integratedLufs": -30.0,
|
||||
"truePeakDbfs": -17.0
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 741 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"status": "preview-not-integrated",
|
||||
"block": "Slasher Saturday",
|
||||
"seconds": 4.0,
|
||||
"fps": 30,
|
||||
"size": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"crf": "34",
|
||||
"identBytes": 46300,
|
||||
"ssim": {
|
||||
"mean": 0.9925,
|
||||
"worst": 0.9899
|
||||
},
|
||||
"guideAppBytes": 8164,
|
||||
"finalHoldStillForHalfSecond": true,
|
||||
"flash": {
|
||||
"frames": 120,
|
||||
"largestFrameChange": 0.0034,
|
||||
"framesChangingOver10Percent": 0,
|
||||
"brightnessReversals": 0
|
||||
},
|
||||
"sting": {
|
||||
"integratedLufs": -30.0,
|
||||
"truePeakDbfs": -19.1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 754 KiB |
|
After Width: | Height: | Size: 577 KiB |