Using Script Controllers

 

   

Animation Controllers - Quick Navigation

Script controllers function in similar way to expression controllers, providing a properties dialog in which a script can be entered that is used to compute the controller value. The primary advantages of script controllers are:

When you assign a Script controller to a parameter, a Properties dialog becomes available in Track View through the right-mouse-button menu or the Properties button on the Track View toolbar.

The script controller dialog looks a lot like the expression controllers' dialog. Both expression and script controllers now use the same code base and provide very similar features. The main difference is the language used to write the expressions.

The new script controller dialog provides the following controls:

Create Variable group of controls:

Variable Parameters group of controls:

Variables:

Expression text field - used to enter the script expression to calculate the controller value. See the section below on writing controller scripts for details.

Description text field - can be used to provide comments regarding the functionality of the controller.

Load/Save buttons - Load and save scripts to text files.

Evaluate button - Evaluates the script expression. The current time is used unless explicitly stated differently in the code using the at time context or when using controller variables with Tick Offset different than 0.

Close button - Compiles and checks the controller script for errors. If no errors are found, it closes the dialog. If an error is detected, a MAXScript error message is shown first with the description of the problem. After closing the error message, a prompt appears asking whether to revert the expression to the original value of the current track and close the dialog (OK) or to return to editing the expression (Cancel):

See Also