classOf() and superClassOf() Methods for MAX Objects (SDK)

3DS Max Plug-In SDK

classOf() and superClassOf() Methods for MAX Objects (SDK)

Even though the individual MAX object classes are not represented by C++ classes in MAXScript, they are considered classes at the scripter level, represented by the MAXClass values. Accordingly, the MAXScript class inquiry methods, classOf(), superClassOf() and isAKindOf(), are implemented in the C++ MAXWrapper classes to use the appropriate MAXClass instance as the class of the wrapped object when called on MAX object wrapper values, such as scene nodes, modifiers, or controllers. On scene nodes, the classOf() function always returns the class of the world-state of the object, its state at the top of the modifier stack.

Examples:

classOf $foo.bend => Bend

superClassOf $foo.bend => Modifier

classOf $baz.position.controller => Bezier_position

superClassOf $baz.position.controller => Position_controller

In order to determine the class of the base object, you can use the .baseObject property of the scene node, for example on a line with an extrude modifier:

classOf $line01 => Editable_mesh

classOf $line01.baseObject => Shape