Programming – Critical Reflection

Standard

When I first started looking at ideas for a script, I wanted to create a script that would allow me to copy any sort of animation from one character to a completely different character. However, this idea seemed a bit to ambitious especially for someone like myself who cannot quite grasp programming. I admit I have had difficulty understating MEL and I do not think I will ever be able to grasp basics of the subject but I gave myself a chance to create something even if it was extremely basic.

After much consideration, I decided to downplay my original idea of transferring animation attributes so that it worked on a simple copy and paste basis.  I started with what I knew I could do by building a window that had three basic buttons. The first would select the animated object, the second would select the unanimated object and the final button would transfer the animated keys from the source to its target. Once this was done, the difficult part of writing the script began to surface. I have had difficulty understanding where to place procs and strings as well as the use of a global proc. Procs or “Procedures are often defined by putting them in MEL files in the script path, usually in your maya/scripts directory.  Then, either the procedure is defined when you use the source command to load the MEL file, or the file is sourced automatically if (and only if) certain conditions explained below are met”[1]. Strings “can be used to store names of objects, text to be printed, characters that the user has typed, MEL or expression code”[2]. I had to look at several other examples of scripts before I could begin to understand their use.

The most difficult part was finding a way for the script to copy the keyed channels from the source to the target. Vince was excellent help here as he wasn’t even sure what command was needed for this to work. With some assistance from several members of the class, it was identified that a string was needed to list the connections of the channel from the source so that they could be copied over.

Knowing which commands to use also proved to be quite daunting on my behalf.  All the tools are laid out in front of you, it is just difficult to choose the right one and in my case there was only one command that would allow me to locate the keys within the source’s channel. This proved to be the most difficult part of the script that was already proving to be too difficult, even though the end result seemed simple to me at first.

Overall I am happy with the results of my script and the knowledge I gained from building it. If it were not for Vince, I would still be stuck at step one of planning the script. I feel I learnt the basics needed to build my own independent MEL script. If I were to attempt this again, I would provide myself with a more complex challenge that involved transferring animation from one rig to another.


[1] Local and Global Variables, Mark R. Wilkins, accessed 7/11/13, last modified  2003 <http://www.melscripting.com/tutorial_1.html&gt;

[2] MEL Scripting for Maya Animators Second Edition, Mark R. Wilkins & Chris Kazmier, Morgan Kaufman Publisher, chapter 6, page 130, Variables and Data Types

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s