MAXScriptFunction Const Generic Const MappedGeneric Const NodeGeneric Const Primitives Const StructDef Const Class
When you use something like 'fn test val = ...", a MAXScriptFunction
value is created and stored in variable test. If variable test was passed into another method, for example as a filter function, that method would test the class of the value to make sure it's a MAXScriptFunction and then call it using apply().
The 'Const'
preceding the following simply says that it is a value that is created during MAXScript initialization.
A Generic
is one or more methods with the same name, but defined for different classes. Which method is called depends on the class of the first argument to the method. For example, 'random' is declared as a Generic, and there are methods implementing 'random' in several classes - Integer, Float, Point3, Color, Quat, etc. When MAXScript sees 'random v1 v2' in a script, it looks at the class of v1, and then calls the 'random' method for that class. So if v1 were a float, MAXScript would call the Float::random() method.
A MappedGeneric
is the same as a Generic, but the first argument can be a collection. If it is a collection, the the method is called individually on each member of the collection. For example, 'deleteTime $box* 10f 10f' deletes 10f at frame 10 in all keys in all objects named $box*. deleteTime can also be used on controllers, that's why it is a Generic
A NodeGeneric
is the same as a MappedGeneric, but its first argument has to be a node or a collection of nodes. But given the definition of Generic, that doesn't make much sense. If the first argument is a collection, and the method is applied to each member of the collection.
Primitives
are methods that aren't class specific. The method is responsible for checking the types of its arguments (if any) and throwing an error if one isn't correct. There is only one definition of the Primitive.
A StructDef
is a structure value. If the structure value is created by a script, its class is StructDef. If MAXScript creates the structure during initialization, its class is Const StructDef. So, for example, my meshop methods are defined to exist in a structure called meshop. Since this structure is created during initialization, the class of meshop is Const StructDef.
Const Class
is just a class that is defined in MAXScript itself. So, for example, BitArray is a Const Class. MAXScript also scans the classes registered with 3ds Max - these classes will be created in MAXScript as Const MAXClass.