Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage ZeroBlender.package·originates fromworld 240544fe-7…

meshProxy

The bpy mesh data views for the ZeroBlender session: `Mesh`, `MeshVertex`, `MeshPolygon`, `MeshEdge`, `MeshLoop`, UV layers, and the `bmesh` module and `bmesh.ops`. Every sequence (`mesh.vertices`, `mesh.polygons`, `bm.faces`, ...) is a lazy view over the session's meshBuf stores…

by◐Deata·posted 1mo ago
What it does

meshProxy

The bpy mesh data views for the ZeroBlender session: Mesh, MeshVertex, MeshPolygon, MeshEdge, MeshLoop, UV layers, and the bmesh module and bmesh.ops. Every sequence (mesh.vertices, mesh.polygons, bm.faces, ...) is a lazy view over the session's meshBuf stores, so Python scripts read and write vertex positions, face data and UVs in engine buffers without copying the mesh into Luau tables.

Called by blenderSession, which installs it once per session with MeshProxy.install(S, helpers) and uses the returned meshProxy, vertexProxy, faceProxy, edgeProxy, bmeshProxy and bmeshOps.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

bpy mesh-data proxies over meshBuf meshes (Mesh, MeshVertex, MeshPolygon, MeshLoop, MeshEdge, MeshLoopTriangle, UV layers, BMesh and bmesh.ops). Every sequence is lazy: it answers len and item(i), so walking one never builds a list. An item proxy is one small table naming (mesh, index); a value read off it (a co Vector) is one small table the script holds. A mesh record is { name, geo = meshBuf Mesh, materials = {...}, smooth, smooth_angle, proxy }. Edits go straight into geo's substrate stores.

install(S: ?, h: ?) → void

argtypedescription
S?
h?

dirty( ) → void

seq(name: ?, lenFn: ?, at: ?, extra: ?, setf: ?) → void

argtypedescription
name?
lenFn?
at?
extra?
setf?

len( ) → void

at(_: ?, i: ?) → void

argtypedescription
_?
i?

get(k: ?) → void

argtypedescription
k?

iter( ) → void

idList(name: ?, W: ?) → void

argtypedescription
name?
W?

coWrite(V: ?) → void

A Vector over vertex i's position; writes go back to the store.

argtypedescription
V?

coVector(g: ?, i: ?) → void

argtypedescription
g?
i?

uvWrite(V: ?) → void

argtypedescription
V?

nums(v: ?) → void

argtypedescription
v?

faceSmooth(mesh: ?, f: ?) → void

Shading: per-face smooth flags (geo.SMF, one word per face) when faces differ; mesh.smooth when they all agree.

argtypedescription
mesh?
f?

setFaceSmooth(mesh: ?, f: ?, v: ?) → void

argtypedescription
mesh?
f?
v?

setAllSmooth(mesh: ?, v: ?) → void

argtypedescription
mesh?
v?

cornerNormal(mesh: ?, c: ?) → void

Corner normals as Blender reports them: custom split normals when set, smooth faces the vertex normal, flat faces the face normal.

argtypedescription
mesh?
c?

vertSelected(g: ?, i: ?) → void

argtypedescription
g?
i?

get(key: ?, P: ?) → void

argtypedescription
key?
P?

set(key: ?, v: ?, P: ?) → void

argtypedescription
key?
v?
P?

vertexProxy(mesh: ?, g: ?, i: ?, bm: ?) → void

argtypedescription
mesh?
g?
i?
bm?

get(key: ?, P: ?) → void

argtypedescription
key?
P?

set(key: ?, v: ?, P: ?) → void

argtypedescription
key?
v?
P?

faceProxy(mesh: ?, g: ?, f: ?, bm: ?) → void

argtypedescription
mesh?
g?
f?
bm?

get(key: ?, P: ?) → void

argtypedescription
key?
P?

loopProxy(mesh: ?, g: ?, c: ?, bm: ?) → void

argtypedescription
mesh?
g?
c?
bm?

edgeSel(g: ?, e: ?) → void

argtypedescription
g?
e?

get(key: ?, P: ?) → void

argtypedescription
key?
P?

set(key: ?, v: ?, P: ?) → void

argtypedescription
key?
v?
P?

edgeProxy(mesh: ?, g: ?, e: ?, bm: ?) → void

argtypedescription
mesh?
g?
e?
bm?

get(key: ?, P: ?) → void

argtypedescription
key?
P?

triProxy(mesh: ?, g: ?, t: ?) → void

argtypedescription
mesh?
g?
t?

get(key: ?, P: ?) → void

argtypedescription
key?
P?

set(key: ?, v: ?, P: ?) → void

argtypedescription
key?
v?
P?

resetUV(g: ?, L: ?) → void

Blender's default UV for a new first layer: each quad fills 0..1, other n-gons sit on a unit circle.

argtypedescription
g?
L?

layerProxy(mesh: ?, g: ?, L: ?) → void

argtypedescription
mesh?
g?
L?

idx( ) → void

uvLayers(mesh: ?, g: ?) → void

argtypedescription
mesh?
g?

byKey(k: ?) → void

argtypedescription
k?

fromPydata(g: ?, verts: ?, edges: ?, faces: ?) → void

argtypedescription
g?
verts?
edges?
faces?

cornerNormals(mesh: ?, g: ?) → void

argtypedescription
mesh?
g?

meshProxy(mesh: ?) → void

argtypedescription
mesh?

g( ) → void

made(name: ?, mesh: ?, g: ?, ids: ?, kind: ?) → void

A BMesh owns its own meshBuf mesh; to_mesh copies it into a mesh record.

argtypedescription
name?
mesh?
g?
ids?
kind?

selFromGeom(geom: ?) → void

argtypedescription
geom?

bmeshProxy(mesh: ?) → void

argtypedescription
mesh?

G( ) → void

bmOf(a: ?, kw: ?) → void

argtypedescription
a?
kw?

faceSet(g: ?, list: ?) → void

argtypedescription
g?
list?

emit(f: ?, cs: ?) → void

argtypedescription
f?
cs?

mk(lo: ?, hi: ?) → void

argtypedescription
lo?
hi?

v(k: ?) → void

argtypedescription
k?

ms(k: ?) → void

argtypedescription
k?

face(list: ?) → void

argtypedescription
list?

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

8+items
▣
module · born here
❒asset
# meshBuf Polygon meshes kept entirely in substrate (engine) memory, for ZeroBlender documents and every algorithm that edits them. No mesh-sized Luau table is ever built: every array is a CPU substrate buffer read and written in place. ## Stores - `M.words(n, fill?)` -> `W`: n numbers. `:get(i)`, `:set(i,v)`, `:add(i,v)`, `:push(v)`, `:resize(n,fill?)`, `:reserve(n)`, `:fill(v)`, `:copy()`, `:free()`; field `.n`. Indices are 0-based. Integers are exact below 2^24. - `M.vec3s(n)` -> `V3`: n xyz records. `:get(i)->x,y,z`, `:set(i,x,y,z)`, `:add(i,x,y,z)`, `:push(x,y,z)`, `:zero()`, `:copy()`, `:free()`. - `M.hash(arity, expected?)` -> `Hash`: integer keys (1-3, each in [0,2^24)) mapping to a number. `:get(a,b?,c?)`, `:put(v,a,b?,c?)`, `:each(fn(v,a,b,c))`, `:free()`; field `.n`. ## Mesh (`M.new()`) Fields: `P` (V3 positions, `nv`), `C` (W corner vertex ids), `O` (W face offsets, `nf+1` words), `FM` (W material slot per face, or nil), `UV` (list of `{name, W}`, two words per corner; `uvActive`/`uvRender` 1-based), `LE` (W loose edges, 2 words each), `SEL` + `selMode`, `ver` (bumped by every edit). Reading: `co(i)`, `faceStart(f)`, `faceEnd(f)`, `faceLen(f)`, `corner(c)`, `faceMat(f)`, `uv(layer,c)`, `faceNormal(f)`, `faceNormalRaw(f)`, `faceCenter(f)`, `faceArea(f)`, `bounds()`, `triangleCount()`, `signedVolume()`, `looseCount()`, `isSel(i)`. Writing: `addVert(x,y,z)`, `setCo`, `pushCorner(v)` then `closeFace(slot?)`, `setCorner`, `setFaceMat`, `addUVLayer(name,init?)`, `setUV`, `removeUVLayer`, `addLooseEdge(a,b)`, `setSel`, `clearSel`, `reverseFace(f)`, `filterFaces(keep)`, `compactVerts()`, `append(src,T,remap,flip)`, `clearFaces()`, `clear()`, `copy()`, `assign(src)` (takes src's stores), `free()`. ## Derived data - `M.edges(m)` -> unique undirected edges, numbered in (low, high) vertex order: `.n`, `:verts(e)`, `:find(a,b)`, `:faceCount(e)`, `.CE` (edge of corner c -> c+1). Cached until `m.ver` changes. - `M.vertexCorners(m)` -> `{off, vc, cf}` CSR: the corners of vertex v are `vc[off[v] .. off[v+1])`, `cf[c]` is the face of corner c. Call `:free()`. - `M.triangulate(m)` -> `T` (3 corner ids per triangle), `TF` (face per triangle). Quads and n-gons ear-clipped against the face normal. - `M.vertexNormals(m)`, `M.cornerNormalsByAngle(m, angle)` -> V3. - `M.weldIds(m, tol)`, `M.audit(m)`. ## Drawing and saving - `M.upload(m, slot|nil, "flat"|"smooth"|"angle", normals?, name)` builds GPU vertex and index buffers and a renderer mesh from them (Zero basis x, z, -y). `M.release(up)` frees them. - `M.save(m)` -> blob string, `M.load(blob, uvNames)` -> Mesh. ```luau local MB = require("~ZeroBlender.modules.meshBuf") local m = MB.new() for _, p in { {0,0,0}, {1,0,0}, {0,1,0} } do m:addVert(p[1], p[2], p[3]) end m:pushCorner(0); m:pushCorner(1); m:pushCorner(2); m:closeFace() local up = MB.upload(m, nil, "flat", nil, "tri") ```
▲ 0↑ born
❒
package · born here
❒asset
# ZeroBlender Blender-style modeling inside Zero. Install this package and you get the whole surface: the `.zblend` document type, the tools that edit it, the Python/bpy runtime behind them, the layer previews live in, and the workflow that drives a modeling job to the end. ## Contents | Path | What it is | |---|---| | `zblend.assetType/` | The `.zblend` document (Zero's `.blend`): editable `scene.json`, history, images, and a live `output.bundle`. Scene-instantiable, previewed, searchable. Its ref methods open and edit documents (below); `M.modules` exposes every module here to instances. | | `blender.toolbox/` | Blender MCP-compatible tools: `execute_blender_code`, `get_scene_info`, `get_object_info`, `get_viewport_screenshot`, `bpy_api_lookup`, `get_addon_status`, `compare_to_reference`. `api.json` is the implemented bpy surface. | | `modules/blenderSession` | The bpy/bmesh/mathutils session: objects, meshes, modifiers, materials, viewport, flush to the document and bundle. | | `modules/pythonParser`, `pythonRuntime` | The Python subset the scripts run in (Luau-hosted, not CPython). | | `modules/animation`, `rigging` | Armatures, pose, vertex groups, ARMATURE deform, auto weights, keyframes/actions/F-Curves, constraints, IK, drivers, NLA; clip baking. | | `modules/sceneOps` | Empties, duplicates, collections, collection instances, `zero_instance`, `origin_set`, cursor, snapping. | | `modules/curves`, `meshOps`, `polygonTopology`, `xform` | Curve/text meshing, edit-mode operators, topology and evaluation, matrix math. | | `modules/referenceCompare` | Silhouette scoring against a reference image. | | `modules/bpy`, `hardSurface`, `kestrel` | Older core geometry layer and hard-surface helpers used by the session. | | `workspace/ModelingWorkspace.scene` | Additive layer holding document previews, on render layer `modelingWorkspace` (hidden from the editor camera, drawn by screenshots). | | `model.workflow/` | Multi-pass modeling job: reference → model → critic/builder rounds → finish. | | `modeling.agentSkill/` | The `modeling` skill that starts the workflow. | ## Usage ```luau -- Make or open a document and edit it local doc = asset.create("zblend", "Lantern", { folder = "models" }) doc:run([[import bpy bpy.ops.mesh.primitive_cylinder_add(radius=0.1, depth=0.3)]]) doc:screenshot("ISO") doc:sceneInfo() doc:open() -- load as a live session, returns its name -- Place it (live: placed copies follow edits and play its clips) doc:instantiate(entity.find("Shelf")) -- Frozen copy doc:exportBundle("/zero/source/models/Lantern_v1.bundle") ``` Agents use the `blender` toolbox directly with `session="<folder>/<Name>"`, or start the `model` workflow for a full modeling job (`zero workflow start --name model --args '{"subject":"..."}'`). Documents default to `modeling/models/<name>.zblend`; user data (models, references, reports) is not part of the package.
▲ 0↑ born
backing path · ZeroBlender.package/modules/meshProxy.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.