Maya Math lib V 1.0.0

Hi folks! I wanted to share with you my last development I released online.

It is a math library for maya. First of all let me quickly explain why I did it and how it differs from the others libs around.

I created this library because I got tired of having to redo over and over the same kind of procedures for vectors and matrix operation, implement a class overriding the operators, etc. Also doing the same kind of thing with nodes is just plain boring, for a simple vector subtraction might require me like 20 lines of code. Also many studio still don’t want to use pymel and most of the riggers don’t know or don’t use OpenMaya. That led me to write my own library and share it around.

The library is composed of two main part, a pure math implementation that you would expect from a regular math lib but the second part is also a complete mirror of the pure math implementation but it works with maya nodes. Let me give you a quick example.

Let’s say we have two vectors, vector A and B. We can do a subtraction by simply doing:

vecC = vecB - VecA

Now is those two vectors are a pure math vector you will get a static result, if they are NVec (which stands for node vectors) It will wire under the hood the needed nodes. The result is a really nice compact and easy to read code. Also passing from the pure math to the node implementation is really simple and require minimal adjustment of the code (Actually just the classes initialization).

Here there is a demo of the lib in action:

All the code is free and available on github:

https://github.com/giordi91/mMath

Also everything is well documented with getting started tutorial and classes documentation:

http://giordi91.github.io/mMath/

Every feedback is really appreciated and of course anyone willing to participate on github.

Cheers

PS: for now it supports vectors only but I will be implementing matrix support as soon as I get a bit of time V

i like the idea of the node based stuff, pretty slick :slight_smile: I guess my only crit is to override repr so the objects are a little more transparent

Have you seen the euclid lib for python? euclid · PyPI

Totally agree, the repr should be there, can you be so nice to open a request on github?

I did not know euclid but looks pretty nice! Even though for the slight more complex matrix operation I will just rely on the OpenMaya , and I will wrap around that in order to implement the uniform interface for math and nodes.

done

Thanks a lot man! much appreciated!