Actions vs. Tools


Almost any MEL script, or any plug-in or program for that matter, can be put into one of two categories ”an action or a tool. An actionable script has a single effect. Although it can have options associated with it, an action script, once executed, simply does its job and has no further effect on an object or scene. Examples of actionable items that currently exist within Maya are the Rebuild Curve, Triangulate, or Prefix Hierarchy functions. These tools always have the same functionality, require a unique input, or have a set of options, which are stored within Maya. Yet all of these functions can be considered actions under our definition. The other type of script is best termed a tool . Tools require continuing input from the user after being executed. Although we could consider such things as the transformation manipulators tools, in the context of scripting, tools generally take the form of items like the Extrude Face, or Create Polygon tool. Some behaviors can work just as well as an action or a tool; in fact, Maya provides a preference setting to determine whether many of Maya s functions behave like a tool or an action.

Tip  

This setting can be recalled with the optionVar -query command. If we are so inclined to provide the dual functionality of a tool and an actual script, we can use this command to determine the behavior of our script.

While a script can be either an action or a tool, for purposes of simplicity throughout this text we will refer to any script within Maya as a tool, even if it could be termed an actionable item. A good percentage of scripts can be built as an action, a tool, or both. The choice is dictated by design guidelines, production philosophies, and the amount of time that can be dedicated to creating the script.




The MEL Companion
The MEL Companion: Maya Scripting for 3D Artists (Charles River Media Graphics)
ISBN: 1584502754
EAN: 2147483647
Year: 2003
Pages: 101

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net