3. Learning Mel

I had decided on my platform. I was going to do it in Maya with Maya’s embedded language (Mel). But this left me with a problem - I didn’t know how to program in Mel.

In fact I had little knowledge of expressions in general, let alone Mel! So this was the first task that was set in front of me. I would have to learn how to use Mel. Although there is a lot of documentation on the Internet, I found that Maya’s actual help files and the Mel command reference were the best tools to teach me how to program in Mel.

However Mel had its flaws, as in when coding you were spending what seemed like days on finally compiled, but when you went to run it all you got were errors, and to add insult to injury it didn’t even tell you where the errors were!

On the other hand, there where things that were very useful. One was the fact that whatever you can do in Maya (that is already set-up) you can script into a Mel script. This proved to be an important factor in the decision making process of whether to go for geometry or particles.

Consider that particles have collision commands and dynamic expressions, which actually do a lot of the work that I won’t have to script. So I could just take the commands that appear in script editor and write a script to implement them so that it is easy for other users to use.

They way it is set up requires that a few things be done. First create the locator and the group afresh so they will have the generic names ‘group1’ and ‘locator1’. Any other objects that have those names must be renamed or removed. If other objects are required to be used by the script, either the object’s name or the actual script must be changed.

The basic way to go about applying the script is simple. Select the entire script in the script editor then press little enter. Upon pressing the return button the Gui will come up with four buttons. Three for duplicating and one for executing the movement constrains.

Each button can be pressed individually with no need to bother with another. This means you can make up the geometry however you like then use the “troop fall in” button to constrain, or just press “let’s get muddy” to duplicate without the constrains.