# tin2tin/blender_screenwriter architecture

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

- Interactive diagram: https://gitdiagram.com/tin2tin/blender_screenwriter
- Repository: https://github.com/tin2tin/blender_screenwriter

## Overview

Blender Screenwriter is an add-on for authoring Fountain screenplays and turning them into formatted previews, exports, mindmaps, and sequencer-based animatics in Blender. The main workflow is to edit a Blender text block, parse its Fountain text, then invoke a preview or a Screenplayer generation action. The graph also preserves keyword/object assignment and scene navigation capabilities documented in the README. Relationships are limited to calls or UI actions shown in the excerpts or README; unsampled subsystems are represented at their exact tree paths.

Main entry points: [`gui.py`](https://github.com/tin2tin/blender_screenwriter/blob/master/gui.py) (Sidebar controls), [`operators/scene_to_strip.py`](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/scene_to_strip.py) (Animatic generation), [`operators/dual_view.py`](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/dual_view.py) (Dual-view preview), [`operators/preview_fountain.py`](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/preview_fountain.py) (Formatted preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Screenplay authoring"]
  node_fountain["Fountain parser<br/>[fountain.py]"]
  node_preview["Formatted preview"]
  node_dual["Dual-view preview<br/>[dual_view.py]"]
  node_preview_helper["Preview lookup"]
  node_insert["Script editing tools<br/>[insert.py]"]
  node_export["Screenplay export<br/>[fountain_export.py]"]
  node_mindmap["Mindmap generation"]
end

subgraph group_screenplayer["Screenplayer production"]
  node_keyword["Keyword assignment"]
  node_scene_strip["Animatic generation<br/>[scene_to_strip.py]"]
  node_switch_scene["Scene navigation<br/>[switch_to_scene.py]"]
  node_switch_ops["Scene switching<br/>[switch_scene.py]"]
  node_blender_sequence[("Blender sequencer")]
  node_blender_scene[("Blender scenes and objects")]
end

subgraph group_integration["Blender integration"]
  node_ui["Sidebar controls<br/>[gui.py]"]
  node_area_helper["Editor discovery<br/>[area_functions.py]"]
  node_properties["Scene properties<br/>[properties.py]"]
  node_blender_text[("Blender text blocks")]
end

node_writer(("Blender user"))
node_mindmapper["MindMapper add-on"]
node_screenplain["Screenplain exporter"]

node_writer -->|"uses"| node_ui
node_ui -->|"invokes"| node_preview
node_preview -->|"writes preview"| node_blender_text
node_preview -->|"parses script"| node_fountain
node_ui -->|"invokes"| node_dual
node_dual -->|"invokes"| node_preview
node_dual -->|"gets preview"| node_preview_helper
node_preview_helper -->|"reads text block"| node_blender_text
node_dual -->|"finds editors"| node_area_helper
node_area_helper -->|"inspects editors"| node_blender_text
node_ui -->|"offers editing"| node_insert
node_ui -.->|"offers export"| node_export
node_export -.->|"exports via"| node_screenplain
node_ui -.->|"offers mindmap"| node_mindmap
node_mindmap -->|"parses script"| node_fountain
node_mindmap -->|"creates nodes"| node_mindmapper
node_ui -->|"offers assignment"| node_keyword
node_keyword -.->|"assigns objects"| node_blender_scene
node_ui -->|"starts generation"| node_scene_strip
node_scene_strip -->|"parses script"| node_fountain
node_scene_strip -->|"reads screenplay"| node_blender_text
node_scene_strip -->|"creates strips"| node_blender_sequence
node_scene_strip -->|"creates scenes"| node_blender_scene
node_ui -.->|"offers navigation"| node_switch_scene
node_switch_scene -.->|"delegates switching"| node_switch_ops
node_switch_scene -.->|"selects scene"| node_blender_scene
node_ui -->|"uses settings"| node_properties

click node_ui "https://github.com/tin2tin/blender_screenwriter/blob/master/gui.py"
click node_fountain "https://github.com/tin2tin/blender_screenwriter/blob/master/fountain.py"
click node_preview "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/preview_fountain.py"
click node_dual "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/dual_view.py"
click node_preview_helper "https://github.com/tin2tin/blender_screenwriter/blob/master/functions/fountain_functions.py"
click node_area_helper "https://github.com/tin2tin/blender_screenwriter/blob/master/functions/area_functions.py"
click node_insert "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/insert.py"
click node_export "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/fountain_export.py"
click node_mindmap "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/mindmap_fountain.py"
click node_keyword "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/assign_keyword_to_objects.py"
click node_scene_strip "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/scene_to_strip.py"
click node_switch_scene "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/switch_to_scene.py"
click node_switch_ops "https://github.com/tin2tin/blender_screenwriter/blob/master/operators/switch_scene.py"
click node_properties "https://github.com/tin2tin/blender_screenwriter/blob/master/properties.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_fountain,node_preview,node_dual,node_preview_helper,node_insert,node_export,node_mindmap,node_writer,node_screenplain toneBlue
class node_keyword,node_scene_strip,node_switch_scene,node_switch_ops,node_blender_sequence,node_blender_scene toneAmber
class node_ui,node_area_helper,node_properties,node_blender_text toneMint
class node_mindmapper toneIndigo
```

## Components

### Screenplay authoring

- [Fountain parser](https://github.com/tin2tin/blender_screenwriter/blob/master/fountain.py): `fountain.py`
- [Formatted preview](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/preview_fountain.py): `operators/preview_fountain.py`
- [Dual-view preview](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/dual_view.py): `operators/dual_view.py`
- [Preview lookup](https://github.com/tin2tin/blender_screenwriter/blob/master/functions/fountain_functions.py): `functions/fountain_functions.py`
- [Script editing tools](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/insert.py): `operators/insert.py`
- [Screenplay export](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/fountain_export.py): `operators/fountain_export.py`
- [Mindmap generation](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/mindmap_fountain.py): `operators/mindmap_fountain.py`

### Screenplayer production

- [Keyword assignment](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/assign_keyword_to_objects.py): `operators/assign_keyword_to_objects.py`
- [Animatic generation](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/scene_to_strip.py): `operators/scene_to_strip.py`
- [Scene navigation](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/switch_to_scene.py): `operators/switch_to_scene.py`
- [Scene switching](https://github.com/tin2tin/blender_screenwriter/blob/master/operators/switch_scene.py): `operators/switch_scene.py`
- **Blender sequencer**
- **Blender scenes and objects**

### Blender integration

- [Sidebar controls](https://github.com/tin2tin/blender_screenwriter/blob/master/gui.py): `gui.py`
- [Editor discovery](https://github.com/tin2tin/blender_screenwriter/blob/master/functions/area_functions.py): `functions/area_functions.py`
- [Scene properties](https://github.com/tin2tin/blender_screenwriter/blob/master/properties.py): `properties.py`
- **Blender text blocks**

### Other components

- **Blender user**
- **MindMapper add-on**
- **Screenplain exporter**

## Connections

- Blender user → Sidebar controls: uses (evidence: `gui.py`)
- Sidebar controls → Formatted preview: invokes (evidence: `gui.py`)
- Formatted preview → Blender text blocks: writes preview (evidence: `operators/preview_fountain.py`)
- Formatted preview → Fountain parser: parses script (evidence: `operators/preview_fountain.py`)
- Sidebar controls → Dual-view preview: invokes (evidence: `gui.py`)
- Dual-view preview → Formatted preview: invokes (evidence: `operators/dual_view.py`)
- Dual-view preview → Preview lookup: gets preview (evidence: `operators/dual_view.py`)
- Preview lookup → Blender text blocks: reads text block (evidence: `functions/fountain_functions.py`)
- Dual-view preview → Editor discovery: finds editors (evidence: `operators/dual_view.py`)
- Editor discovery → Blender text blocks: inspects editors (evidence: `functions/area_functions.py`)
- Sidebar controls → Script editing tools: offers editing (evidence: `gui.py`)
- Sidebar controls → Screenplay export: offers export (evidence: `README.md`)
- Screenplay export → Screenplain exporter: exports via (evidence: `README.md`)
- Sidebar controls → Mindmap generation: offers mindmap (evidence: `README.md`)
- Mindmap generation → Fountain parser: parses script (evidence: `operators/mindmap_fountain.py`)
- Mindmap generation → MindMapper add-on: creates nodes (evidence: `operators/mindmap_fountain.py`)
- Sidebar controls → Keyword assignment: offers assignment (evidence: `gui.py`)
- Keyword assignment → Blender scenes and objects: assigns objects (evidence: `README.md`)
- Sidebar controls → Animatic generation: starts generation (evidence: `gui.py`)
- Animatic generation → Fountain parser: parses script (evidence: `operators/scene_to_strip.py`)
- Animatic generation → Blender text blocks: reads screenplay (evidence: `operators/scene_to_strip.py`)
- Animatic generation → Blender sequencer: creates strips (evidence: `operators/scene_to_strip.py`)
- Animatic generation → Blender scenes and objects: creates scenes (evidence: `operators/scene_to_strip.py`)
- Sidebar controls → Scene navigation: offers navigation (evidence: `README.md`)
- Scene navigation → Scene switching: delegates switching
- Scene navigation → Blender scenes and objects: selects scene (evidence: `README.md`)
- Sidebar controls → Scene properties: uses settings (evidence: `gui.py`)
