elliottshort/mosby/blender-session

Claude Code and agent skill by elliottshort/mosby

Trust tier 2
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Guides any work in a Mosby job that touches Blender itself - a live Blender over MCP (execute_blender_code), a headless `blender -b` run, a render queue or render batch, a checkpoint, rollback or transaction, a crash, timeout or stalled bridge, a port or scene mix-up, dirty state not matching the saved file, or a Blender API error (boolean modifier, float32 mesh proof, empty material slots after save, join losing UVs, sky node TypeError). Use it before the first execute_blender_code of a sessio…

Install

npx vskill@latest install elliottshort/mosby/blender-session

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as elliottshort/mosby/blender-session.

Blender session: identity, transactions, render queues, gotchas

You are driving Blender 5.2 for a Mosby job. The job folder holds job.json (block blender: target, file, scene, port), model.blend, .mosby/ (checkpoints, acts, transactions) and renders/. The house run lost only ~5 % of its 119 iterations to infrastructure, but every event was expensive: two Blenders on one port, one crash (11 min down + 8 views re-rendered), four full re-render generations (~1 h GPU each), six rolled-back applies. This skill makes those events impossible or cheap. Long API tables live in reference.md; read it when an error names a symptom.

0. What the hooks already enforce (know it exists; do not re-implement it)

guard_blender.py rewrites every execute_blender_code payload (runpy scripts included): identity preamble on file, scene and running render; auto-checkpoint into .mosby/checkpoints/ at session start and after 10 min of quiet; in a live target it blocks read_homefile, read_factory_settings, quit_blender and open_mainfile without # mosby: reload, and only WARNS on MATERIAL/RENDERED shading, BOOLEAN modifiers and object.join. Counters, Stop gate, gate-before-build and protected folder deletes are hooks too (skills/mosby/reference.md C). Mark non-mutating snippets # mosby: read-only.

1. Identity: which Blender, which file, which scene

  1. Read job.json -> blender.target (headless default, or live), blender.file,

blender.scene, blender.port (default 9876). File + scene + port + pid are the session identity. The preamble asserts file and scene on every call; you assert port and pid once per session with mosby blender probe. <!-- FC-H01 --> Why: the house Blender shared port 9876 with an unrelated job and twice held a fresh default 'Scene' with 3 objects minutes after a house script had "run".

  1. One MCP-enabled Blender per job, one port per Blender. The add-on's port and autostart are USER

preferences (userpref.blend) shared by every Blender launched with that config: never set addon.preferences.port to get a second instance. Launch the job's Blender through mosby blender run (starts the add-on server on blender.port at launch, records the pid) and give the MCP server process BLENDER_MCP_PORT=<port>. <!-- FC-H01 --> Why: iter_101 pinned port 9877 in preferences; every later Blender would have inherited it.

  1. The job file is the main file: bpy.data.filepath == blender.file before the first mutation.

bpy.data.libraries.write is export-only, never a save or checkpoint (filepath stays empty, unreferenced dependencies are dropped, no UI is saved). Checkpoints use save_as_mainfile(copy=True, compress=True) or llm.save_copy(path); the delivery save uses save_as_mainfile without copy. <!-- FC-H02 --> Why: the house live session ran 3 h with original_filepath == ''; a crash would have lost it all.

  1. One production scene per .blend, named blender.scene. Never bpy.data.scenes.new inside the job

file; asset previews and review scenes go to a separate .blend. <!-- FC-H13 --> Why: 10 coexisting scenes produced .001/.002 suffixes on canonical objects and leaking shared meshes.

  1. mosby blender probe reads Blender window titles (<name> [<path>] - Blender 5.2.x), flags

dialog-sized windows (< 500x400 px), TCP-checks only the job port and never executes code in another job's Blender. Run it at session start, before the first mutation, and on any timeout. <!-- FC-H14 -->

2. Headless by default, live for viewing

  • blender.target: headless: every mutation runs as blender -b model.blend --python <script>

through mosby build shell|finishes|interior, mosby audit <name> or mosby blender headless <script>. The user's live Blender, if any, only VIEWS the result. After a headless apply, reload the live session with a payload whose LAST lines are: <!-- FC-H03 --> ``python # mosby: reload bpy.ops.wm.open_mainfile(filepath=MODEL, load_ui=False) for w in bpy.context.window_manager.windows: w.scene = bpy.data.scenes[SCENE] ` Do not touch bpy.context.window` in the same tick; it is None until the timer returns. <!-- FC-H17 --> Why: headless applies cannot crash the user's viewport and cannot dirty the live file; the house Eevee crash and the iteration-119 live-vs-saved audit both came from mutating live.

  • execute_blender_code_for_cli(blend_file, code) is the MCP form of a headless call: it runs

code on a synced copy in blender --background; no identity preamble, no deferred replies. <!-- FC-H05 -->

  • blender.target: live is for a user who wants to watch. Live mutations are allowed only inside the

transaction of section 4 and only after mosby blender safe-mode (every VIEW_3D to SOLID, no RENDER job, probe recorded). <!-- FC-H03 -->

  • Put mutation code in <job>/scripts/<phase>_<subgoal>_<n>.py and run it with

mosby blender run <script> or paste the file body into the payload. Never hide a mutation behind runpy.run_path(...) in a 3-line payload: the acts log hashes only the payload text, so the history loses the script. <!-- FC-G07 --> Why: almost every house mutation ran via runpy; the guard now lints those scripts, the acts log still cannot.

  • Scripts read every number from the job (job.json, plan_<level>.json, decisions.md, the

audit report they check against): no coordinates, object names or expected counts typed into a script or into tools/mosby; an assert len(x) == N names the report field N came from. <!-- FC-H18 --> Why: the house library hard-coded camera coordinates, garage door ids and len(family) == 105 style asserts, so none of it could run on a second building.

3. Observe cheaply before and after (the llm helper module)

import llm works in any payload (installed in Blender's scripts/modules). The cheap loop:

python
# mosby: read-only
import llm
r = llm.scene_report() # file, scene, dirty flag, engine, object/poly counts
s = llm.snapshot() # ... run the mutation in ANOTHER payload, then:
d = llm.diff(s) # added/removed/changed objects with the changed fields
m = llm.mesh_check("WALL_L1_012") # non-manifold, zero-area, loose, normals, watertight
p = llm.capture_viewport(direction="ISO", shading="SOLID")["path"] # then Read the PNG
  • llm.capture_viewport / llm.turntable are OpenGL grabs: seconds, no render job. Keep them in

SOLID in a live session; shading="MATERIAL" switches the viewport to Eevee (section 6). <!-- FC-H03 -->

  • llm.render(path, samples=16, size=(960, 540)) is a synchronous Cycles render that restores

settings afterwards; keep it under ~60 s so the 300 s MCP timeout never matters. Anything bigger goes through the render queue (section 6). <!-- FC-H05 -->

  • llm.save_copy(path) is the checkpoint primitive (copy=True, filepath unchanged). <!-- FC-H02 -->
  • llm.describe(name) shows data_users, custom properties and material slots of one object;

llm.history() lists what the bridge ran. <!-- FC-H13 --> A capture, render or image Read is the observation the hooks count; make one after every mutating act, before the next. <!-- FC-G07 -->

4. Every mutation is a transaction

The order is fixed. A mutation that skips a step is "generated, unverified", never "built".

  1. Bind: identity (preamble or mosby blender probe); input_sha = sha256(model.blend); in a live

session also require scene_signature(live) == signature of the last save receipt (section 5). <!-- FC-H07 -->

  1. Checkpoint: .mosby/checkpoints/<label>_<input_sha[:12]>_<utc>.blend via

save_as_mainfile(copy=True, compress=True) (live) or a byte copy (headless). Assert the path did not exist. <!-- FC-H08 --> Why: direct overwrites (iter_24/29) left no way back; sha-named checkpoints made 6 rollbacks clean.

  1. Dry-run: run the same script headless on an UNSAVED copy in simulate mode

(mosby blender headless <script> with its simulate flag) and require the receipt UNSAVED_SIMULATION_PASS bound to input_sha. Mandatory when the transaction replaces existing meshes or touches more than 50 objects (job.json tx.simulate_threshold); small additive changes may rely on the in-memory backups plus the checkpoint. <!-- FC-H08 --> Why: stage/dry-run caught all 8 mesh-validity failures of the house before any save.

  1. Apply: take in-memory backups (ob.data pointers, matrices, custom props, material slot links,

scene props); tag every created object mosby_transaction=<id>; guard idempotency with a key in the scene property mosby_revisions (JSON dict) and raise if it is already set. Retire a replaced mesh with use_fake_user=True, write its name to mosby_previous_mesh, and remove meshes only when users == 0. <!-- FC-H08 --> Why: 26+ bespoke scene['<fix>_revision'] keys and name-based once() checks double-applied moves and produced 151 FURN_*.002 groups. <!-- FC-H12 -->

  1. Post-audits BEFORE saving, scoped to the touched objects: mosby audit mesh_validity (stored

float32 coordinates, section 7), mosby audit material_slots, mosby audit coplanar_faces. Any failure -> step F. <!-- FC-H10 -->

  1. Save (save_as_mainfile, not copy) -> saved_sha.
  2. Saved audit: reopen the saved file headless and run the same audits on it (`mosby audit

material_slots against model.blend`). <!-- FC-E13 --> Why: the live session still resolved dangling material IDs; only the reopened file showed seven empty DATA slots (iteration 103).

  1. Receipt: append one row to .mosby/transactions.jsonl {label, input_sha, checkpoint,

checkpoint_sha, saved_sha, scene_signature_before/after, objects_added/removed, revision_key, status APPLIED}; write it atomically (tmp + os.replace) and only after step 7. <!-- FC-G07 -->

  1. Reload the live viewer (section 2) if one exists. <!-- FC-H07 -->

F. Failure path: restore backups, remove objects tagged with the transaction id, reopen the checkpoint if any datablock leaked, write <label>_failure.json with status FAILED_ROLLED_BACK, the traceback and a failure_category (storage_degeneracy | test_tolerance | geometric_search | audit_fail), then re-raise. Never save partially. Before a retry, sweep orphans by tag and record what was removed. <!-- FC-G07 --> Why: iter_86 left two 6- and 8-vertex gable orphans that iter_90 had to remove by name. Scope rule: a defect found on one object runs its class audit house-wide (mosby audit <name> with no object filter) before the fix transaction is written. <!-- FC-H08 -->

5. Dirty state and the scene signature

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/elliottshort/mosby/blender-session/badge)](https://verified-skill.com/skills/elliottshort/mosby/blender-session)

Something wrong with this skill or its page? Tell us.