blendertk
mayatk's API, in Blender. blendertk is the Blender library behind the tentacle toolset: the primitives and tools mayatk gives Maya, under the same names, on native bpy and bmesh.
Design
| Principle | In practice |
|---|---|
| One API, two hosts | Each operation carries mayatk's name, and its signature wherever a shared panel calls it, so one panel serves Maya and Blender with no branch. CI resolves every call those panels make against both libraries and fails on a gap. |
| Thin where Blender is strong | Where Blender ships a capability, blendertk is a thin layer over the bpy or bmesh operator. Where it does not, the logic is written once in pythontk and both host libraries bind it, so neither holds a second copy. |
| Qt inside Blender | Blender is not a Qt application: it runs no Qt event loop and bundles no binding. blendertk installs one on first launch, drives a QApplication from Blender's own timers and takes the activation key from Blender's keymap, so Qt panels and a marking menu work inside the viewport. |
| One undo step per operation | Blender has no call that opens and closes an undo group. undo_chunk suspends global undo for a block and pushes one step when it ends, so a compound operation is a single entry in Blender's history, and an edit that changed nothing adds none. |
| Scenes cross both ways | MayaSceneImport opens a .ma or .mb in Blender by converting it through a headless Maya; its USD route either keeps the scene's instancing exactly or fails and removes what it imported. Both hosts share one project file, Maya's workspace.mel. |
| Measured speed | Keys landed from an imported FBX are written in one bulk pass: 20 curves of 2,000 keys take 0.33 s instead of 59 s, bit-identical on whole frames. Planning a lightmap atlas before baking it made that bake 7.3 times faster. |
| Imports without Blender | Every bpy import is deferred into the call that uses it, so the whole API can be imported, searched and unit-tested with no Blender running. |
| Test-driven, inside Blender | Every bug is reproduced as a failing test before it is fixed, and the test stays in the suite. More than 8,000 checks run inside Blender itself, and a release requires a full passing run recorded against that exact source. |
The tools share mayatk's design (non-destructive exports, reversible baking, self-describing files): see its README. The reasoning behind each rule is in the code standard.
What's in it
The subpackages, modules and class names are mayatk's; STRUCTURE.md maps what corresponds and what is deliberately absent on each side. A linked name opens that tool's readme.
| Package | What it holds |
|---|---|
anim_utils |
Shot Manifest, Shot Sequencer, Smart Bake, key stash, blendshape animation, playblast, key scaling and staggering |
audio_utils |
Sound strips in the Video Sequence Editor |
cam_utils |
View capture and navigation, camera clipping, cameras from the current view, view state save and restore |
core_utils |
CoreUtils, AutoInstancer, Preview, script jobs over bpy.app.handlers, diagnostics |
display_utils |
Color ID, exploded view, OutlinerTint |
edit_utils |
EditUtils, mirror, cut on axis, duplicate (linear, radial, grid), bevel, bridge, snap, naming, curtain, target weld |
env_utils |
BlenderConnection, workspaces, reference manager, hierarchy sync, FBX and USD, Scene Exporter, Maya and Unity bridges, WebXR preview, docked script console |
light_utils |
Lightmap Baker, Light Rigs, HDR manager, lights from geometry |
mat_utils |
Game shader, material updater, texture path editor, shader templates, render effects, image to plane, Emissive Groups, Marmoset and Substance bridges |
node_utils |
NodeUtils, scene data nodes, the Channels engine |
nurbs_utils |
Curve helpers, ImageTracer, curve to tube |
render_utils |
Render engines, render settings and their presets, render cameras |
rig_utils |
Constraints, drivers and armature primitives; tube, wheel and telescope rigs, Articulated Rig, Shadow Rig |
ui_utils |
BlenderUiHandler, the marking-menu host, native-menu wrapper, Qt dock container, calculator, style setter |
uv_utils |
Move, scale and pin UVs, texel density, UV set cleanup, 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 Blender started for it (setup). See also: changelog · tests · contributing · issues.
Install
pip install blendertk
bpy comes from Blender itself; development runs against Blender 5.1 (Python 3.13). tentacle's installer installs it together with the panels.
This script runs in Maya with mayatk in place of blendertk:
import blendertk as btk
@btk.CoreUtils.undoable # the whole call is one undo step
def freeze_groups(nodes):
groups = btk.NodeUtils.is_group(nodes, filter=True)
with btk.CoreUtils.preserved_selection(): # restores the selection afterwards
btk.XformUtils.freeze_transforms(groups, translate=True, rotate=True, scale=True)
return groups
groups = freeze_groups(["grp_a", "grp_b", "pCube1"])
btk.XformUtils.restore_transforms(groups) # restores the values it zeroed
License
GPL-3.0-or-later — see COPYING, plus an additional permission to combine it with mayatk, tentacle and Autodesk Maya (COPYING.EXCEPTION).
Metadata
Release files for blendertk 0.28.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 |
|---|---|---|---|---|
| blendertk-0.28.1-py3-none-any.whl | Python 3 | none | any | Details for blendertk-0.28.1-py3-none-any.whl |
Release files / blendertk-0.28.1-py3-none-any.whl
| Download URL | blendertk-0.28.1-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d68264d9f79868a3c0faa1e7c5ee16d672a575e7c42c619dd7e3b837c69bbb9
|
|
BLAKE2b-256 checksum How to use checksums |
2392d4f68955ec0c2547af521df0b30421b1c8160957477d5b7e65554d0c66a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for blendertk 0.28.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.