tcl scripting

TCL scripting is a useful method to automate and handle tasks in Maya that would normally be far too tedious to do by hand. In this lesson, we learned to create effective TCL scripts on a basic to intermediate level.

 

The object of this assignment was to script a group of simple polygon cubes to scale back and forth on the Y-axis. Also, another objective was to make the scaling more or less erratic due to how close the object was to the ground plane.

TCL is unique in the fact that it does not have any real syntax. Most of the language can be written as (relatively) plain english. Example:

set angle [expr 2 + 2]

TCL stores all variables as strings rather than immediately assigning numeric value. Set is the basic function for declaring these variables. If you wish to use the numbers for their numeric value rather than string, we use the function expr (expression) to calculate this.

Also, note that anything within the [ square brackets ] will be executed first and return the solution as the value to be stored in the variable. So, for the above example, "angle" will be set to 4.