![]() When writing most Maya plug-ins, knowledge of the Maya Dependency Graph architecture is necessary. The rest of this page describes the older pre-Maya 2016 evaluation model with dirty propagation. To learn more about this model, read the paper linked here. Starting with Maya 2016, Maya introduced a new multi-threaded evaluation model. If you are using Python, accessing these libraries is as simple as importing them into your code: OpenMayaRender - Contains classes for performing rendering functions.OpenMayaFX - Contains classes for Autodesk Dynamics.OpenMayaAnim - Contains classes for animation, including deformers and inverse kinematics.OpenMayaUI - Contains classes necessary for creating new user interface elements such as manipulators, contexts, and locators.OpenMaya - Contains fundamental classes for defining nodes and commands and for assembling them into a plug-in.From the documentation, these libraries are: The Maya API is packaged as a set of libraries that you will need to access. The first step in learning the API is setting up your build environment. All the API calls are the same it is just a difference in syntax. However, I use the API a lot with Python in scripts so it is still worth learning. Most of the time, I stick with C++ just because that is what the end product is going to be. There’s also less of a chance to crash Maya with array index and memory errors. Since Python isn’t compiled like C++, the iteration time is faster. When I am writing a new node, I sometimes start with Python to work out algorithm details. I have used both C++ and Python when developing plug-ins. Anything dealing with OpenGL such as viewports and locators should be made with C++ as I have seen significant slowdowns with Python implementations.Īlso, some API calls in Python are a total pain syntax-wise because the API expects a lot of C++ pointers and references, which is wrapped with a very cryptic module in Python (MScriptUtil) which is not documented very well. For simple nodes that are not performance critical, Python works fine. ![]() So which one should you use? Both are useful but there are situations where one should be used over the other.Īnything complex or that works with larger data sets like deformers should probably be made with C++ for speeds sake. Plug-ins can be made with both C++ and Python. With Python, not only can we make plug-ins as described above, but we can also access API commands in scripts, which adds a significant performance gain to existing toolsets. Starting with Maya 8.5, the Maya API became accessible via Python. The Maya API provides several base classes that programmers will inherit from and fill in the desired implementations. When I refer to “objects” here, I am referring to objects in the Object Oriented Programming sense. Plug-ins contain implementations of many different types of objects you want to add to Maya. The Maya API is traditionally used to make plug-ins, which are dynamic libraries loaded by Maya at runtime. What Can Be Implemented with the Maya API? Tasks written with the Maya API execute several times faster than the same tasks written in MEL. With the Maya API, programmers can customize Maya with new technology and create tools to help integrate the software into a studios production pipeline. The Maya API is a C++/Python API that lets programmers and scripters access the internal libraries of Maya. Maya API learning resources are limited so hopefully these notes will help you add to your tool set. If you think something is incorrect, let me know. The code and knowledge presented here is based off of my experience in creating dozens of nodes, deformers, and tool sets using the Maya API in both C++ and Python in the production of animated and effects heavy feature films a large studios. ![]() ![]() The techniques and code included in this workflow may not be perfect or accepted by elite Maya API programmers as the best way to utilize the API. The purpose of this workshop is not to make you expert Maya programmers, but to give you a solid foundation from which to further your Maya API studies. You will not learn everything about the Maya API from this workshop. A good understanding of Object Oriented Programming (OOP) is extremely helpful as the Maya API makes heavy use of OOP. Individuals should have existing C++ and/or Python experience as well as an intermediate to advanced level of knowledge of Maya. This workshop is geared towards individuals wanting to learn how to extend and customize Maya with the Maya API. Check out my Introduction to the Maya API video series at CGCircuit: Introduction ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |