# vuyani-magibisela/blendersage architecture

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

- Interactive diagram: https://gitdiagram.com/vuyani-magibisela/blendersage
- Repository: https://github.com/vuyani-magibisela/blendersage

## Overview

BlenderSage is a Blender extension for guided, declarative modeling lessons. Learners start the bundled lesson or open a JSON lesson in the sidebar; runtime parses it, tracks navigation, periodically snapshots the scene and evaluates step checks, then displays instructions, target cues, and editor hints. Completion enables progression, while learners can navigate, skip, confirm eligible steps, or bind a selected object as a target. The graph emphasizes these runtime stages and lifecycle cleanup. README content was empty; unsampled sidebar and lesson-schema details are represented only where the source index and excerpts support them.

Main entry points: [`blender/guidance/runtime.py`](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/runtime.py) (Lesson Runtime), [`blender/guidance/sidebar.py`](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/sidebar.py) (Lesson Sidebar), [`blender/guidance/operators.py`](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/operators.py) (Lesson Actions), [`blender/guidance/overlay.py`](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/overlay.py) (Guidance Overlay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lesson["Lesson Definition"]
  node_lesson_json["Lesson JSON"]
  node_schema["Lesson Schema<br/>[tutorial_schema.py]"]
end

subgraph group_interface["Blender Interface"]
  node_sidebar["Lesson Sidebar<br/>[sidebar.py]"]
  node_operators["Lesson Actions<br/>[operators.py]"]
  node_overlay["Guidance Overlay<br/>[overlay.py]"]
end

subgraph group_runtime["Lesson Runtime"]
  node_runtime_core["Lesson Runtime<br/>[runtime.py]"]
  node_session["Lesson Session<br/>[session.py]"]
  node_lifecycle["Hook Lifecycle<br/>[lifecycle.py]"]
end

subgraph group_evaluation["Scene Evaluation"]
  node_scene["Scene Snapshot<br/>[state.py]"]
  node_checks["Step Checks<br/>[checks.py]"]
  node_targets["Target Resolution<br/>[targets.py]"]
end

node_learner(("Learner"))
node_blender(("Blender"))

node_learner -.->|"uses"| node_sidebar
node_sidebar -.->|"invokes"| node_operators
node_operators -->|"dispatches"| node_runtime_core
node_lesson_json -->|"loads"| node_runtime_core
node_runtime_core -->|"parses"| node_schema
node_runtime_core -->|"creates"| node_session
node_runtime_core -->|"registers hooks"| node_lifecycle
node_runtime_core -->|"snapshots"| node_scene
node_runtime_core -->|"evaluates"| node_checks
node_checks -->|"resolves"| node_targets
node_runtime_core -->|"registers drawing"| node_overlay
node_overlay -->|"reads lesson state"| node_runtime_core
node_blender -.->|"hosts"| node_runtime_core

click node_lesson_json "https://github.com/vuyani-magibisela/blendersage/blob/main/lessons/desk_organiser.json"
click node_schema "https://github.com/vuyani-magibisela/blendersage/blob/main/core/tutorial_schema.py"
click node_sidebar "https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/sidebar.py"
click node_operators "https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/operators.py"
click node_overlay "https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/overlay.py"
click node_runtime_core "https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/runtime.py"
click node_session "https://github.com/vuyani-magibisela/blendersage/blob/main/core/session.py"
click node_lifecycle "https://github.com/vuyani-magibisela/blendersage/blob/main/blender/lifecycle.py"
click node_scene "https://github.com/vuyani-magibisela/blendersage/blob/main/blender/state.py"
click node_checks "https://github.com/vuyani-magibisela/blendersage/blob/main/core/checks.py"
click node_targets "https://github.com/vuyani-magibisela/blendersage/blob/main/core/targets.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_lesson_json,node_schema toneBlue
class node_sidebar,node_operators,node_overlay toneAmber
class node_runtime_core,node_session,node_lifecycle toneMint
class node_scene,node_checks,node_targets toneRose
class node_learner,node_blender toneIndigo
```

## Components

### Lesson Definition

- [Lesson JSON](https://github.com/vuyani-magibisela/blendersage/blob/main/lessons/desk_organiser.json): `lessons/desk_organiser.json`
- [Lesson Schema](https://github.com/vuyani-magibisela/blendersage/blob/main/core/tutorial_schema.py): `core/tutorial_schema.py`

### Blender Interface

- [Lesson Sidebar](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/sidebar.py): `blender/guidance/sidebar.py`
- [Lesson Actions](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/operators.py): `blender/guidance/operators.py`
- [Guidance Overlay](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/overlay.py): `blender/guidance/overlay.py`

### Lesson Runtime

- [Lesson Runtime](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/guidance/runtime.py): `blender/guidance/runtime.py`
- [Lesson Session](https://github.com/vuyani-magibisela/blendersage/blob/main/core/session.py): `core/session.py`
- [Hook Lifecycle](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/lifecycle.py): `blender/lifecycle.py`

### Scene Evaluation

- [Scene Snapshot](https://github.com/vuyani-magibisela/blendersage/blob/main/blender/state.py): `blender/state.py`
- [Step Checks](https://github.com/vuyani-magibisela/blendersage/blob/main/core/checks.py): `core/checks.py`
- [Target Resolution](https://github.com/vuyani-magibisela/blendersage/blob/main/core/targets.py): `core/targets.py`

### Other components

- **Learner**
- **Blender**

## Connections

- Learner → Lesson Sidebar: uses
- Lesson Sidebar → Lesson Actions: invokes
- Lesson Actions → Lesson Runtime: dispatches (evidence: `blender/guidance/operators.py`)
- Lesson JSON → Lesson Runtime: loads (evidence: `blender/guidance/runtime.py`)
- Lesson Runtime → Lesson Schema: parses (evidence: `blender/guidance/runtime.py`)
- Lesson Runtime → Lesson Session: creates (evidence: `blender/guidance/runtime.py`)
- Lesson Runtime → Hook Lifecycle: registers hooks (evidence: `blender/guidance/runtime.py`)
- Lesson Runtime → Scene Snapshot: snapshots (evidence: `blender/guidance/runtime.py`)
- Lesson Runtime → Step Checks: evaluates (evidence: `blender/guidance/runtime.py`)
- Step Checks → Target Resolution: resolves (evidence: `core/checks.py`)
- Lesson Runtime → Guidance Overlay: registers drawing (evidence: `blender/guidance/runtime.py`)
- Guidance Overlay → Lesson Runtime: reads lesson state (evidence: `blender/guidance/overlay.py`)
- Blender → Lesson Runtime: hosts
