mayatk
Composable primitives for Maya, and the tools built from them. mayatk is the Maya library behind the tentacle toolset, built on maya.cmds and OpenMaya 2.0, with no PyMEL.
Design
| Principle | In practice |
|---|---|
| Primitives that combine | Small classes such as NodeUtils, Attributes and XformUtils take node names and return plain values, with no wrapper objects, so they mix freely with your own maya.cmds code. A compound operation is still one undo step. |
| Logic without UI | Every tool is a plain Python class with no UI; its panel only calls it. A script, a test or an AI agent runs exactly what an artist runs, on the selection by default or on the objects it is given. |
| One API, two hosts | blendertk mirrors each operation by name, and shared logic is written once in pythontk behind an adapter. One panel serves Maya and Blender; CI fails when it calls what one library lacks. |
| Self-describing exports | Shots, audio cues, lightmaps and materials travel inside the exported file, where Unity and the WebXR viewer read them through types generated from one declaration. A shot arrives in Unity as a named animation clip, and a lightmap binds to its object with no setup. |
| Non-destructive | The exporter stages what it changes for the file and puts it back, however the run ends. Smart Bake and Texture Combine record what they change inside the scene itself, so either is reversed exactly after the scene is saved, closed and reopened. |
| Exact undo | Edits made through OpenMaya normally bypass Maya's undo queue; UndoRecorder routes them through a command that ships with Maya, so a fast API edit undoes as one ordinary step. A live preview stays out of the undo history until it is committed, then counts as a single step. |
| Faster, and proven equal | Smart Bake samples the timeline in a single OpenMaya pass in place of Maya's bakeResults. A test requires the same keys from both; on a production scene they matched across 1.2 million keys, in 4.8 s instead of 144.8 s. |
| Test-driven, inside Maya | Every bug is reproduced as a failing test before it is fixed, and the test stays in the suite. More than 9,000 tests run inside Maya itself, and a release requires a full passing run recorded against that exact source. |
Public names are a contract: one that moves raises an error naming its new home. The reasoning behind each rule is in the code standard.
What's in it
Every class is available from the package root (mtk.NodeUtils) and loads on first use. A linked name opens that tool's readme.
| Package | What it holds |
|---|---|
anim_utils |
Animation curves and keys, Shot Manifest, Shot Sequencer, Smart Bake, key stash, blendshape animation, playblast |
audio_utils |
Audio clips, ffmpeg-backed conversion, timeline-keyed events |
cam_utils |
View capture and framing, camera clipping, cameras from the current view, view state save and restore |
core_utils |
CoreUtils, Components, UndoRecorder, Preview, AutoInstancer, the scene audit and repair helpers, MASH bridge |
display_utils |
Visibility and isolation, color ID, exploded view |
edit_utils |
Selection, naming, primitives, snap, bevel, bridge, mirror, duplicate (linear, radial, grid), mesh graph |
env_utils |
MayaConnection, workspaces, namespace sandbox, references, hierarchy sync, FBX and USD, Scene Exporter, Blender and Unity bridges, WebXR preview |
light_utils |
Lightmap Baker, Light Rigs, HDR manager, lights from geometry |
mat_utils |
GameShader, RenderEffects, ImageToPlane, MatUpdater, shader templates, Emissive Groups, Marmoset and Substance bridges |
node_utils |
NodeUtils, Attributes, the Channels engine, scene data nodes |
nurbs_utils |
NURBS surfaces, ImageTracer, curve to tube |
render_utils |
Renderer switching, render settings and their presets |
rig_utils |
Controls, skinning, tube, wheel and telescope rigs, Articulated Rig, Shadow Rig and its design note |
ui_utils |
MayaUiHandler, the marking-menu host adapter, channel box, native menus, hotkey collision check, node icons |
uv_utils |
Unwrap, pack and transfer UVs, Texture Combine, Rizom bridge |
xform_utils |
Freeze and restore transforms, pivots, alignment and placement, matrices |
To find any public name, search the installed source: python -m pythontk ops run api.search "query=<words>". Over MCP, an agent gets the same search and runs its calls in a Maya started for it (setup). See also: changelog · tests · contributing · issues.
Install
pip install mayatk
tentacle's installer installs it together with the panels.
import mayatk as mtk
@mtk.CoreUtils.undoable # the whole call is one undo step
def freeze_groups(nodes):
groups = mtk.NodeUtils.is_group(nodes, filter=True)
with mtk.CoreUtils.preserved_selection(): # restores the selection afterwards
mtk.XformUtils.freeze_transforms(groups)
return groups
groups = freeze_groups(["grp_a", "grp_b", "pCube1"])
mtk.XformUtils.restore_transforms(groups) # restores the values it zeroed
License
MIT with the Commons Clause — see LICENSE. Free to use, modify and share, including in paid production work; what it forbids is selling mayatk, or a product or service whose value comes mainly from it. The Blender-side scripts under env_utils/blender_bridge/templates/ are plain MIT, since code that runs inside Blender must be GPL-compatible.
Metadata
Release files for mayatk 0.36.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mayatk-0.36.1-py3-none-any.whl | Python 3 | none | any | Details for mayatk-0.36.1-py3-none-any.whl |
Release files / mayatk-0.36.1-py3-none-any.whl
| Download URL | mayatk-0.36.1-py3-none-any.whl |
|---|---|
| Size | 2.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3c79a87a2aebc10a42c53b60dc3a07f08941a1575a1c758502a7b578fade1f0
|
|
BLAKE2b-256 checksum How to use checksums |
c4aaa68e8eabdd663aa6373fed81c7bf36c24287c6e11af6db9c66e64f73a9e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for mayatk 0.36.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.