--- name: bootstrap description: "Work out which Blender the mesh inspection will use and whether it works: find the install, check its version (tested on 5.2), point the inspector at a newly installed Blender, or diagnose a refusal such as \"blender executable not found\" or \"does not resolve to a file\". Use when an inspection of a .blend refused or picked the wrong Blender, before the first inspection run, or when asked which Blender or version will be used. Not for installing Blender, general Blender scripting or usage, the inspection itself (defects, depth order), or image and Python dependency setup." --- # blender-inspect bootstrap The plugin has no Python dependencies: its `scripts/blender_*.py` wrappers use only the standard library (Python 3.11+) and shell out to Blender. Setup is finding a working Blender. Resolve `` two levels above this file. Missing image or Python packages (OCR, embeddings, SSIM, OpenCV) are a different plugin's bootstrap, not this one. ## Discovery order The first configured source decides, and a value that does not resolve is an error, never quietly replaced by another Blender: 1. `--blender-executable` on the tool 2. the `BLENDER_INSPECT_BLENDER` environment variable 3. `C:/Program Files/Blender Foundation/Blender 5.2/blender.exe` 4. `blender` on `PATH` ## Check Resolve Blender the way every tool does, then ask it for its version: ```sh python3 - <<'PY' import subprocess, sys sys.path.insert(0, "/scripts") import blender_common path, reason = blender_common.resolve_blender_executable(None) print(path or reason) if path: print(subprocess.run([path, "--version"], capture_output=True, text=True, timeout=60).stdout.splitlines()[0]) PY ``` On Windows use `py -3` instead of `python3`. Pass a path instead of `None` to test a specific executable. The plugin is tested with **Blender 5.2**; report any other version and treat results on it as unverified, because render-engine and pass behaviour changes between releases. Finish with a real probe. `blender_mesh.py ` launches Blender with `--factory-startup --background` and reports `blender_version` in its payload, so a success proves the whole path. ## Read a refusal A tool that cannot answer exits **2** with empty stdout and one stderr line. Report that line verbatim; do not infer success. - "blender executable not found; searched ..." means nothing resolved. Ask for the install path, then set `BLENDER_INSPECT_BLENDER` or pass `--blender-executable`. - "does not resolve to a file" names the source that holds the bad value; fix that value rather than falling back to another Blender. - "blend file not found", or a named object that is not a render-visible mesh: fix the input. - A Blender failure line means the `.blend` could not be opened or the probe crashed. Do not retry blindly; report it. ## Boundaries Do not install or download Blender, or edit the user's PATH or environment, without being asked; a status question does not authorise changes. `--factory-startup` is deliberate, so user add-ons and preferences never load; do not remove it. Report the resolved path, the version, and whether the probe ran.