
Blender Optics Simulator
io.github.emircbnglPublished by GitHub account emircbnglv0.24.4Updated Oct 24, 2026
Build, align & render a real optical bench in Blender; drivable by an AI agent over MCP.
Overview
Lets an assistant read and drive a Blender optical bench over a localhost bridge: place optics, trace beams, align mounts and render.
- What you can do
- The add-on exposes the full optical state of a Blender scene as JSON over a localhost bridge, and the MCP server lets an agent read that state and act on it. Tools include get_state, set_param, place_relative, set_dof, align_element, ao_close_loop and render. The engine traces rays and Gaussian beams with polarization, dispersion and interference, mounts elements on real opto-mechanics, and renders the result in Cycles or EEVEE.
- When to use it
- Use it when you want an assistant to build, inspect or align optical setups in Blender rather than guess at geometry, for example reproducing example benches such as Michelson or Mach-Zehnder, walking mounts until a beam lands correctly, or closing an adaptive-optics loop.
- Requirements
- Blender 4.2 LTS or newer with the add-on installed, and the MCP bridge started from the Optics panel. The server runs as a local process and connects to the add-on's localhost bridge, configured by the OPTICS_BRIDGE_HOST and OPTICS_BRIDGE_PORT environment variables. Desktop only; no authentication is declared.
Installation
In SourceWeft
- Open Blender Optics Simulator in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Blender Optics Simulator
[CI] [Release] [License: GPL-3.0-or-later] [Blender 4.2+] [DOI]
An optical bench you lay out in Blender, trace with real optics, and can hand to an AI agent.
Place lasers, mirrors, lenses, waveplates, gratings, crystals and detectors in 3-D. A live engine traces the beam through them — rays, Gaussian beams, polarization, dispersion — mounts everything on real opto-mechanics, and renders it in Cycles. The whole optical state is readable and writable over a localhost MCP bridge, so an agent works from measured geometry instead of guesses.
[Sixteen-second tour: a green beam through the add-on's optomechanics, ending on the project title]
Sixteen seconds, rendered from a scene the add-on built. Full-quality MP4.
Install
Requires Blender 4.2 LTS or newer (4.2+ / 5.x).
One-click, keeps itself updated. Open the install page and drag the “⤓ Drag this into Blender to install” button onto an open Blender window. That installs the add-on and subscribes you to updates in one gesture. Turn on Edit ▸ Preferences ▸ System ▸ Network ▸ Allow Online Access first.
From a zip. Download optical_alignment_sim-<version>.zip from
Releases and use Edit ▸ Preferences
▸ Add-ons ▸ Install from Disk…. Updates then come from the add-on's own Updates panel.
Open the Optics tab in the 3-D viewport sidebar (press N).
Quick start
- Setup ▸ Browse Examples… — pick Michelson to get a complete bench.
- Simulate ▸ Trace — press Live. Move any part and the beam follows.
- Setup ▸ Element — select an optic and change what it is: focal length, glass, coating, wavelength. Expand More for the rest.
- Place ▸ Mount & Adjustment — put it on a real mount and turn the knobs, with − / + steps.
- Inspect ▸ Optical Report — read power, polarization, path length and alignment error per detector; Align All walks the mounts until the beam lands where it should.
Headless, the same thing from Python:
examples/ holds runnable scripts: michelson.py,
mach_zehnder.py, agent_align.py,
bell_entanglement.py,
hong_ou_mandel.py.
What it does
- Traces a real beam. Ray paths plus Gaussian-beam propagation, Jones/Stokes polarization, Fresnel losses, dispersion, nonlinear conversion, interference and wavefront error. → what is modelled, and what is not
- 35 element types, 26 one-click benches. Mirrors through OPAs, prisms, gratings, crystals, spectrometers, adaptive optics. → element reference · full feature list
- Mounts on real hardware. Kinematic mounts, posts, cage systems, lens tubes and rails, with mechanical limits and collision checks. → hardware
- Measures like a bench. Detector power and polarization, beam profiles, path length, group delay and GDD, spectra, wavefront sensors. → dispersion, cylinders and spectra
- Aligns itself. Influence-matrix solvers walk the mounts: re-centre a beam, null a tilt, close an adaptive-optics loop.
- Renders what you built. Cycles/EEVEE with detailed optomechanics, animation renders, and SVG schematics. → how beams are drawn
A mirror knocked 2° out of alignment, then one align_element() call: pointing residual 7.02 → 0.0008 mrad. examples/agent_align.py reproduces it headlessly.
Drive it with an AI agent
The add-on exposes its full state as JSON over a localhost bridge and ships an MCP server, so an agent can read the bench and act on it:
Start it from Present ▸ Tools & Integration ▸ Start MCP Bridge. → agent guide · MCP server · tool list
Physics, honestly
Every push runs the physics: 341 textbook checks (Malus, Fresnel, Snell, the grating equation, Gaussian ABCD, Zernike orthonormality, energy conservation) plus a 618-check regression suite on both Blender 4.2 and 5.x. The core formulas were also verified against an external symbolic and numerical oracle; where that has not been done, the code and the docs say so. Every run builds the same benches in millimetre and metre scenes and requires the readouts to agree.
What is not claimed matters as much: this is a chief-ray engine with wave-optics overlays, not a full-wave solver. Thin elements carry no thickness, a grating has no blaze-efficiency model, and anything phenomenological says so where you read it. Model limits are written next to each feature.
→ scope and limits · element-by-element provenance · where the data comes from
Documentation
How to cite
A machine-readable CITATION.cff is included, so GitHub shows a Cite this
repository button with ready-to-paste APA / BibTeX.
The DOI above is the concept DOI and always resolves to the latest version; each release also mints
its own version DOI (listed in CITATION.cff).
License & credits
GPL-3.0-or-later — see LICENSE. Vendor CAD and meshes are not included and remain the
property of their owners; this project ships original metadata, procedural geometry and tooling.
Contributors
- Tengfei Ma — ShanghaiTech University · ORCID 0009-0008-4556-4682 · @Harca-Yita. Reports from a working optical bench in #1 drove wavelength-true beam colours and the shutter, the unit-scale work, shaped apertures, reflection at the coated mirror face, the Porro prism and polished mirror substrates, the OPA and group-delay work, and the groove-oriented grating, cylindrical lens and spectrum detector.
Built in the spirit of Bigweld's maxim from Robots (2005) — "See a need, fill a need."
Source: README.md at commit 2b488e2
Tools
0Version history
1- v0.24.4LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts