# ayon-matrix-publish AYON addon that publishes product representations (images, videos, previews) to Matrix/Element rooms automatically during the publish pipeline. ## Architecture ``` Ayon Publish Pipeline Collect → Validate → Extract → Integrate │ ▼ IntegrateMatrix plugin │ ┌───────────┴───────────┐ │ Matrix Client (mautrix) │ │ • Upload media │ │ • Send messages │ │ • Create rooms (opt.) │ └───────────────────────────┘ │ ▼ Synapse Homeserver (matrix.niklashmotion.art) ``` ## How It Works 1. **Artist publishes** a product in any DCC (Maya, Houdini, Nuke, Blender, etc.) 2. After extraction and standard integration, the `IntegrateMatrix` plugin runs 3. For each published representation (thumbnail, preview video, review): - Uploads the file to the Matrix media repository → gets `mxc://` URI - Sends a formatted message to a configured Matrix room with: - Product name, version, asset, task - Thumbnail/preview inline - Link to the AYON product page 4. (Optional) Creates per-asset or per-task rooms automatically ## Configuration Studio Settings → Matrix Publish: | Setting | Description | |---------|-------------| | `homeserver_url` | Matrix homeserver (e.g. `https://matrix.niklashmotion.art`) | | `access_token` | Bot access token (from Element → Settings → Help & About) | | `room_id` | Target room ID (e.g. `!abc123:niklashmotion.art`) | | `upload_representations` | List of representation names to upload (e.g. `["thumbnail", "preview"]`) | | `create_per_asset_rooms` | Auto-create rooms per asset (bool) | | `message_template` | Jinja2 template for the message text | ## Development ```bash # Clone git clone https://git.niklashmotion.art/Hermes/ayon-matrix-publish.git cd ayon-matrix-publish # Install AYON dev dependencies pip install ayon-python-api mautrix # Create package python create_package.py ``` ## Dependencies - `mautrix` — Matrix client SDK (async) - `ayon-python-api` — AYON server communication - `Jinja2` — Message templating (bundled with AYON) ## Related - [AYON Addon Development](https://docs.ayon.dev/docs/addon_development) - [Matrix Client-Server API](https://spec.matrix.org/latest/client-server-api/) - [Mautrix Python SDK](https://github.com/mautrix/python)