Script Panel

The script state option lets you create a MAXScript script that takes two parameters: node and time. The script typically tests one or more values, and then returns 1 if the condition (the result of the test) is true or 0 if it’s false. This result determines whether or not the state is to be activated.

Scripts used by the clip controller are similar to those used by the cognitive controller, with the exception that a special time-related statement is required.

In the following sample script, "del" is the delegate's node, and "t" is the time. The name of the scripted function, "stoppedScript," would also need to be entered into the name field in the Script panel of the ClipState dialog. Unlike cognitive controller scripts, the statement "at time t" needs to be invoked because the animation is not running when the synthesis takes place.

fn stoppedScript del t = (
at time t
if del.pos.z < 65 then 1 else 0
)

Interface

Use Script

Turn this on to use a MAXScript script to control a clip.

Script group

[function name field]

Enter the name of the function defined by the script, also found at the start of the script.

Edit Script

Opens a MAXScript editor window that lets you edit the script.