Skip to main content

py_maya_scene

py_maya_scene is a Python package for working with Autodesk Maya scene files (.mb and .ma) without Maya.

Sibling project of py-aep, py-premiere and py-houdini.

About

Maya Binary files (.mb) are IFF chunk trees; Maya ASCII files (.ma) are MEL scripts. This package reads and writes both, keeping every byte it does not change, so that tools can inspect and edit scenes on machines and farms without a Maya licence.

Status

Pre-alpha.

Supported

Everything below works the same on .mb and .ma (Maya 2018 to 2025), through one scene model.

  • Byte-identical round-trip: parse then save without edits gives the same bytes (all 771 production .mb and 3300 of 3305 production .ma; files that cannot be reproduced are refused at parse time); edits rewrite only the values they change, keeping Maya's own layout around them
  • Scene model: version, file info, required plugins, references (at every depth, with file type), nodes (name, type, UUID, DAG paths including instances), string attribute values, connections
  • Listing and replacing external dependencies: references, every attribute Maya flags as a file name (textures, caches, audio, Arnold, Alembic...) plus Yeti and Golaem ones seen in production, and paths set on referenced nodes (reference edits). A reference moved to a .ma or .mb file gets the matching file type. Paths read as image sequences (useFrameExtension, in the file or by a reference edit) are flagged
  • Reference edits: decoded and re-encoded byte for byte (parent, addAttr, setAttr, deleteAttr, connect/disconnectAttr, lock/unlock)
  • Renaming nodes (node.name = "new", node.rename(...)): parents, connections, relationships, instances, reference edits and the externalContentTable that name the node or its descendants are rewritten the way Maya writes them, and a transform's shapes follow like with maya.cmds.rename; checked against renames done by Maya 2018, 2022 and 2024. Optionally (in_strings=True) also node names in string attributes and in expression / script node MEL, which Maya leaves alone
  • The externalContentTable follows remaps, renames and edited path values (CRC included)
  • .mb only: putting every name and string through a function (scene.replace_strings(fn)), like a text replace over a .ma file: node names, namespaces, reference nodes, the nodes named by connections and reference edits, string values, reference paths and fileInfo. Attribute names and Maya's default nodes are kept everywhere. Maya opens the result as the original with the names replaced, reference edits included
  • Saving atomically: save(path) refuses to overwrite, save_in_place() overwrites the parsed file
  • maya-inspect: chunk tree and chunk statistics of a .mb file

Not supported (yet)

  • Renaming reference nodes and default nodes
  • replace_strings on .ma files
  • Values other than strings (numbers, matrices, meshes) are kept as stored but not decoded

Planned

  • Converting between .ma and .mb
  • A maya.cmds-like API on a scene file

Installation

pip install py-maya-scene

For development:

uv sync --extra dev

Getting started

import py_maya_scene

scene = py_maya_scene.parse("shot.mb")
for dependency in scene.dependencies():
    print(dependency.node, dependency.attribute, dependency.path)

# Paths are passed exactly as stored; return None to keep one
scene.remap_paths(
    lambda path: path.replace("//server/old_project/", "//server/new_project/", 1)
    if path.startswith("//server/old_project/")
    else None
)
scene.save("shot_remapped.mb")

# Shapes, parents, connections, reference edits and the externalContentTable follow
scene = py_maya_scene.parse("asset.ma")
scene.node("box").name = "crate"
scene.save("asset_renamed.ma")

Documentation

See docs/file_format.md for what is known of the .mb and .ma formats.

Metadata

Release files for py-maya-scene 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-maya-scene 0.1.0
File Size Uploaded Provenance Actions
py_maya_scene-0.1.0.tar.gz 179.2 kB With provenance Details for py_maya_scene-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-maya-scene 0.1.0
File Interpreter ABI Platform Actions
py_maya_scene-0.1.0-py3-none-any.whl Python 3 none any Details for py_maya_scene-0.1.0-py3-none-any.whl

Total release size: 244.1 kB

Release files / py_maya_scene-0.1.0.tar.gz

Download URL py_maya_scene-0.1.0.tar.gz
Size 179.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e5b7a1b54d95bc3cacd32d8744159bafe2353c2a232d8b01bd9e0dc525771097
BLAKE2b-256 checksum
How to use checksums
7277973027ada9fa085cfd3a4f8a3306ee8a5a6cdcceecdfd70ba48369d8e8b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / py_maya_scene-0.1.0-py3-none-any.whl

Download URL py_maya_scene-0.1.0-py3-none-any.whl
Size 64.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44ecaaf1f496a74721aeae9e76ab1ed7d992784f8fe15b6337dd2e9a2a8ebe5d
BLAKE2b-256 checksum
How to use checksums
9470ab42cfa6f710a341e8c31bdf087b95743a1522bd92351f0f8637f56f5010
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for py-maya-scene 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for py_maya_scene-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page