B1 – Introduction to Autodesk Maya & original Genr8 plugin.

Autodesk Maya is indeed designed to be an open and extensible product. The Maya® Software Development Kit (SDK) contains a rich set of facilities that can help you add new functionality to the Maya software. The SDK includes a C++ API called the Maya API that provides functionality for querying and changing the Maya model along with the ability to add new Maya objects to the Maya model. The scripting languages MEL and Python are key to Maya being open and extensible. I will focus here on MEL and the Maya C++ API for the purpose of extending the functionality of Maya. During the design of Maya, the C++ API was built in to maximize its extensibility. In fact , on Windows, you can launch Maya directly from the Microsoft® Visual Studio® development system and debug the plug-in as you would any other Windows application.

At the lowest level, Maya is a very efficient database for storing graphical information. Databases are extremely efficient in general when storing, querying and producing data quickly. This particular database is represented by the Dependency Graph (DG). Information in the DG is stored in objects called nodes. Nodes have properties called attributes that store the configurable characteristics of each node. Similar types of attributes can be connected together, letting data flow from one node to another. On the abstracted layer that is the API and where you have access to Mayas Dependency Graph, you work with objects and function sets to access these internal nodes. Objects are very lightweight classes that provide RTTI (Run Time Type Identification) and can be used in a type-less manner. A function set is a user owned structure that allows operations on Maya owned objects. Since an object is simply a handle that knows its type, a function set provides you with a tool that acts upon objects of the right type. These function sets usually have names that match the Maya features, such as MFnSkinCluster and MfnNurbsSurface. For example, the MFnSkinCluster class can be instantiated with an object of type kSkinCluster, and subsequently can be used to perform operations on that object. The object itself is not able to perform any functions without the aid of its function set. I am already assuming some background knowledge on the part of the reader here, but I leave a documentation reference to the Autodesk Maya API here.

In C++ you work with functions and objects in the same classes, but here we have to consider how the dependency graph works when designing something like a plug- in. Functions and data are separated in Maya. For further description of this follow the upcoming blogs, or click here.

For now this is a introduction into the technicalities of the Maya API. I will continue in the next Articles on a more detailed description of how the C++ API works, and how you can introduce your own functionality into the Maya Dependency Graph, and make your own virtual tools for 3d design.

Now on to the plug – in itself, which needs a bit more explanation.

The original GENR8 plugin is a surface modeling tool that simulates organic growth of surfaces in an
environment. The creator  found map Lindenmayer-systems to be a suitable model for this kind of growth. Aristid Lindenmayer was a biologist who made the L -systems for describing growth of plants. But computers work with numbers and character strings, so the field of grammars and grammatical evolution became an essential part of the process, in addition to evolutionary algorithms, who have been used traditionally for computer optimization problems. The plugin, working in sync with Autodesk Maya 3d software can be seen working in the following diagrammatical way :

Mimic

This does not take into account the Autodesk Maya environment however, but we will get back to that.
To use L – Systems they had to be mapped to three dimensions, and environmental factors were added.  The important thing to note for now is that you have a seed or a genome which is defined as an integer string, and you have a grammar of word strings and rules that work on that Integer string. The rules, in accordance with the diagram, govern how the grammar works the string – The end result is the surface. Suffice to say the methods involved are well known in science. The way Lindenmayer combined them and the way in which the Genr8 plug – in uses them are nevertheless more unusual, as they involve the cross discipline factor.

For general updating of your personal knowledge- base, I would consider these links:

http://www.cplusplus.com/  – Catch up on your C++

http://www.davidgould.com/Books/CMP1/index.html  – Complete Maya Programming, with descriptions of MEL, C++API, Maya Classes and everything else you would need to know.

For info about the original Genr8 plugin and my personal development of it, also see the dedicated webpage  http://www.evolvedtools.com/Genr8Page.html on my personal website.

Leave a Reply

Your email address will not be published. Required fields are marked *