with d. lee

basic to intermediate learning resources for the animation autodidact.

Tuesday, February 7, 2012

Scripts make life easier, kind of like sliced bread.

Some horrible tasks can me automated with a push of a button. If you find yourself doing something over and over again, you should really consider just saving a .mel script. It is a lot like magic. I do this all the time to automate controller selections on rigs. For example, I need to select all of the controllers of the rig to key. I make a script and a button called "ALL." Then, push the button, all the controllers are selected.  

Here is a quick tutorial: How to make a Selection Script.

I am assuming you have already referenced your rig and are able to select it's controls. So, step one is to open the Script Editor. There is a handy button on the bottom right hand of the screen.

Now that the Script Editor is open. Go ahead and Edit>Clear History.

Leave your script editor window open. Now start selecting your rig's controllers. Select the first, hold SHIFT and select the second, third, etc. You will see that Maya is recording all of your actions.

Once you are done group-selecting the controllers, highlight all of the script you have generated and  File>Save Script to Shelf.

A name window will pop up asking for you to create a name. You can put whatever you want in this window. For this script, put ALL. Press OK. A second window will pop up, select MEL not Python. The script will then be put on whatever shelf you have open. Make sure to switch to the specific shelf you want before saving the script. Press and script to see what happens!

TIP: To delete a script, use the middle mouse button. Press and hold the script, drag it to the little trash can to the far right of the shelf.

This is a simple tutorial but I hope you can see how useful this can be. It'll save you loads of time.


0 comments:

Post a Comment