Mesh polish host add-on for generated meshes; headless intent runner; turntable recipe #22
Loading…
Reference in a new issue
No description provided.
Delete branch "nibu/fable-mesh-polish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tools for polishing meshes made by image-to-3D generators (Tripo and its kin), built while polishing two Tripo hulls through Brokkr. Not merged by the author: Self routes Soul.
Soul's first pass falsified this PR at
0921bec; the three commits after it are the fix batch (see "After Soul's pass").What is added
surfaces/blender/brokkr_mesh_polish/: a host add-on (it imports nothing from Brokkr;brokkr_actions.jsonis its contract). Seven rows:audit: triangles, welded topology (open and non-manifold edges, shells), triangles wound against their shading normals, UV islands, mirrored-texture triangles, overlap, coverage, texel density.repair: weld (UV seams keep their UVs), drop degenerate, loose and small-shell geometry, fill small holes. It turns no face and carries the custom shading normals through;recalc_normalsandsharp_angleare opt-in.orient: principal axes, centre, scale for a root and its descendants (or the scene), baked into the mesh data; parents and pivots are kept; reports mirror error per axis.delight: undo lighting baked into the base colour texture, as far as shading normals and ambient occlusion explain it (upper-envelope fit per hue cluster).pick: the surface point at (u, v) of a camera's frame, so a place seen in a render can be named to another action.scrub_markings: paint out baked lettering inside a world-space sphere.cut_parts: cut one fused skin into named parts grown from seeds along concave creases; cap both sides; root each part at its cut and parent it to the body; optional ball joint.surfaces/blender/tools/run_intents.py: run a JSON list of intents in a background Blender throughBrokkrBlenderTarget.run_intent; receipts to a file.surfaces/blender/tools/private_dirs.py: the guard both it and the live test use. It refuses unless the threeBLENDER_USER_*variables point outside a person's own Blender folders and Blender is really using them.surfaces/blender/tools/turntable_recipe.py: write such a recipe from Brokkr's own scene actions for an orthographic turntable.surfaces/blender/docs/mesh-polish.md: each action, its report, and what it cannot do.After Soul's pass
repairranrecalc_face_normalsunconditionally; on two further Tripo hulls it reversed 4,565 of 23,341 and 15,735 of 28,426 triangles, which a single-sided material culls.repairnow leaves every winding alone;recalc_normalsis opt-in and reportswindingFlipped.cut_partshad the same call and lost it too. Welding also shifted the custom shading normals (Blender stores them against each corner's automatic normal): they are now carried through weld, fill and cut as plain directions and set back.delightreads those shading normals, not winding-derived ones. The live test's sphere is torn, half inside out under outward custom normals, and fails on0921bec; withBROKKR_POLISH_HULLSthe test also repairs real hulls (three Tripo GLBs here: 0 faces turned on each).object_namescopes it to a root and its descendants; every object keeps its parent and its pivot.uvFlippedTrianglesis replaced bywindingAgainstNormalsanduvMirroredTriangles(texture parity against the shading normals).delight's limit on a smooth fade that follows the normal is documented (it keeps 0.35 of the slope), not mitigated. The private-directory guard checks where the variables point and what Blender uses.cut_parts; new faces borrowed their neighbours' shading normals.Structural delta
3,645 lines added, none removed; no built-in action, schema, Rust or C# change, no new dependency (numpy is Blender's own). The add-on is a new owned surface: owner Brokkr's Blender surface, consumer agents polishing generated hulls, and it exists as a host add-on because the action table admits no free Python.
run_intents.pyis a second way to send intents beside the CultMesh node. It delegates admission torun_intentand keeps no opinion of its own, but its receipts are not in any node: that is the liability, stated in its docstring.Proof
python -m unittest discover -s surfaces/blender/tests: 403 tests, OK (20 skipped as before).test_mesh_polish.pyhas 45: the arithmetic, the host file againstaction_table.check_host, the guard, and the turntable recipe against the action table. Bounds followlodur:ruling:deterministic-bound-margin.tests/live/mesh_polish.pyin background Blender 5.3.0 with private user directories: 40 checks, 43 with three real hulls, all ok (mesh_polish.result.json).The two hulls, before and after
Known limits
cut_partsdepends on seed placement; cuts follow triangle edges and are ragged on a coarse mesh.delightcannot recover texels the generator left black, cast shadows or highlights, and flattens a smooth fade of one hue that follows the normal.repairdoes not close a mesh assembled from open intersecting shells, and does not correct the faces a generator wound against their normals: it reports them.🤖 Generated with Claude Code