Skip to content

Contributing Guide

Quick Start

  1. Fork and clone the repository (fixtures are stored with Git LFS)
  2. Install:

    uv sync --extra dev
    
    pip install -e ".[dev]"
    
  3. Test: uv run pytest

  4. Submit a pull request

Key Topics

  • Architecture - Two containers (binary/ for .mb, ascii/ for .ma), format back-ends exposing the same records (storage/), and one scene model on top (models/)
  • Round-trip first - Parsing then saving without edits must give the same bytes; files that cannot be reproduced are refused at parse time
  • Write-through records - Edits re-encode one chunk or replace single tokens of one statement; untouched data is never rewritten
  • Ground truth from Maya - Fixtures in samples/models/ are made by Maya (scripts/mayapy/make_fixtures.py), each with a JSON dump of Maya's own view (scripts/mayapy/dump_scene.py); tests compare the model against them
  • Generated data - data/node_types.py is generated by scripts/gen_node_types.py from Maya's node schema; regenerate it, never edit it by hand
  • File format notes - Every finding goes to File Format
  • Code style - Python 3.7 compatible, fully typed (mypy), linted and formatted with ruff