Quote the storyboard from what will actually be drawn

The estimate was cast x 3 + shots x 2. It counted characters who appear in
no shot, whose sheets are skipped, and knew nothing about the per-day
wardrobe sheets a multi-day story needs. On the Memory Road board that is
73 quoted against 82 drawn.
This commit is contained in:
gator 2026-09-17 17:34:33 +00:00
parent 0b11c4c262
commit 153c38e6b8

View file

@ -326,7 +326,7 @@
var undrawn = shots.filter(function (s) { return !s.opening_url; }).length;
var unfilmed = shots.filter(function (s) { return !s.clip_url; }).length;
var filmed = shots.length - unfilmed;
var imgs = cast.length * 3 + shots.length * 2;
var imgs = boardImages(shots, cast);
var s = String(meta.draw_state || "");
var drawing = s && !/^(drawn|failed)/.test(s);
var isLead = meta.writer === RUN.lead_writer;
@ -397,6 +397,35 @@
return a.join("") !== b.join("");
}
// What the storyboard will actually cost to draw. Three sheets for every
// character who is seen or heard, one more per extra day they are dressed
// differently, and two frames per shot.
function boardImages(shots, cast) {
var seen = {};
shots.forEach(function (s) {
(s.visible_characters || []).forEach(function (c) { seen[String(c)] = 1; });
(s.audio || []).forEach(function (a) {
if (String(a.text || "").trim()) seen[String(a.character_id)] = 1; });
});
var present = cast.filter(function (c) { return seen[String(c.id)]; });
var days = {};
shots.forEach(function (s) {
var d = String(s.day || "").trim();
if (!d) return;
(s.visible_characters || []).forEach(function (c) {
(days[String(c)] = days[String(c)] || {})[d] = 1; });
});
var extra = 0;
present.forEach(function (c) {
var wd = c.wardrobe_by_day || {};
var base = Object.keys(wd).sort()[0] || "";
Object.keys(days[String(c.id)] || {}).forEach(function (d) {
if (d !== base && wd[d]) extra += 1; });
});
return present.length * 3 + extra + shots.length * 2;
}
function mmss(n) {
return Math.floor(n / 60) + ":" + String(Math.round(n % 60)).padStart(2, "0");
}