# ynput/ayon-blender architecture

> Architecture diagram of the GitHub repository ynput/ayon-blender, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ynput/ayon-blender
- Repository: https://github.com/ynput/ayon-blender

## Overview

##### Project Type and Purpose
- This is a Blender addon (“client/ayon_blender”) that integrates the AYON production management system into Blender.
- It provides a collection of plugins (create, load, publish), a Python API wrapper for AYON services, hook points for custom behaviors, and configuration for local “server” settings.

##### File Structure Analysis
- Top-level files: packaging/build scripts (pyproject.toml, package.py, create_package.py), CI workflows (.github/workflows), documentation (mkdocs.yml, docs/).
- client/ayon_blender: the core addon package
- __init__.py, addon.py, version.py – entry points and metadata
- api/ – lightweight Python bindings to AYON REST endpoints (action, capture, pipeline, etc.)
- blender_addon/ – Blender startup code, UI registration
- hooks/ – pre- and post-hooks for environment setup
- plugins/ – three plugin categories: create/, load/, publish/, each with specialized modules
- server/settings: local default settings for image I/O, publish plugins, render pipeline.

##### README Insights
- Confirms the addon is solely for Blender integration with AYON
- No built-in server; relies on remote AYON cloud or on-prem services

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Host Application
    Blender["Blender Host Application"]:::host

    %% Addon Subgraph
    subgraph "AYON Blender Addon" 
        direction TB
        subgraph "Core Addon Loader" 
            direction TB
            Init["__init__.py"]:::client
            AddonPy["addon.py"]:::client
            VersionPy["version.py"]:::client
        end
        subgraph "API Layer (Facade)" 
            direction TB
            APIInit["__init__.py"]:::client
            Lib["lib.py"]:::client
            ActionAPI["action.py"]:::client
            CaptureAPI["capture.py"]:::client
            ColorspaceAPI["colorspace.py"]:::client
            OpsAPI["ops.py"]:::client
            PipelineAPI["pipeline.py"]:::client
            PluginAPI["plugin.py"]:::client
            RenderLib["render_lib.py"]:::client
            WorkioAPI["workio.py"]:::client
        end
        subgraph "Hook Manager" 
            direction TB
            Hook1["pre_add_run_python_script_arg.py"]:::client
            Hook2["pre_pyside_install.py"]:::client
            Hook3["pre_windows_console.py"]:::client
        end
        subgraph "Plugin Modules" 
            direction TB
            Create["Create Plugins"]:::client
            Load["Load Plugins"]:::client
            Publish["Publish Plugins"]:::client
        end
    end

    %% Configuration
    Settings["Local Server Settings"]:::config

    %% External Services
    AYONServer["AYON Server (REST)"]:::external

    %% CI/CD & Docs
    subgraph "CI/CD & Documentation"
        direction TB
        CICD["GitHub Actions Workflows"]:::ci
        Docs["MkDocs & Packaging"]:::ci
    end

    %% Relationships
    Blender -->|"loads addon"| Init
    Init -->|"registers operators & UI"| AddonPy
    AddonPy -->|"uses"| APIInit
    AddonPy -->|"registers hooks"| Hook1
    Hook1 --> Hook2
    Hook2 --> Hook3
    APIInit --> Lib
    Lib --> ActionAPI
    Lib --> CaptureAPI
    Lib --> ColorspaceAPI
    Lib --> OpsAPI
    Lib --> PipelineAPI
    Lib --> PluginAPI
    Lib --> RenderLib
    Lib --> WorkioAPI
    Create -->|"calls"| APIInit
    Load -->|"calls"| APIInit
    Publish -->|"calls"| APIInit
    Settings -->|"provides config to"| APIInit
    Settings -->|"provides config to"| Create
    Settings -->|"provides config to"| Publish
    APIInit -->|"HTTP/HTTPS"| AYONServer
    AYONServer -->|"responses"| APIInit
    CICD -->|"build & publish"| Docs
    CICD -->|"deploy addon"| Docs

    %% Click Events
    click Init "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/__init__.py"
    click AddonPy "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/addon.py"
    click VersionPy "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/version.py"
    click APIInit "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/__init__.py"
    click Lib "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/lib.py"
    click ActionAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/action.py"
    click CaptureAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/capture.py"
    click ColorspaceAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/colorspace.py"
    click OpsAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/ops.py"
    click PipelineAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/pipeline.py"
    click PluginAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/plugin.py"
    click RenderLib "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/render_lib.py"
    click WorkioAPI "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/api/workio.py"
    click Hook1 "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/hooks/pre_add_run_python_script_arg.py"
    click Hook2 "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/hooks/pre_pyside_install.py"
    click Hook3 "https://github.com/ynput/ayon-blender/blob/develop/client/ayon_blender/hooks/pre_windows_console.py"
    click Create "https://github.com/ynput/ayon-blender/tree/develop/client/ayon_blender/plugins/create/"
    click Load "https://github.com/ynput/ayon-blender/tree/develop/client/ayon_blender/plugins/load/"
    click Publish "https://github.com/ynput/ayon-blender/tree/develop/client/ayon_blender/plugins/publish/"
    click Settings "https://github.com/ynput/ayon-blender/tree/develop/server/settings/"
    click CICD "https://github.com/ynput/ayon-blender/tree/develop/.github/workflows/"
    click Docs "https://github.com/ynput/ayon-blender/blob/develop/mkdocs.yml"

    %% Styles
    classDef host fill:#aec7e8,stroke:#1f77b4,color:#1f77b4
    classDef client fill:#98df8a,stroke:#2ca02c,color:#2ca02c
    classDef external fill:#ffbb78,stroke:#ff7f0e,color:#ff7f0e
    classDef config fill:#c7c7c7,stroke:#7f7f7f,color:#7f7f7f
    classDef ci fill:#dbdb8d,stroke:#bcbd22,color:#bcbd22
```
