# stuffmatic/fspy-blender architecture

> Architecture diagram of the GitHub repository stuffmatic/fspy-blender, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stuffmatic/fspy-blender
- Repository: https://github.com/stuffmatic/fspy-blender

## Overview

fSpy Blender is an add-on that imports an fSpy project into Blender, producing a camera configured from the project and optionally using its image as a camera background. The documented workflow starts in Blender’s File > Import menu; the importer parses the project before configuring Blender objects. The parser and importer are the principal runtime modules. The excerpt shows camera setup and background-image handling, but omits the importer’s remaining calls, so uncertain links to those operations are marked dashed.

Main entry points: [`fspy_blender/addon.py`](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py) (Import operator), [`fspy_blender/__init__.py`](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/__init__.py) (Menu registration), [`fspy_blender/fspy.py`](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/fspy.py) (Project parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Blender Integration"]
  node_menu_registration["Menu registration<br/>[__init__.py]"]
  node_import_operator["Import operator<br/>[addon.py]"]
  node_camera_setup["Camera setup<br/>[addon.py]"]
  node_render_resolution["Render resolution<br/>[addon.py]"]
  node_background_image["Background image<br/>[addon.py]"]
  node_scene_units["Scene units<br/>[addon.py]"]
end

subgraph group_project["Project Import"]
  node_project_parser["Project parser<br/>[fspy.py]"]
end

node_user(("Blender user"))
node_blender["Blender"]

node_user -->|"selects import"| node_blender
node_blender -->|"registers add-on"| node_menu_registration
node_menu_registration -->|"adds menu item"| node_import_operator
node_import_operator -->|"parses project"| node_project_parser
node_import_operator -->|"configures camera"| node_camera_setup
node_import_operator -.->|"sets resolution"| node_render_resolution
node_import_operator -.->|"loads image"| node_background_image
node_import_operator -.->|"sets units"| node_scene_units
node_camera_setup -->|"creates or updates"| node_blender
node_background_image -->|"loads image data"| node_blender

click node_menu_registration "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/__init__.py"
click node_import_operator "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py"
click node_camera_setup "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py"
click node_render_resolution "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py"
click node_background_image "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py"
click node_scene_units "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py"
click node_project_parser "https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/fspy.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu_registration,node_import_operator,node_camera_setup,node_render_resolution,node_background_image,node_scene_units,node_user toneBlue
class node_project_parser toneAmber
class node_blender toneIndigo
```

## Components

### Blender Integration

- [Menu registration](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/__init__.py): `fspy_blender/__init__.py`
- [Import operator](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py): `fspy_blender/addon.py`
- [Camera setup](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py): `fspy_blender/addon.py`
- [Render resolution](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py): `fspy_blender/addon.py`
- [Background image](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py): `fspy_blender/addon.py`
- [Scene units](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/addon.py): `fspy_blender/addon.py`

### Project Import

- [Project parser](https://github.com/stuffmatic/fspy-blender/blob/master/fspy_blender/fspy.py): `fspy_blender/fspy.py`

### Other components

- **Blender user**
- **Blender**

## Connections

- Blender user → Blender: selects import (evidence: `README.md`)
- Blender → Menu registration: registers add-on (evidence: `fspy_blender/__init__.py`)
- Menu registration → Import operator: adds menu item (evidence: `fspy_blender/__init__.py`)
- Import operator → Project parser: parses project (evidence: `fspy_blender/addon.py`)
- Import operator → Camera setup: configures camera (evidence: `fspy_blender/addon.py`)
- Import operator → Render resolution: sets resolution (evidence: `fspy_blender/addon.py`)
- Import operator → Background image: loads image (evidence: `fspy_blender/addon.py`)
- Import operator → Scene units: sets units (evidence: `fspy_blender/addon.py`)
- Camera setup → Blender: creates or updates (evidence: `fspy_blender/addon.py`)
- Background image → Blender: loads image data (evidence: `fspy_blender/addon.py`)
