Script overview –
For our programing and scripting class we were given the assessment of making a new and original script. I began to think of something that Maya was lacking or something that was useful. Being into animation and modeling I was trying to think of something that might make my life a bit easier in the world of Maya. Something that always annoyed me was how needlessly complicated the measure tools were. They weren’t difficult but I thought there could be an easier way for this useful too.
I started with the idea of a window that had a simple button that you could click after selecting the two objects you wanted to measure between. Then I realised that would measure between the objects pivot points and not the surface of the object. That may be useful sometimes but not really want you want out of the tool.
So I wanted flexibility of being able to measure between the objects pivot point as well as the surface. To measure between surfaces is just simply measuring between Vertexs. Also I wanted the option to Parent the Locators of the tool to the objects so you could move the objects and automatically adjust the measurements.
This was a very ambitious task for me as I was a compleat novice to Programing and have little understanding and interest in it. Programing is a very useful thing, a huge time saver and I only wish I had the brains and patients to do it well. With the help of Vince I began to understand the basics of the Maya language MEL and ended up with something kind of useful but still impressive to me!
Top-Down development process –
- First I came up with a solution to a problem I was having within Maya and explored ways execute it.
- Second I drew out a simple plan consisting of a window and buttons of my final tool and how I expected it to look.
- By exploring the Maya Commands, other scripts that may have similar components and with help from Vince I was able to creat a Window and buttons that gave me the look I wanted.
- Next I needed a series of ‘strings’ within a ‘Proc’ that would be a chain reaction of tasks for the buttons once pushed. Some of which were original or borrowed from Maya Commands.
- After a lot of trial and error and help from Vince I ended up with ‘procs’ that worked, buttons with appropriate labels and a simple tool to use.
Reflection of script development –
My script in the end was close to my original idea. Given a personal greater understanding of programming and MEL I might have been able to create more options within the script and more useful tools, but that doesn’t take away the fact I ended up with what I wanted and something useful.
When coming into the subject it was quite daunting as I had no prior experience in programing. Scripting is to me is like learning another language, a language that is a mixture of English, mathematics and gibberish. After a semester of learing the basics I feel it’s still just as daunting but now I understand why and how. The class was a huge eye opener and it was kind of fun to see behind Mayas curtains.
Creating my script was a massive learing curve for me, I have huge amounts of respect for thoughs people who can use MEL and Python and other scripting programs like a second language. My script was interesting to learn how to break down each element of a simple command. Seeing how something grows from an idea to something real was interesting and understand each tiny part bit by bit.
Scripting is a massive time saver once you can master it. Its kind of like doing huge amounts of work early on so you can be lazy later on. The idea that Maya is all a huge collection of scripts is insanely awesome but crazy thought.
Below is a quote from Mayas HELP page with a overview of MEL and what it can do.
MEL TM is a scripting language at the heart of Maya. Maya’s user interface is created using MEL, and MEL provides an easy way to extend the functionality of Maya. Everything you can do using Maya’s graphical interface can be automated and extended using MEL. Familiarity with MEL can deepen your understanding of and expertise with Maya.
You can take advantage of MEL without learning programming. For example, it’s easy in Maya to perform some actions with the graphical interface, then drag the commands that resulted from the Script Editor to the shelf to create a button. However, learning MEL will open up new worlds to you, allowing you produce effects and save time in ways impossible using the graphical interface.
- Bypass Maya’s user interface, quickly create shortcuts, and access advanced features.
- Customize Maya’s interface and change defaults on a scene-by-scene basis.
- Create procedures and scripts for custom modeling, animation, dynamics, and rendering tasks.
Autodesk Maya 2013, User Guid, http://download.autodesk.com/global/docs/maya2013/en_us/index.html