templates

All posts tagged templates

If you have written any Maya plugins in C++, you probably have used Maya’s built in array classes such as MIntArray or MPointArray. These are very simple and convenient classes to work with Maya’s API. However, they do not provide much support for more modern C++ features, such as generic programming. For example, if you wanted to sort a MIntArray you could do something like this:

This makes the assumption that the values are stored in a continuous section of memory which is a risk when using some other owner’s library. It is best to keep to the API that was provided to you.

What I want to share is my code that takes a step at bridging this gap. I will just go over the basics on usage and explanation, the rest you can figure out yourself as it is not that difficult to follow. You can grab a copy of these header files here: https://github.com/scottenglert/MayaAPIUtils

Continue Reading