christophercrouzet / bana

Licence: MIT License
Set of extensions for Autodesk Maya's Python API.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to bana

cmdc
Maya Python API 3.0
Stars: ✭ 98 (+206.25%)
Mutual labels:  maya, autodesk
revl
Helps to benchmark code for Autodesk Maya.
Stars: ✭ 14 (-56.25%)
Mutual labels:  maya, autodesk
gt-tools
GT Tools is a free collection of scripts for Autodesk Maya
Stars: ✭ 44 (+37.5%)
Mutual labels:  maya, autodesk
thesaurus
TT Hackathon 2018 - Autocomplete for Visual Programming Nodes
Stars: ✭ 23 (-28.12%)
Mutual labels:  extension, autodesk
onionSkinRenderer
This is an Onion Skin Renderer for Autodesk Maya
Stars: ✭ 93 (+190.63%)
Mutual labels:  maya, autodesk
node calculator
Create Maya node-network by entering a math-formula.
Stars: ✭ 56 (+75%)
Mutual labels:  maya, autodesk
CSEDevOps
Azure DevOps extensions from CSE DevOps team
Stars: ✭ 18 (-43.75%)
Mutual labels:  extension
vscode-open-in-github
Open the current project or file in github.com.
Stars: ✭ 16 (-50%)
Mutual labels:  extension
googleDriveVFXServer-pipeline
Transform a Google Drive server into a VFX pipeline ready server
Stars: ✭ 15 (-53.12%)
Mutual labels:  maya
vscode-gitignore
A simple extension for Visual Studio Code that lets you pull .gitignore files from the https://github.com/github/gitignore repository
Stars: ✭ 44 (+37.5%)
Mutual labels:  extension
solidus dev support
A collection of tools for developing Solidus extensions.
Stars: ✭ 14 (-56.25%)
Mutual labels:  extension
maya-alembic-export
Easier Alembic exporting.
Stars: ✭ 19 (-40.62%)
Mutual labels:  maya
JMadOnion
No description or website provided.
Stars: ✭ 14 (-56.25%)
Mutual labels:  maya
Userscript
Userscripts collection written by me
Stars: ✭ 92 (+187.5%)
Mutual labels:  extension
ride
Simple and beautiful monkey-patching library for JavaScript.
Stars: ✭ 24 (-25%)
Mutual labels:  monkey-patching
AntiRickRoll
Chrome extension that blocks Rickrolls!
Stars: ✭ 22 (-31.25%)
Mutual labels:  extension
spree-postal-service
Weight based calculator for Spree Commerce.
Stars: ✭ 21 (-34.37%)
Mutual labels:  extension
phper
A library that allows us to write PHP extensions using pure Rust and using safe Rust whenever possible.
Stars: ✭ 24 (-25%)
Mutual labels:  extension
ssh-python
Python bindings for libssh C library.
Stars: ✭ 19 (-40.62%)
Mutual labels:  extension
AndrOBD-Plugin
AndrOBD plugin development project
Stars: ✭ 38 (+18.75%)
Mutual labels:  extension

Bana

PyPI latest version Documentation status License

Bana is a set of extensions for Autodesk Maya's Python API.

The Maya's Python API is often a good choice over the commands layer whenever performances and robustness are valued. But because of its overall poor design, it is not uncommon that some fundamental functionalities are lacking out of the box and/or require too much boilerplate to get rolling.

Other gotchas to be expected include methods that became too daunting to use after porting in the worst possible way the API from C++ to Python, undocumented behaviours of certain features where error trialing is everything that is left, and methods throwing an exception when returning None would have been more appropriate.

Bana aims at reducing these shortcomings to provide a more friendly, predictable, and efficient developing environment.

Using the monkey patching package gorilla, new methods prefixed with bn are inserted within some classes from the maya.OpenMaya* modules, thus extending their functionalities while making these new methods feel as if they were built-in into Maya.

Since performances are a primary reason for using the API, a set of benchmarks built with the help of the package revl helps to ensure that these extensions remain as fast as possible.

Notes

Bana extends on Maya's Python API 1.0 rather than 2.0 because the latter version seems to be still incomplete. That being said, it is encouraged to use the API 2.0 whenever possible since it provides a much more Pythonic interface with increased performances.

Bana does not aim at making the API more Pythonic. This could in some cases impact the performances, which goes against Bana's goal of keeping things fast.

Bana does aim at following Maya's API philosophy by providing low-level extensions that are not specific to a domain (e.g.: rigging).

Features

  • easy retrieval of nodes from the scene.
  • robust and predictable specification for pattern matching with wildcards.
  • abstract away the usage of the maya.OpenMaya.MScriptUtil class.
  • performances as a top priority.

Usage

>>> import bana
>>> bana.initialize()
>>> from maya import OpenMaya
>>> # Retrieve a transform node named 'root'.
>>> root = OpenMaya.MFnTransform.bnGet(pattern='*|root')
>>> # Recursively iterate over all the DAG nodes child of 'root'.
>>> for node in root.bnFindChildren():
...     print(node)
>>> # Find all the mesh nodes in the scene containing the word 'Shape' but
... # not belonging to any namespace.
>>> for node in OpenMaya.MFnMesh.bnFind(pattern='*|*Shape*'):
...     print(node)

See the Tutorial section from the documentation for more detailed examples and explanations on how to use Bana.

Documentation

Read the documentation online at bana.readthedocs.io or check its source in the doc directory.

Author

Christopher Crouzet <christophercrouzet.com>

Thanks

  • Justin Israel for discovering that multiple instances pointing to a same Maya object return different hash values.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].