programextensions/blender/demos/game-assets.xtl

Blender, 4: game assets. X_eTaL makes the twelve tower defense pieces for X_eTaL-games and everything published with them: it writes the Python -- the launcher, and the bpy script describing each piece (Td.xtl) -- Python runs Blender, Blender runs the script: each piece is written as NAME.glb with its clips, rendered alone as NAME.png and as two sheets of frames (NAME-turn.png, NAME-map.png), shown close, one after another, turning and playing each clip, for one video, and all twelve lined up for another. Then X_eTaL hashes every file (the digest extension) into manifest.toml and writes the page that shows them, index.html, all in work/td/site. just ext blender publish-td copies that into the site, at blender/td/. Page: blender/td/ the pieces in 3D (published) Run: just demo blender game-assets (about five minutes)

source · imports bl: extensions/blender/lib/Blender.xtl; bp: extensions/blender/lib/Bpy.xtl; td: extensions/blender/demos/Td.xtl

script : Char

value · line 23

the pieces' Python, then each rendered alone, its fallback sheets (a turn and a map), then two videos (960 by 540): the pieces one after another, close, 5 seconds each, and all twelve lined up, 8 seconds

script ← ((ᵇᵖhead c̲at ᵗᵈall c̲at ᵇᵖreport c̲at ((0.55 0.62 0.72, 3.0) ᵇᵖl̲ights 0) c̲at ᵗᵈshow) c̲at
  ((ᵗᵈs̲tills 320) c̲at ((256, 96) ᵗᵈs̲heets 0) c̲at ((0.0 0.0 0.0, 30.0, 0.042 0.205 0.058) ᵇᵖg̲round 0)) c̲at
  ((960, 540, 150) ᵗᵈc̲loseups 0) c̲at (ᵇᵖv̲ideo "../closeups.mp4") c̲at ((960, 540, 240) ᵗᵈf̲ilm 0) c̲at ᵇᵖv̲ideo "../lineup.mp4")
Used in: _

_ : Int

function · line 26
_ ← "work/td/run.py" ᵇˡw̲rite! ᵇᵖlauncher

_ : Int

function · line 27
_ ← "work/td/assets.py" ᵇˡw̲rite! script

r : Char

value · line 29
r ← "work/td/run.py" ᵇˡr̲un! "work/td/assets.py work/td/site"
Used in: lines

lines : Box Char

value · line 31
lines ← (n̲ot r = f̲irst "\n") p̲artition r

m : Int

value · line 37
m ← "work/td/site/manifest.toml" ᵇˡw̲rite! ("work/td/site", ᵇˡv̲ersion @) ᵗᵈm̲anifest 0

p : Int

value · line 38
p ← "work/td/site/index.html" ᵇˡw̲rite! ᵗᵈpage