Files
Hermes 222ad10ded Initial commit: AYON Matrix Publish addon
- package.py: addon manifest (v0.1.0)
- server/__init__.py: BaseServerAddon definition
- server/ayon_matrix_publish/plugins/publish/integrate_matrix.py:
  Pyblish plugin that uploads published representations to Matrix
  rooms during the Integration stage. Supports:
  - Upload to Matrix content repository (mxc:// URI)
  - Formatted messages with preview images
  - Auto room creation per asset
  - Configurable via Studio Settings or env vars
- create_package.py: builds distributable .zip package
2026-06-06 13:51:31 +00:00

76 lines
2.8 KiB
Markdown

# 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)