Hello, welcome to cmdc where we attempt to reproduce Maya Python API 2.0 (i.e. maya.api.OpenMaya) in open source form, fix all bugs and add all of the things missing from it. Autodesk has shown little to no interest in continuing with API 2.0, and I was surprised to find nobody had yet taken matters into their own hands.
So let's do that!
I've put together a few source files demonstrating the fundamentals of how to bind the API, along with commonly used types like MVector and MMatrix and a function set, MFnDependencyNode for manipulating the scene graph.
Here's the simplest example.
The syntax is a little cryptic, because it's doing a lot of automatic detection of argument types and return values. Things we'd otherwise have to do ourselves if manually binding via e.g. Python.h. But it's fairly consistent and only consists of a few key functions, most if not all of them are already present in this repository.
Help Wanted
But I need help. There is too much of an API to wrap for one person, and the task of actually binding a new C++ member is of intern-level complexity. That is, anyone can do it. The hard part is patience and diligence. We need to match function signatures, convert all MStatuses to exceptions and write tests for each newly added member.
As soon as I spot some interest in the project, and interest in helping out, I'll expand upon the test suite and CI mechanism to automatically produce compiled versions for all platforms and versions of Maya, along with automatic upload to PyPI. From there, anyone can add or improve upon any member and we'll never have to struggle with maya.api.OpenMaya again.
How can I help?
Glad you asked!
- Get the project built on your machine
- Pick your favourite member from the C++ documentation
- Make a new
MYourMember.inl file
- Add it to
main.cpp
Remember to keep the name of arguments as documented, so users of cmdc can refer to this documentation for help on how to use cmdc. And ditch the M prefix that all classes have, Python don't need that.
Any questions or concerns, post here or in a new issue and let's fix this thing once and for all!
Hello, welcome to cmdc where we attempt to reproduce Maya Python API 2.0 (i.e.
maya.api.OpenMaya) in open source form, fix all bugs and add all of the things missing from it. Autodesk has shown little to no interest in continuing with API 2.0, and I was surprised to find nobody had yet taken matters into their own hands.So let's do that!
I've put together a few source files demonstrating the fundamentals of how to bind the API, along with commonly used types like
MVectorandMMatrixand a function set,MFnDependencyNodefor manipulating the scene graph.Here's the simplest example.
The syntax is a little cryptic, because it's doing a lot of automatic detection of argument types and return values. Things we'd otherwise have to do ourselves if manually binding via e.g.
Python.h. But it's fairly consistent and only consists of a few key functions, most if not all of them are already present in this repository.Help Wanted
But I need help. There is too much of an API to wrap for one person, and the task of actually binding a new C++ member is of intern-level complexity. That is, anyone can do it. The hard part is patience and diligence. We need to match function signatures, convert all
MStatuses to exceptions and write tests for each newly added member.As soon as I spot some interest in the project, and interest in helping out, I'll expand upon the test suite and CI mechanism to automatically produce compiled versions for all platforms and versions of Maya, along with automatic upload to PyPI. From there, anyone can add or improve upon any member and we'll never have to struggle with
maya.api.OpenMayaagain.How can I help?
Glad you asked!
MYourMember.inlfilemain.cppRemember to keep the name of arguments as documented, so users of
cmdccan refer to this documentation for help on how to usecmdc. And ditch theMprefix that all classes have, Python don't need that.Any questions or concerns, post here or in a new issue and let's fix this thing once and for all!