# ynput/ayon-maya architecture

> Architecture diagram of the GitHub repository ynput/ayon-maya, 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-maya
- Repository: https://github.com/ynput/ayon-maya

## Overview

##### Project type and purpose
- This is a specialized full-stack integration project.  On the “client” side it implements a Python-based Maya addon (ayon_maya) that plugs into Autodesk Maya, exposing menus, commands, tools, hooks and a full create/load/publish/workfile workflow.  On the “server” side it provides the configuration scripts that the central AYON server loads to support the Maya addon (dirmaps, publishers, workfile builders, etc.).

##### File structure
- Top level splits into:
- .github/workflows: CI/CD pipelines (PR linting, release triggers, package uploads)
- client/ayon_maya: the Maya addon package
– api/: abstraction layer for talking to AYON (action, pipeline, render-settings, FBX/GLTF exports, etc.)
– hooks/: Maya startup and pre/post hooks
– plugins/: subdivided into create, load, inventory, publish, workfile_build
– tools/: standalone utilities and UIs (maya look assigner)
– vendor/: bundled third-party code, version.py, addon.py, lib.py, startup scripts
- server/settings: Python modules that define server-side AYON settings for conversion, dirmaps, loaders, publishers, render settings, templates, workfile build, etc.
- docs/ + mkdocs.yml: documentation site
- create_package.py, package.py, pyproject.toml: build/package configuration

##### Elements
- Green for runtime components (Maya, addon, server)
- Blue for code/configuration (client/ayon_maya, server/settings)
- Orange for infrastructure (storage, CI/CD)
- Gray for documentation

##### Final advice
- How CI/CD workflows tie back to packaging and releasing the addon.

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef runtime fill:#a2f5a2,stroke:#333,stroke-width:1px
    classDef code fill:#aed6f1,stroke:#333,stroke-width:1px
    classDef infra fill:#f5b041,stroke:#333,stroke-width:1px
    classDef docs fill:#d5d8dc,stroke:#333,stroke-width:1px

    subgraph "Runtime Components"
        MayaApp["Autodesk Maya"]:::runtime
        subgraph "Client Addon (ayon_maya)"
            APILayer["API Abstraction Layer\n(client/ayon_maya/api/)"]:::code
            Startup["Maya Startup\n(client/ayon_maya/startup/userSetup.py)"]:::code
            Hooks["Hooks\n(client/ayon_maya/hooks/)"]:::code
            PluginCreate["Create Plugin\n(client/ayon_maya/plugins/create/)"]:::code
            PluginLoad["Load Plugin\n(client/ayon_maya/plugins/load/)"]:::code
            PluginInv["Inventory Plugin\n(client/ayon_maya/plugins/inventory/)"]:::code
            PluginPub["Publish Plugin\n(client/ayon_maya/plugins/publish/)"]:::code
            PluginWF["Workfile Build Plugin\n(client/ayon_maya/plugins/workfile_build/)"]:::code
            Tools["Tools & UI\n(client/ayon_maya/tools/)"]:::code
            Vendor["Vendor Code & Lib\n(client/ayon_maya/vendor/, client/ayon_maya/lib.py)"]:::code
            Version["Version Info\n(client/ayon_maya/version.py)"]:::code
            Entry["Entry Point\n(client/ayon_maya/addon.py)"]:::code
        end
    end

    subgraph "Server Side"
        AYONServer["AYON Central Server\n(GraphQL/REST API)"]:::runtime
        Settings["Server Settings\n(server/settings/)"]:::code
    end

    Storage["External Storage\n(network shares, cloud buckets)"]:::infra
    CICD["CI/CD Pipelines\n(.github/workflows/)"]:::infra
    Docs["Documentation (MkDocs)\n(docs/, mkdocs.yml)"]:::docs
    BuildScripts["Build & Packaging\n(pyproject.toml, create_package.py, package.py)"]:::infra

    MayaApp -->|"Loads addon via userSetup"| Startup
    Startup --> Hooks
    Hooks --> Entry
    Entry --> APILayer
    Entry --> PluginCreate
    Entry --> PluginLoad
    Entry --> PluginInv
    Entry --> PluginPub
    Entry --> PluginWF
    Entry --> Tools
    Entry --> Vendor
    Entry --> Version

    APILayer -->|"HTTP/GraphQL"| AYONServer
    PluginPub -->|"Upload assets"| Storage
    AYONServer -->|"Serves config & workflows"| APILayer

    CICD -->|"Runs CI/CD"| BuildScripts
    CICD -->|"Packages addon"| BuildScripts

    Docs -->|"Builds documentation"| Docs

    AYONServer --> Settings

    class MayaApp,AYONServer runtime
    class APILayer,Startup,Hooks,PluginCreate,PluginLoad,PluginInv,PluginPub,PluginWF,Tools,Vendor,Version,Entry,Settings code
    class Storage,CICD,BuildScripts infra
    class Docs docs

    click CICD "https://github.com/ynput/ayon-maya/tree/develop/.github/workflows/"
    click Entry "https://github.com/ynput/ayon-maya/blob/develop/client/ayon_maya/addon.py"
    click APILayer "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/api/"
    click Startup "https://github.com/ynput/ayon-maya/blob/develop/client/ayon_maya/startup/userSetup.py"
    click Hooks "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/hooks/"
    click PluginCreate "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/plugins/create/"
    click PluginLoad "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/plugins/load/"
    click PluginInv "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/plugins/inventory/"
    click PluginPub "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/plugins/publish/"
    click PluginWF "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/plugins/workfile_build/"
    click Tools "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/tools/"
    click Vendor "https://github.com/ynput/ayon-maya/tree/develop/client/ayon_maya/vendor/"
    click Vendor "https://github.com/ynput/ayon-maya/blob/develop/client/ayon_maya/lib.py"
    click Version "https://github.com/ynput/ayon-maya/blob/develop/client/ayon_maya/version.py"
    click Settings "https://github.com/ynput/ayon-maya/tree/develop/server/settings/"
    click Docs "https://github.com/ynput/ayon-maya/tree/develop/docs/"
    click Docs "https://github.com/ynput/ayon-maya/blob/develop/mkdocs.yml"
    click BuildScripts "https://github.com/ynput/ayon-maya/blob/develop/pyproject.toml"
    click BuildScripts "https://github.com/ynput/ayon-maya/blob/develop/create_package.py"
    click BuildScripts "https://github.com/ynput/ayon-maya/blob/develop/package.py"
```
