agent-manifesto-kit 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/collection/skills/concept-asset-builder/SKILL.md +124 -0
- package/collection/skills/concept-asset-builder/agents/openai.yaml +4 -0
- package/collection/skills/concept-asset-builder/assets/templates/agent_brief.md +56 -0
- package/collection/skills/concept-asset-builder/assets/templates/rubric.json +50 -0
- package/collection/skills/concept-asset-builder/assets/templates/rubric_example_vending.json +14 -0
- package/collection/skills/concept-asset-builder/assets/templates/scene_style_example.md +30 -0
- package/collection/skills/concept-asset-builder/assets/templates/wear_description_example.md +50 -0
- package/collection/skills/concept-asset-builder/assets/templates/zones.json +10 -0
- package/collection/skills/concept-asset-builder/assets/templates/zones_example_vending.json +69 -0
- package/collection/skills/concept-asset-builder/references/examples/postbox_blender.py +1112 -0
- package/collection/skills/concept-asset-builder/references/examples/postbox_wear_three.js +742 -0
- package/collection/skills/concept-asset-builder/references/examples/vending_materials_blender.py +487 -0
- package/collection/skills/concept-asset-builder/references/examples/vending_wear_three.js +798 -0
- package/collection/skills/concept-asset-builder/references/field-lessons.md +36 -0
- package/collection/skills/concept-asset-builder/references/wear-language.md +36 -0
- package/collection/skills/concept-asset-builder/scripts/blender/bake_export.py +174 -0
- package/collection/skills/concept-asset-builder/scripts/blender/render_views.py +100 -0
- package/collection/skills/concept-asset-builder/scripts/blender/studio.py +73 -0
- package/collection/skills/concept-asset-builder/scripts/capture.mjs +44 -0
- package/collection/skills/concept-asset-builder/scripts/codex_review.sh +88 -0
- package/collection/skills/concept-asset-builder/scripts/compare_to.py +24 -0
- package/collection/skills/concept-asset-builder/scripts/composite_godot.py +13 -0
- package/collection/skills/concept-asset-builder/scripts/crop.py +9 -0
- package/collection/skills/concept-asset-builder/scripts/gen_texture.sh +18 -0
- package/collection/skills/concept-asset-builder/scripts/godot/capture.gd +122 -0
- package/collection/skills/concept-asset-builder/scripts/godot/project.godot +18 -0
- package/collection/skills/concept-asset-builder/scripts/init_workspace.sh +17 -0
- package/collection/skills/concept-asset-builder/scripts/measure_silhouette.py +40 -0
- package/collection/skills/concept-asset-builder/scripts/metrics.py +144 -0
- package/collection/skills/concept-asset-builder/scripts/sheet.py +19 -0
- package/collection/skills/concept-asset-builder/scripts/test_tools.py +121 -0
- package/collection/skills/concept-asset-builder/scripts/threejs/index.html +23 -0
- package/collection/skills/concept-asset-builder/scripts/threejs/model.js +9 -0
- package/collection/skills/concept-asset-builder/scripts/threejs/studio.js +178 -0
- package/collection/skills/concept-asset-builder/scripts/wear_stats.py +130 -0
- package/collection/skills/concept-scene-builder/SKILL.md +16 -3
- package/package.json +1 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// Shared white studio for pipeline A (procedural three.js) and pipeline C (Blender GLB in three.js).
|
|
2
|
+
// Identical renderer, light, camera fitting and capture contract for both viewers.
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
|
|
5
|
+
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
6
|
+
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
|
|
7
|
+
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
|
|
8
|
+
import { GTAOPass } from 'three/addons/postprocessing/GTAOPass.js';
|
|
9
|
+
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
|
|
10
|
+
|
|
11
|
+
export async function loadSpec() {
|
|
12
|
+
const res = await fetch('/spec/object.json');
|
|
13
|
+
return res.json();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** True if a static file exists (vite answers missing paths with index.html, so check the content type). */
|
|
17
|
+
export async function fileExists(url, typePrefix) {
|
|
18
|
+
try {
|
|
19
|
+
const res = await fetch(url, { method: 'HEAD', cache: 'no-store' });
|
|
20
|
+
if (!res.ok) return false;
|
|
21
|
+
const type = res.headers.get('content-type') || '';
|
|
22
|
+
return typePrefix ? type.startsWith(typePrefix) : !type.startsWith('text/html');
|
|
23
|
+
} catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const params = new URLSearchParams(location.search);
|
|
29
|
+
|
|
30
|
+
export function createStudio(spec, container = document.body, opts = {}) {
|
|
31
|
+
const view = params.get('view');
|
|
32
|
+
// GTAO on by default (pipeline A); a viewer can default it off (C: AO is already baked into the GLB);
|
|
33
|
+
// ?ao=0 / ?ao=1 overrides either way
|
|
34
|
+
const useAO = params.has('ao') ? params.get('ao') !== '0' : (opts.ao ?? true);
|
|
35
|
+
const [imgW, imgH] = spec.cameras.image;
|
|
36
|
+
const width = view ? imgW : window.innerWidth;
|
|
37
|
+
const height = view ? imgH : window.innerHeight;
|
|
38
|
+
|
|
39
|
+
const renderer = new THREE.WebGLRenderer({ antialias: true, preserveDrawingBuffer: true });
|
|
40
|
+
renderer.setPixelRatio(view ? 1 : Math.min(window.devicePixelRatio, 2));
|
|
41
|
+
renderer.setSize(width, height);
|
|
42
|
+
renderer.outputColorSpace = THREE.SRGBColorSpace;
|
|
43
|
+
// Neutral (Khronos PBR Neutral) keeps albedo hue and saturation: ACES/AgX shift the red paint toward orange/pink.
|
|
44
|
+
renderer.toneMapping = THREE.NeutralToneMapping;
|
|
45
|
+
renderer.toneMappingExposure = 0.82;
|
|
46
|
+
renderer.shadowMap.enabled = true;
|
|
47
|
+
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
48
|
+
container.appendChild(renderer.domElement);
|
|
49
|
+
|
|
50
|
+
const scene = new THREE.Scene();
|
|
51
|
+
// with the composer the OutputPass tone-maps the background too: ×1.35 compensates so the page bg matches the
|
|
52
|
+
// concept; without it (renderer clear colour, not tone-mapped) the plain colour already matches
|
|
53
|
+
scene.background = new THREE.Color(spec.palette.background).multiplyScalar(useAO ? 1.35 : 1.0);
|
|
54
|
+
|
|
55
|
+
const pmrem = new THREE.PMREMGenerator(renderer);
|
|
56
|
+
scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
|
|
57
|
+
scene.environmentIntensity = 1.0;
|
|
58
|
+
|
|
59
|
+
// Soft key: upper-left of the CAMERA. The concept sheet lights every view the same way relative to the
|
|
60
|
+
// viewer (left side of the body lighter), so the key follows the camera instead of being fixed in the world.
|
|
61
|
+
const key = new THREE.DirectionalLight(0xffffff, 1.25);
|
|
62
|
+
const KEY_AZ = THREE.MathUtils.degToRad(-40), KEY_EL = THREE.MathUtils.degToRad(38);
|
|
63
|
+
key.target.position.set(0, 0.6, 0);
|
|
64
|
+
function placeKey() {
|
|
65
|
+
const az = Math.atan2(camera.position.x - key.target.position.x, camera.position.z - key.target.position.z) + KEY_AZ;
|
|
66
|
+
key.position.set(Math.sin(az) * Math.cos(KEY_EL), Math.sin(KEY_EL), Math.cos(az) * Math.cos(KEY_EL))
|
|
67
|
+
.multiplyScalar(3.5).add(key.target.position);
|
|
68
|
+
// RoomEnvironment is asymmetric: turn it with the camera so every view gets the same studio
|
|
69
|
+
scene.environmentRotation.y = az - KEY_AZ;
|
|
70
|
+
}
|
|
71
|
+
key.castShadow = true;
|
|
72
|
+
key.shadow.mapSize.set(2048, 2048);
|
|
73
|
+
key.shadow.radius = 6;
|
|
74
|
+
key.shadow.bias = -0.0004;
|
|
75
|
+
key.shadow.normalBias = 0.015;
|
|
76
|
+
const sc = key.shadow.camera;
|
|
77
|
+
sc.left = -0.9; sc.right = 0.9; sc.top = 0.9; sc.bottom = -0.9; sc.near = 0.5; sc.far = 8;
|
|
78
|
+
scene.add(key, key.target);
|
|
79
|
+
|
|
80
|
+
// Invisible ground that only receives a faint shadow (concept sheet has almost none).
|
|
81
|
+
const ground = new THREE.Mesh(
|
|
82
|
+
new THREE.PlaneGeometry(6, 6),
|
|
83
|
+
new THREE.ShadowMaterial({ opacity: 0.04 })
|
|
84
|
+
);
|
|
85
|
+
ground.rotation.x = -Math.PI / 2;
|
|
86
|
+
ground.receiveShadow = true;
|
|
87
|
+
scene.add(ground);
|
|
88
|
+
|
|
89
|
+
const camera = new THREE.PerspectiveCamera(spec.cameras.fov_deg, width / height, 0.05, 50);
|
|
90
|
+
|
|
91
|
+
let composer = null;
|
|
92
|
+
if (useAO) {
|
|
93
|
+
// multisampled target (MSAA x4): the composer path otherwise loses the canvas antialiasing
|
|
94
|
+
composer = new EffectComposer(renderer, new THREE.WebGLRenderTarget(width, height, { type: THREE.HalfFloatType, samples: 4 }));
|
|
95
|
+
composer.setPixelRatio(renderer.getPixelRatio());
|
|
96
|
+
composer.setSize(width, height);
|
|
97
|
+
composer.addPass(new RenderPass(scene, camera));
|
|
98
|
+
const gtao = new GTAOPass(scene, camera, width, height);
|
|
99
|
+
gtao.updateGtaoMaterial({ radius: 0.12, distanceExponent: 1.5, thickness: 1.0, scale: 1.0 });
|
|
100
|
+
gtao.blendIntensity = 1.0;
|
|
101
|
+
composer.addPass(gtao);
|
|
102
|
+
composer.addPass(new OutputPass());
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let controls = null;
|
|
106
|
+
if (!view) {
|
|
107
|
+
controls = new OrbitControls(camera, renderer.domElement);
|
|
108
|
+
controls.enableDamping = true;
|
|
109
|
+
window.addEventListener('resize', () => {
|
|
110
|
+
camera.aspect = window.innerWidth / window.innerHeight;
|
|
111
|
+
camera.updateProjectionMatrix();
|
|
112
|
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
113
|
+
composer?.setSize(window.innerWidth, window.innerHeight);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function render() {
|
|
118
|
+
if (composer) composer.render();
|
|
119
|
+
else renderer.render(scene, camera);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Place the camera for a named view and fit the object's bounding box to `fill` of the image height. */
|
|
123
|
+
function frame(object, viewName = view || '3q', fill = spec.cameras.fill ?? 0.955) {
|
|
124
|
+
const az = THREE.MathUtils.degToRad(spec.cameras.views[viewName] ?? -38);
|
|
125
|
+
const el = THREE.MathUtils.degToRad(spec.cameras.elevation_deg);
|
|
126
|
+
const dir = new THREE.Vector3(Math.sin(az) * Math.cos(el), Math.sin(el), Math.cos(az) * Math.cos(el));
|
|
127
|
+
const box = new THREE.Box3().setFromObject(object);
|
|
128
|
+
const corners = [];
|
|
129
|
+
for (const x of [box.min.x, box.max.x])
|
|
130
|
+
for (const y of [box.min.y, box.max.y])
|
|
131
|
+
for (const z of [box.min.z, box.max.z]) corners.push(new THREE.Vector3(x, y, z));
|
|
132
|
+
const target = box.getCenter(new THREE.Vector3());
|
|
133
|
+
let dist = 6;
|
|
134
|
+
for (let i = 0; i < 8; i++) {
|
|
135
|
+
camera.position.copy(target).addScaledVector(dir, dist);
|
|
136
|
+
camera.lookAt(target);
|
|
137
|
+
camera.updateMatrixWorld();
|
|
138
|
+
let ymin = Infinity, ymax = -Infinity;
|
|
139
|
+
for (const c of corners) {
|
|
140
|
+
const p = c.clone().project(camera);
|
|
141
|
+
ymin = Math.min(ymin, p.y); ymax = Math.max(ymax, p.y);
|
|
142
|
+
}
|
|
143
|
+
dist *= (ymax - ymin) / (2 * fill);
|
|
144
|
+
// recentre vertically: shift target along camera up by the NDC offset
|
|
145
|
+
const mid = (ymax + ymin) / 2;
|
|
146
|
+
const halfH = Math.tan(THREE.MathUtils.degToRad(camera.fov / 2)) * dist;
|
|
147
|
+
const up = new THREE.Vector3(0, 1, 0).applyQuaternion(camera.quaternion);
|
|
148
|
+
target.addScaledVector(up, mid * halfH);
|
|
149
|
+
}
|
|
150
|
+
camera.position.copy(target).addScaledVector(dir, dist);
|
|
151
|
+
camera.lookAt(target);
|
|
152
|
+
if (controls) {
|
|
153
|
+
controls.target.copy(target);
|
|
154
|
+
controls.update();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function start() {
|
|
159
|
+
let frames = 0;
|
|
160
|
+
renderer.setAnimationLoop(() => {
|
|
161
|
+
controls?.update();
|
|
162
|
+
placeKey();
|
|
163
|
+
render();
|
|
164
|
+
if (++frames === 3) window.__ready = true;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return { THREE, renderer, scene, camera, key, controls, frame, render, start, view };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Small corner label (hidden in capture mode). */
|
|
172
|
+
export function label(text, view) {
|
|
173
|
+
if (view) return;
|
|
174
|
+
const el = document.createElement('div');
|
|
175
|
+
el.textContent = text;
|
|
176
|
+
el.style.cssText = 'position:fixed;left:12px;top:10px;font:13px/1.3 system-ui;color:#5a4a42;opacity:.8;pointer-events:none';
|
|
177
|
+
document.body.appendChild(el);
|
|
178
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Generic wear measurement (v2) for an object concept vs renders.
|
|
2
|
+
|
|
3
|
+
Usage: python3 tools/wear_stats.py [image_dir] (default reference/crops) -> table + out/wear_stats_<dir>.json
|
|
4
|
+
Config: reference/zones.json
|
|
5
|
+
height_m: real height of the silhouette
|
|
6
|
+
bands: {name: [y0_m, y1_m]} horizontal bands over the whole silhouette (every view)
|
|
7
|
+
front_rects: {name: [x0, x1, y0, y1]} metres, x from the silhouette centre; front view only
|
|
8
|
+
chip: {dL, min_L, max_C, window_m} chip = lighter than the local paint by dL, L > min_L, chroma < max_C
|
|
9
|
+
or {mode: "hue", paint_hue: [h0, h1], neutral_C, min_L, max_C} for light paint: chip = not the paint hue
|
|
10
|
+
rust: {mode: "dark"|"hue", hue: [h0, h1], min_C, dL} hue mode: orange-brown hue range (for non-red paint)
|
|
11
|
+
grime: {hue: [h0, h1], min_C, max_L} olive grime
|
|
12
|
+
exclude_emissive: true drop the glowing window (and what is inside it) from all measurements
|
|
13
|
+
All images are resampled so the silhouette is 527 px tall; windows are in metres; vertical components longer
|
|
14
|
+
than 0.2 m are dropped from rust (edges/grooves, not drips).
|
|
15
|
+
"""
|
|
16
|
+
import json, sys, pathlib
|
|
17
|
+
import numpy as np
|
|
18
|
+
from PIL import Image
|
|
19
|
+
from scipy import ndimage as ndi
|
|
20
|
+
sys.path.insert(0, str(pathlib.Path(__file__).parent))
|
|
21
|
+
import metrics as M
|
|
22
|
+
|
|
23
|
+
ROOT = M.ROOT
|
|
24
|
+
Z = json.loads((ROOT / "reference/zones.json").read_text())
|
|
25
|
+
H = Z["height_m"]
|
|
26
|
+
src = pathlib.Path(sys.argv[1]) if len(sys.argv) > 1 else ROOT / "reference/crops"
|
|
27
|
+
TARGET = 527
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def normalise(img):
|
|
31
|
+
m = M.mask_of(img); y0, y1, x0, x1 = M.bbox(m); k = TARGET / (y1 - y0)
|
|
32
|
+
if abs(k - 1) < 0.02:
|
|
33
|
+
return img
|
|
34
|
+
im = Image.fromarray(img.clip(0, 255).astype(np.uint8)).resize((round(img.shape[1] * k), round(img.shape[0] * k)), Image.LANCZOS)
|
|
35
|
+
return np.asarray(im).astype(np.float32)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def masks(img, mpp, sil):
|
|
39
|
+
lab = M.srgb_to_lab(img); L, a, b = lab[..., 0], lab[..., 1], lab[..., 2]
|
|
40
|
+
C = np.hypot(a, b); hue = np.degrees(np.arctan2(b, a)) % 360
|
|
41
|
+
win = max(5, int(round(0.033 / mpp)) | 1)
|
|
42
|
+
Lloc = ndi.median_filter(L, size=win)
|
|
43
|
+
ch = Z.get("chip", {}); dL, minL, maxC = ch.get("dL", 10), ch.get("min_L", 55), ch.get("max_C", 38)
|
|
44
|
+
# chips can be larger than the rust window: compare with a wider (8 cm) paint neighbourhood
|
|
45
|
+
Lchip = ndi.median_filter(L, size=max(7, int(round(ch.get("window_m", 0.08) / mpp)) | 1))
|
|
46
|
+
chip = (L > np.minimum(Lloc, Lchip) + dL) & (L > minL) & (C < maxC)
|
|
47
|
+
if ch.get("mode") == "hue":
|
|
48
|
+
# light paint: chips are not much lighter, they differ by hue (warm/neutral primer vs the paint hue)
|
|
49
|
+
ph0, ph1 = ch["paint_hue"]
|
|
50
|
+
not_paint = ~((hue >= ph0) & (hue <= ph1)) | (C < ch.get("neutral_C", 4))
|
|
51
|
+
chip = not_paint & (C < maxC) & (L > minL) & (L > np.minimum(Lloc, Lchip) - 3)
|
|
52
|
+
r = Z.get("rust", {"mode": "dark"})
|
|
53
|
+
if r.get("mode") == "hue":
|
|
54
|
+
h0, h1 = r.get("hue", [30, 85])
|
|
55
|
+
rust = (hue >= h0) & (hue <= h1) & (C > r.get("min_C", 15)) & (L < Lloc - r.get("dL", 2)) & (L < 72)
|
|
56
|
+
else:
|
|
57
|
+
rust = (L < Lloc - 6) & (L < 50) & (C > 20)
|
|
58
|
+
g = Z.get("grime")
|
|
59
|
+
grime = ((hue >= g["hue"][0]) & (hue <= g["hue"][1]) & (C > g.get("min_C", 10)) & (L < g.get("max_L", 65))) if g else np.zeros_like(rust)
|
|
60
|
+
keep = sil.copy()
|
|
61
|
+
if Z.get("exclude_emissive"):
|
|
62
|
+
glow = (L > 93) & (C < 25) & sil # the display glows at L 95-99; lit light paint stays below ~90
|
|
63
|
+
glow = ndi.binary_closing(glow, iterations=3)
|
|
64
|
+
lab_, n = ndi.label(glow)
|
|
65
|
+
if n:
|
|
66
|
+
sizes = ndi.sum(glow, lab_, range(1, n + 1))
|
|
67
|
+
big = np.isin(lab_, 1 + np.where(sizes > 0.01 * sil.sum())[0])
|
|
68
|
+
win_m = ndi.binary_fill_holes(ndi.binary_dilation(big, iterations=4))
|
|
69
|
+
# fill also the box spanned by the glow (bottles split it into bands)
|
|
70
|
+
if win_m.any():
|
|
71
|
+
ys, xs = np.where(win_m); win_m[ys.min():ys.max() + 1, xs.min():xs.max() + 1] = True
|
|
72
|
+
keep &= ~win_m
|
|
73
|
+
lab_, n = ndi.label(rust)
|
|
74
|
+
for i, sl in enumerate(ndi.find_objects(lab_), 1):
|
|
75
|
+
if sl is not None and (sl[0].stop - sl[0].start) * mpp > 0.20:
|
|
76
|
+
rust[sl][lab_[sl] == i] = False
|
|
77
|
+
return chip & keep, rust & keep, grime & keep, keep
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def summarise(mask, area, mpp):
|
|
81
|
+
lab_, n = ndi.label(mask); out = []
|
|
82
|
+
for sl in ndi.find_objects(lab_):
|
|
83
|
+
h = (sl[0].stop - sl[0].start) * mpp * 100; w = (sl[1].stop - sl[1].start) * mpp * 100
|
|
84
|
+
if max(h, w) >= 0.6:
|
|
85
|
+
out.append((h, w))
|
|
86
|
+
if not out:
|
|
87
|
+
return {"count": 0}
|
|
88
|
+
s = np.array([max(h, w) for h, w in out])
|
|
89
|
+
return {"count": int(len(s)), "size_cm_p10_p50_p90_max": [round(float(np.percentile(s, q)), 1) for q in (10, 50, 90)] + [round(float(s.max()), 1)],
|
|
90
|
+
"small_lt2cm": int((s < 2).sum()), "medium_2_5cm": int(((s >= 2) & (s < 5)).sum()), "large_ge5cm": int((s >= 5).sum())}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def measure(region, chip, rust, grime, mpp):
|
|
94
|
+
area = region.sum()
|
|
95
|
+
if area < 50:
|
|
96
|
+
return None
|
|
97
|
+
return {"chip_pct": round(100 * (chip & region).sum() / area, 1), "rust_pct": round(100 * (rust & region).sum() / area, 1),
|
|
98
|
+
"grime_pct": round(100 * (grime & region).sum() / area, 1),
|
|
99
|
+
"chips": summarise(chip & region, area, mpp), "drips": summarise(rust & region, area, mpp)}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
res = {}
|
|
103
|
+
for v in M.VIEWS:
|
|
104
|
+
p = src / f"{v}.png"
|
|
105
|
+
if not p.exists():
|
|
106
|
+
continue
|
|
107
|
+
img = normalise(M.load(p)); sil = M.mask_of(img); y0, y1, x0, x1 = M.bbox(sil); mpp = H / (y1 - y0)
|
|
108
|
+
sil = ndi.binary_erosion(sil, iterations=3)
|
|
109
|
+
chip, rust, grime, keep = masks(img, mpp, sil)
|
|
110
|
+
rv = {}
|
|
111
|
+
for z, (a, b) in Z["bands"].items():
|
|
112
|
+
reg = np.zeros_like(sil); reg[max(int(y1 - b / mpp), 0):int(y1 - a / mpp)] = True
|
|
113
|
+
r = measure(reg & keep, chip, rust, grime, mpp)
|
|
114
|
+
if r: rv[z] = r
|
|
115
|
+
if v == "front":
|
|
116
|
+
cx = (x0 + x1) / 2
|
|
117
|
+
for z, (xa, xb, a, b) in Z.get("front_rects", {}).items():
|
|
118
|
+
reg = np.zeros_like(sil); reg[int(y1 - b / mpp):int(y1 - a / mpp), int(cx + xa / mpp):int(cx + xb / mpp)] = True
|
|
119
|
+
r = measure(reg & keep, chip, rust, grime, mpp)
|
|
120
|
+
if r: rv[z] = r
|
|
121
|
+
res[v] = rv
|
|
122
|
+
name = "concept" if src == ROOT / "reference/crops" else src.name
|
|
123
|
+
(ROOT / "out").mkdir(exist_ok=True)
|
|
124
|
+
(ROOT / f"out/wear_stats_{name}.json").write_text(json.dumps(res, indent=1))
|
|
125
|
+
for v, rv in res.items():
|
|
126
|
+
print(f"\n[{v}] zone chip% rust% grime% chips n (S/M/L) size p10/p50/p90/max cm rust comps n")
|
|
127
|
+
for z, r in rv.items():
|
|
128
|
+
c, d = r["chips"], r["drips"]
|
|
129
|
+
cs = f"{c['count']:3d} ({c['small_lt2cm']}/{c['medium_2_5cm']}/{c['large_ge5cm']}) {c['size_cm_p10_p50_p90_max']}" if c["count"] else " 0"
|
|
130
|
+
print(f" {z:14s} {r['chip_pct']:5.1f} {r['rust_pct']:5.1f} {r['grime_pct']:5.1f} {cs:42s} {d['count']}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: concept-scene-builder
|
|
3
|
-
description: Build a game environment scene (terrain, water, roads, vegetation, rocks, buildings, lighting; no units or vehicles) that matches a concept image or screenshot as closely as possible in style and layout, from a reusable asset kit and data-driven layout. Any genre, grid or free-form. Godot or Three.js + Blender. Use when a game needs its environment rebuilt from a concept image or screenshot.
|
|
3
|
+
description: Build a game environment scene (terrain, water, roads, vegetation, rocks, buildings, props, lighting; no units or vehicles) that matches a concept image or screenshot as closely as possible in style and layout, from a reusable asset kit and data-driven layout. Decomposes the scene into objects and builds the hero/mid objects through an object conveyor (a pilot object approved by the owner, a scene style file, then the rest in parallel via concept-asset-builder), then assembles the scene and runs the look pass. Any genre, grid or free-form. Godot or Three.js + Blender. Use when a game needs its environment rebuilt from a concept image or screenshot.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Concept Scene Builder
|
|
@@ -18,6 +18,7 @@ Units, mechs, characters and vehicles visible in the concept are NOT built. Igno
|
|
|
18
18
|
- Python 3 with Pillow and numpy: `python3 -m pip install Pillow numpy`; verify with `python3 -c "import PIL, numpy"`.
|
|
19
19
|
- Godot 4 or Three.js (Node, Playwright for captures), and Blender 4.2 or later for kit assets. Find Blender as `blender` on PATH, the `BLENDER` environment variable or the standard install location (macOS: `/Applications/Blender.app/Contents/MacOS/Blender`) and verify with `--version`; only when none works, build everything in-engine at lower fidelity.
|
|
20
20
|
- A real display/GPU for captures (`--headless` Godot does not render).
|
|
21
|
+
- Optional: the `concept-asset-builder` skill for the object conveyor (5.0): one object to concept fidelity with an independent review loop and a scene style file. Without it, `asset` entries are built as Blender assets.
|
|
21
22
|
- Optional: the `art-direction-pass` skill. It shares the `docs/art/` format, provides `compare.py`, the capture harness and the look pass (Phase 6). Without it, use the fallbacks named in each phase.
|
|
22
23
|
- The skill's resources, installed with it under `.claude/skills/concept-scene-builder/` (other tools use their own skills directory): `scripts/grid_overlay.py`, `scripts/crop.py`, `scripts/blend.py`, `references/field-lessons.md`. Invoke the scripts by path from the project root, so relative outputs land in the project.
|
|
23
24
|
|
|
@@ -104,7 +105,8 @@ Every signature trait must be implemented and verified before the scene counts a
|
|
|
104
105
|
}
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
- `build`: `engine` (tiles or terrain meshes, ground surfaces, grass/scatter, water, road and river surfaces, simple cliffs), `blender` (trees, rocks, buildings, ruins, bridges, complex props), `shader` (surface-only effects).
|
|
108
|
+
- `build`: `engine` (tiles or terrain meshes, ground surfaces, grass/scatter, water, road and river surfaces, simple cliffs), `blender` (trees, rocks, buildings, ruins, bridges, complex props), `shader` (surface-only effects), `asset` (an object the viewer looks at closely — street furniture, machines, signs, shop fronts, hero props: built through the object conveyor, 5.0, with the `concept-asset-builder` skill).
|
|
109
|
+
- Large objects (a shop, a station, a house with a porch) are decomposed: a parent entry with `"parts": ["shop_building", "shop_awning", "shop_shelves", "shop_counter", ...]` and an `assembly` block (part ids with positions/rotations in the parent's metres). Every part is its own kit entry (usually `asset`) and gets its own sheet; decompose recursively until each part is one object a sheet can describe in 5 views.
|
|
108
110
|
- `dimensions`: relative to the tile for grid concepts, in metres for free-form concepts.
|
|
109
111
|
- `category`: terrain / architecture / props / vegetation / vfx — same categories as `art-direction-pass`.
|
|
110
112
|
- Derive the list from the kit sheet AND the scene concept: anything visible in the scene must exist in the kit.
|
|
@@ -208,6 +210,15 @@ If the user is present: show signature traits, the kit list, the overlay image,
|
|
|
208
210
|
|
|
209
211
|
## 5. Phase 4 — Build the kit
|
|
210
212
|
|
|
213
|
+
### 5.0 Object conveyor (`build: asset`)
|
|
214
|
+
|
|
215
|
+
Objects the viewer looks at closely are built one by one to concept fidelity with the `concept-asset-builder` skill, in one shared style. The conveyor gets early owner feedback on ONE object and then runs the rest without the owner. Without that skill, build `asset` entries as Blender assets (5.3) and keep the pilot and style-file steps.
|
|
216
|
+
1. **Sheets.** Each `asset` entry needs an asset sheet (5 views + detail on a plain background). Cut it from the kit sheet if there is one; otherwise generate it from the scene crop in the layout and rendering style of an approved sheet (concept-asset-builder 1.2). Keep all sheets of a scene visually consistent (same background, light, weathering language).
|
|
217
|
+
2. **Pilot.** Pick one object of medium complexity with a high screen share and the scene's typical materials (not the simplest, not the hardest). Build it with concept-asset-builder in pilot mode. Show it to the owner (concept | result per view, close-ups); record every remark that generalises into `docs/art/style/<scene>_style.md` (numbered rules with reasons). Iterate until the owner accepts the pilot. Do not start other assets before this: every remark on the pilot would otherwise be repeated on every object. Unattended: build the pilot, record the open questions in `kit.md`, and continue with the style file the pilot's reviews produced.
|
|
218
|
+
3. **Conveyor.** Run the remaining `asset` entries through concept-asset-builder in parallel (one builder agent or session per object and engine, each on its own files), each with: its sheet, the scene style file, the pilot's code as the style library, the shared frozen studio. Each object goes through its own review rounds. Show the owner results in batches with a line-up next to the pilot at true relative scale; new general remarks go into the style file for the next objects (re-run earlier objects only if the owner asks).
|
|
219
|
+
4. **Composite objects.** Build the parts of a decomposed object through the conveyor, then assemble them from the `assembly` block, and check the whole (contact, gaps, scale between parts, defect pass 5.4) before it enters the scene.
|
|
220
|
+
5. Finished assets export as GLB (concept-asset-builder Phase 7: bake per part, join after) into the kit with their kit id; the scene builder places them like any other kit asset.
|
|
221
|
+
|
|
211
222
|
Before the first iteration of an asset, read its section in `references/field-lessons.md` (rules and recipes from
|
|
212
223
|
real runs: grass, roads, water, trees, buildings, light, performance, porting between engines).
|
|
213
224
|
|
|
@@ -227,7 +238,7 @@ For each asset, up to `max_asset_iterations`:
|
|
|
227
238
|
5. Run the defect pass (5.4) on the result. Fix what it finds before anything else; never report an iteration that has not passed it.
|
|
228
239
|
6. Log in `docs/art/kit.md`: status (draft / matched / accepted with gaps), remaining differences, which defect checks ran.
|
|
229
240
|
|
|
230
|
-
For assets with high screen share, also run a fresh blind reviewer (a subagent, or a separate session when the tool has none; reference, close crops, the defect checklist and the render only) before marking them matched; guard its verdict with metrics measured on the same crops (luminance quantiles, hue/value of the region, share of each feature such as dust or cracks, element counts). If the user reviews the renders themselves and asks for no subagents, skip the reviewer, never the defect pass.
|
|
241
|
+
For assets with high screen share, also run a fresh blind reviewer (a subagent, or a separate session when the tool has none; reference, close crops, the defect checklist and the render only) before marking them matched; guard its verdict with metrics measured on the same crops (luminance quantiles, hue/value of the region, share of each feature such as dust or cracks, element counts). `asset` entries get their review loop from concept-asset-builder (5.0) instead. If the user reviews the renders themselves and asks for no subagents, skip the reviewer, never the defect pass.
|
|
231
242
|
|
|
232
243
|
### 5.2 Engine-procedural assets
|
|
233
244
|
|
|
@@ -264,6 +275,8 @@ In the report, say what was checked and what was found; list anything left unfix
|
|
|
264
275
|
|
|
265
276
|
## 6. Phase 5 — Assemble the golden scene
|
|
266
277
|
|
|
278
|
+
Assemble only after the pilot is accepted and the conveyor objects have passed their reviews; the final light/shadow/post pass (Phase 6) happens on the assembled scene, never per object.
|
|
279
|
+
|
|
267
280
|
1. Build the concept layout with the scene builder.
|
|
268
281
|
2. Capture `concept_view`; make a side-by-side sheet and a 50% blend with the concept.
|
|
269
282
|
3. Fix LAYOUT errors first (wrong cell types or regions, heights, path routes, missing or misplaced objects), then proportions of assets in context, only then style.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-manifesto-kit",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "CLI to discover and adopt Agent Manifesto Kit capabilities (skills, agents, pipelines) into your project for Claude, Codex, or AI-agnostic targets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|