You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
MVector->Vector
Any questions or concerns, post here or in a new issue and let's fix this thing once and for all!
The text was updated successfully, but these errors were encountered:
Just came across this and I think this is a great idea. It's funny because I was just thinking about doing some of this myself. I have already forked the repo and started adding some classes. I do agree the size of the API is going to take a while, so I am focusing on classes I frequently use in my own tools which is mostly centered around animation and rigging.
I'll send a message and a pull request when I get to a good stopping point so you can see. Thanks again for taking the first steps. Hope to talk with you more about how we can improve the API experience.
Have a look at the most recent PRs for how far we got; the next thing we/I wanted to pursue was porting some of the real examples that ship with the API. I'd imagine they would make for good coverage.
On my side, the reason for stopping was that I've learnt to live with the pain of the original OpenAPI 2.0. 😢 But I'm still quite confident we could rather easily outperform it, in both API comfort and CPU performance, so go nuts. And if you can, I'd be happy to overlook any PRs you make to here and provide what I can to grow this project further.
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
andMMatrix
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
MStatus
es 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!
MYourMember.inl
filemain.cpp
Remember to keep the name of arguments as documented, so users of
cmdc
can refer to this documentation for help on how to usecmdc
. And ditch theM
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!
The text was updated successfully, but these errors were encountered: