Giter Site home page Giter Site logo

cmdc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmdc's Issues

Support for type annotations?

I started using type annotations quite a lot these past months and I've grown to love them.

Since none of the Maya APIs are type annotated, every function takes and returns Any. This is really frustrating to work with as you need to explicitly specify the type of a lot of variables when that should be inferred.

I think it would be really nice if cmdc was fully type annotated and made that one of its primary goals.
I haven't looked into how to set that up much so I'm not sure if pybind supports this or if we'd need to also write .pyi stubs for that.

Help!

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!

  1. Get the project built on your machine
  2. Pick your favourite member from the C++ documentation
  3. Make a new MYourMember.inl file
  4. 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.

MVector -> Vector

Any questions or concerns, post here or in a new issue and let's fix this thing once and for all!

Ditch setup.py

Building a C-extension like cmdc with setup.py takes ~5 seconds.

That's insane. And we haven't even gotten started! The vast vast majority of that time is satisfying the pyproject.toml file which dynamically installs a bunch of other Python packages it thinks we need to compile a dynamic library.

Instead, let's just make a plain-old-bash script for Linux and extend the current ps1 script for Windows. Worst case, we could employ CMake and have it spit out a Ninja build; that's been my goto for fast iteration times.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.