Page 1224 - Kitab3DsMax
P. 1224
Part XII: MAXScript and Plug-Ins
FIGURE 49.13
The script commands entered in the MAXScript Listener affect the objects in the viewports.
Expressions
An expression is what Max uses to make decisions. An expression compares two things and draws a simple
conclusion based on that comparison.
Cross-Ref
These same expressions can be used within the Expression controller. You can find details on this controller in
Chapter 35, “Animating with the Expression Controller and Wiring Parameters.” n
Simple expressions
The expression
1 < 2
is a simple expression that asks the question, “Is 1 less than 2?” Expressions always ask yes/no type ques-
tions. When you type an expression in the MAXScript Listener window (or inside of a script), Max evaluates
the expression and prints true if the expression is valid (like the preceding example) and false if it isn’t.
Try the following expressions in the Listener window, and Max will print the results as shown in Figure
49.14 (you don’t have to type in the comments):
1 < 2 -- 1 IS less than 2, so expression is true
1 > 2 -- 1 is NOT greater than 2, so false
2 + 2 == 4 -- ‘==‘ means “is equal to”. 2 + 2 is
1176