Value Common Properties, Operators, and Methods

Operators

<value> == <value>

compare if equal

<value> != <value>

compare if not equal

<value> as <class>

Converts the value to an instance of given class. See the description for each class for valid conversions. All values can be converted to class String, which yields a string with the printed representation of the value.

Methods

print <value> [ to:<stream> ] [#noMap]    -- mappable

where <stream> is

( <filestream> | <stringstream> | <windowstream> )

Prints single value to Listener or optional filestream, stringstream, or windowstream, followed by a line break. If the argument value is a Collection, and #noMap is not specified, each value in the collection is printed out on a separate line. If #noMap is specified, the collection value is printed out on a single line. The printed form of all basic data value types, except for BigArray, are directly readable by the readValue() and readExpr() functions, making it simpler to read back in values printed to a file by MAXScript. If the pre-3ds max R3 print forms are required for compatibility with existing scripts, you can set the system global variable options.oldPrintStyles to true.

format <format_string> { <value> } [ to:<stream> ]

Prints one or more values to Listener or optional filestream, stringstream, or windowstream, using the format string as a template. The format string is a string that can contain plain text to print interspersed with the '%' (percent) metacharacter. Each occurrence of a '%' is replaced by the printed representation of the successive argument values following the format string. For example:

format "name:%, pos:%\n" obj.name obj.pos

generates something like:

name: box01, pos: [0, 150.0, 0.5]

format does not automatically append a line break to the output stream, so you can build up a line from several format calls and generally control layout better. An explicit '\n' newline escape character sequence is needed to place a line break in the output stream. Other escape character sequences are documented in String Literals.

classOf <value>

Returns the value's class. Each type of value has its own class. If the value is a Node value, classOf() returns the class of the world state object (the state of the node at the top of its stack). See Node : MAXWrapper for more information.

Note:

To avoid a conflict between a user class value in global variable named 'rollout' and MAXScript reserved word 'rollout' which always introduces a rollout definition the class variable name for a rollout is RolloutClass.

So, for a rollout foo you'd now say "if classOf foo == RolloutClass".

superClassOf <value>

Returns the value's superclass. A value's superclass is the class from which the value's class was derived.

isKindOf <value> <class>

Returns true if value has given class or inherits from class.

isStructDef <value>

Returns true if the value is a structure definition

isStruct <value>

Returns true if the value is a structure instance

isController <value>

Returns true if the value is a controller

getHashValue <value> <Integer oldHaskValue>

If the value is one of the supported value types, returns an integer hash value that is a factor of the value and oldHaskValue. If the value type is not supported, returns a value of undefined. The supported value types are:

Float

Integer

String

BitArray

Point3

Ray

Quat

AngAxis

EulerAngles

Matrix3

Point2

Color

Arrays containing any of the above value types