Chapter 18. Installing MEL Scripts

In this chapter you will learn

  • How to make your scripts available in all of your scenes.

  • How to run a script whenever Maya starts.

  • How to add a script to your scene as a script node, so that it stays with that scene as it is copied from machine to machine.

  • How to create a custom menu item.

  • How to add a MEL command as a shelf button and customize its icon.

Installing a Script to Make It Available in All Scenes

To make scripts available in all Maya scenes, you must first create a text file that contains your script and whose name ends in .mel. The easiest way to do this is to use the Script Editor’s Save selected … command to save a selection into a .mel file.

You can use the source command by hand to run the contents ...

Get MEL Scripting for Maya Animators, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.