Eureka/tools/fork-desk/make-poses.py
Eureka 7d59ec80df Fork desk: the standard is Nibu's format, one Persona per batch chosen by the work
desk.html follows the Aetheria Self's Nibu desk (questions collection, one booth
character that follows the viewport and changes mood on interaction), with the
Persona read from desk/config. make-poses.py maps a Persona's pose sheet onto the
page's nine moods; Libby and Nibu are built. README, INDEX and SKILL.md follow.
Rulings eureka-substrate:ruling:fork-desk-nibu-format and
fork-desk-presenter-follows-work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:38:13 +02:00

31 lines
1.5 KiB
Python

"""Builds a persona's desk pose set: poses/<persona>/<mood>.webp from a cast-art cells folder.
py -3 make-poses.py <persona> <cells dir>
The desk page knows moods, not pose names; each persona maps its own pose sheet onto them here.
"""
import os, sys
from PIL import Image
MOODS = ("idle", "neutral", "thinking", "happy", "surprised", "note", "determined", "triumph", "concerned")
# mood -> cell name (without the NN- prefix), per persona.
PERSONAS = {
"libby": {"idle": "schema", "neutral": "neutral", "thinking": "thinking", "happy": "happy", "surprised": "surprised",
"note": "research", "determined": "determined", "triumph": "stamp", "concerned": "concerned"},
"nibu": {"idle": "console", "neutral": "neutral", "thinking": "thinking", "happy": "happy", "surprised": "surprised",
"note": "lore", "determined": "determined", "triumph": "triumph", "concerned": "concerned"},
}
def main(persona, cells):
mapping = PERSONAS[persona]
by_name = {f[3:-4]: os.path.join(cells, f) for f in os.listdir(cells) if f.endswith(".png")}
out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "poses", persona)
os.makedirs(out, exist_ok=True)
for mood in MOODS:
im = Image.open(by_name[mapping[mood]]).convert("RGBA")
im.thumbnail((480, 480))
im.save(os.path.join(out, mood + ".webp"), "WEBP", quality=86, method=6)
print(persona, "->", out, len(MOODS), "moods")
if __name__ == "__main__":
main(sys.argv[1], sys.argv[2])