From a5957fc3b2c65cd3380b541c519ad11964c0a365 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 10 Oct 2023 10:19:47 +0100 Subject: [PATCH] 50% chance of second foreground --- render.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/render.py b/render.py index 0a879be..15712d8 100644 --- a/render.py +++ b/render.py @@ -62,9 +62,14 @@ def compose(clips, target=150, base=1024): break length += clip['duration'] + fg = clip['foreground'] + if 'foreground2' in clip: + if chance(seq, 0.5): + fg = clip['foreground2'] + scene['front']['V1'].append({ 'duration': clip['duration'], - 'src': clip['foreground'], + 'src': fg, "filter": { 'transparency': seq() / 10, } @@ -110,7 +115,7 @@ def compose(clips, target=150, base=1024): }) scene['audio']['A2'].append({ 'duration': clip['duration'], - 'src': clip['foreground'], + 'src': fg, }) return scene