The following pages will give you a quick overview of the MAXScript language changes and improvements in 3ds Max 2008. For details on each feature, please follow the links to the respective documentation pages.
A new tabbed MAXScript Editor based on the open source Scintilla control and the SciTE editor has mostly replaced the original RichEdit-based MAXScript Editor.
In addition to the MAXScript Editor, both the MAXScript Listener and its MacroRecorder pane and the Mini-Listeners in the bottom left corner of the GUI are now using the Scintilla control and provide an Undo depth of up to 500 operations!
MAXScript Tabbed Editor Overview
The above topic is an introduction to the new Editor and its main features and advantages.
This topic is an index with links to all relevant topics discussing the use of the new Editor, its menus, commands, keyboard shortcuts and the various customization methods. The same links are provided below for faster access:
Regular Expressions Find and Replace in the MAXScript Editor
MAXScript Editor - Properties File Settings
MAXScript Editor - MAXScript-Specific Language Settings
MAXScript Editor - Customizing Syntax Color Schemes
MAXScript Editor - Defining Custom Keyboard Shortcuts
MAXScript Editor - Defining Custom Context Menu Items
The following new features have been added to 3ds Max 2008 and have been exposed to MAXScript:
Interface: IViewportShadingMgr
This interface exposes the Viewport Shading System to MAXScript including shadows and per-pixel lighting.
Interface: INodeShadingProperties
This node interface exposes the Viewport Shading node properties to MAXScript.
These new methods available in the viewport struct provide means to get and set all controls of the completely rewritten Adaptive Degradation system.
Interface: INodeDisplayProperties
This new node interface provides access to the .neverDegrade property which can be used to exclude nodes from Adaptive Degradation.
The new enableHardwareMaterial() and showHWTextureMap() methods can be used to toggle the new flyout option in the Show Map In Viewports icon.
The new viewport.setFOV() method sets the active viewport's field of view in degrees.
The new method viewport.getFocalDistance() and viewport.setFocalDistance() get and set the active viewport's focal distance.
The new viewport.pan(), viewport.zoom(), viewport.zoomPerspective() and viewport.rotate() methods let you implement scripted viewport navigation operations similar to the interactive Pan, Zoom and Arc Rotate commands in the 3ds Max UI.
The existing core interface has been extended to expose some Gamma and LUT settings including the color correction mode, the LUT filename and the Gamma value.
Interface: SceneExplorerManager
This new core interface provides Scene Explorer management functions including methods to open, close, load, save, position and resize named Scene Explorers, as well as methods for adding new property filters to Scene Explorers via scripted functions.
Interface: ActionItemOverrideManager
This new core interface exposes the ActionItem Override feature to MAXScript.
This new core interface exposes the Working Pivot feature to MAXScript.
An instance of this internal helper class is used by the Working Pivot feature to display an axis tripod in the scene and set it as the current transformation system reference node.
Edit_Poly Selection Properties
A new property .selectMode was added to the Edit_Poly modifier. It exposes the new sub-object selection modes (Off - SubObj - Multi).
A new property .edgeChamferSegments was added to the Edit_Poly modifier. It exposes the new segmented edge chamfering feature.
Editable Poly Preview Selection
A new property .selectMode was added to the Editable_Poly base object. It exposes the new sub-object selection modes (Off - SubObj - Multi).
Editable_Poly Edge Chamfer Properties
A new property .edgeChamferSegments was added to the Editable_Poly base object. It exposes the new segmented edge chamfering feature.
The new unwrap6 interface exposed by the Unwrap_UVW Modifier provides access to new properties.
A new property .baseMaterial_list was added to the Unwrap_UVW Modifier.
Project_Mapping : ReferenceTarget
Several new properties related to Projection Quality were added to the Project_Mapping modifier.
New methods exportCage() and importCage() wereadded to the projectionModOps Interface exposed by the Projection Modifier.
Point_CacheSpacewarpModifier: SpacewarpModifier
A new .fileCount property was added to the Point Cache Modifier and SpaceWarp, controlling whether a single file or a file per frame will be saved.
Several new methods were added to the LoadSaveAnimation Interface, as well as a stripLayers: option to some existing methods.
Object Space Object and Head LookAt Target Properties
The properties .osObject and .headObject of the Biped Vertical_Horizontal_Turn(Body):Matrix3 Controller were changed to accept undefined as a valid value.
Several new methods related to getting the shader's techniques have been added to the function publishing interface exposed by the DirectX Shader Material
Pre-Render Script Evaluation Order Changes in 3ds Max 2008
The evaluation order of Pre- and Post-Render Scripts has been changed.
The mental ray Sky Portal Light can be used to transfer outdoor lighting indoors by defining portals at openings like windows and doors and collecting light from skylight or HDRI environment maps.
mr_Photographic_Exposure_Control : ToneOperator
This new exposure control provides a real-world workflow familiar from traditional photography.
Interface: BakeElementProperties
This new interface exposed by all BakeElements provides direct access to some Bake Element properties which were previously accessible only through the node's interface.
New properties and methods were added to the maxOps Interface to control the Default Key on Auto Key creation and time.More new properties to control the Motion tab > Trajectory sub-object modes were added.
A new maxOps.findNodes() method was added. It can be used for finidng similar nodes including filtering by material and layer.
The new AnimHandle System provides a unique ID number for every entity in the scene including nodes, modifiers, materials, controllers and so on.
The new Node Event System provides better handling of node-related events than the General Event Callback Mechanism available in previous releases of 3ds Max.
The following new features have been added to MAXScript in 3ds Max 2008:
Verbatim string literals prefixed with the '@' character are now supported and will not be expanded on evaluation even if containing escape character sequences like '\t', '\n' or '\r'.
Standard Open and Save File Dialogs
Anew historyCategory: optional keyword was added to the getOpenFilename() and getSaveFilename() methods. It allows you to specify a history category for your file dialogs.
The existing openBitMap() method now returns undefined if the bitmap cannot be loaded instead of generating a run time error.
World Space Modifiers - Validity Methods
New isSpaceWarpValid() method returns true if a Space Warp can be applied to a given object.
A new encryption scheme is provided in addition to the old encryption method. Scripts encrypted using the new method cannot be run in older versions of 3ds Max!
The Avguard DLX Extension has been completely incorporated into 3ds Max 2008.
Added a new method for intersecting a ray with all nodes in the scene.
Node Modifier Context Transform Methods
Added new methods setModContextTM() and setModContextBBox().
Added new methods isDeformable(), numPoints() and getPointPos().
Added new methods nodeGetBoundingBox() and nodeLocalBoundingBox().
Added a new method getNodeTM() which returns the node's transformation matrix, including the cases where the node is XRef Scene Object.
Added a new method for getting nodes dependent on a given MAXObject.
Added a new method for notifying all dependents of a MAXObject.
disableRefMsgs() and enableRefMsgs()
Added new methods for disabling and enabling the Reference System.
Updated the existing replaceInstances() method.
Added a new method areNodesInstances() which returns true if the two nodes passed as arguments are instances.
Added a method getLayerObject() which returns the layer's Reference Target. DEPRECATED, provided for backwards compatibility with scripts that use this method from the Avguard Extension.
Custom Attributes Definition Values
Added two new methods: custAttributes.getDefClass() and custAttributes.getDefInstances()
Added a new clearControllerNewFlag() method to clear the flag signifying that a controller is a new instance that has not been assigned to a property yet.
Added two new structs to expose the default Bezier and TCB key settings for newly created keys.
IK_ControllerMatrix3Controller : Matrix3Controller
20 new methods added to the ik struct to provide access to the Axis settings of the IK controller, including Ease, Min, Max, Damping, Angle and Spring settings.
Tweaked the existing methods: meshop.setVert() and meshop.moveVert() to allow positions to be specified alternatively as array, thus allowing multiple vertices to be affected at the same time. Also adds soft-selection support to the latter method.
Tweaked the existing methods: polyop.setVert() and polyop.moveVert() to allow positions to be specified alternatively as array, thus allowing multiple vertices to be affected at the same time. Also adds soft-selection support to the latter method.
Added new methods: weldSpline(), findPathSegAndParam(), findLengthSegAndParam(), interpBezier3D(), tangetBezier3D().
Added new methods - appendIfUnique() and makeUniqueArray() - which can be used to ensure that the array contains only unique values.
The GlobalVars struct provides methods to collect, inspect and manage global variables.
The Persistents struct provides methods to collect, inspect and manage persistent global variables.
Added new methods - pasteBitmap() and getBitmapInfo() - which can be used to paste a bitmap into another bitmap and get info about the bitmap.
Added new methods toUpper(), toLower, replaceString(), replace_LF_with_CRLF() and replace_CRFL_with_LF() for changing a string to upper and lower case, replacing all occurrences of a string with another string and converting Line Feed and Carriage Return/Line Feed text files.
Added anew method quatToEuler2() which returns the same Euler value shown in the Transform Type-In dialog, and a new method quatArrayToEulerArray() which converts an array of Quats into an array of EulerAngles.
World Space Modifiers - Force-Related Methods
Addednew methods thatcan be used to calculate forces from World Space Modifiers.
BinStream for Binary Reading and Writing
Added new BinStream I/Omethods writeLongLong(), writeDouble(), writeFloatAsDouble(), readLongLong(), readDouble() and readDoubleAsFloat().
Added a new method hasINIsetting() which returns true if the given key and/or section exists in the supplied INI file.
Added a new method pathIsNetworkPath() which returns true if the argument is a network path.
Added a new method scanForNewPlugins() which scans for new plug-in classes and exposes them to MAXScript.
Addednew methods setGridSpacing() and setGridMajorLines() for setting the spacing and major lines of the viewport grids.
Addedanew method viewport.getViewportDIB() which can be used to get the viewport Device Independent Bitmap including Multi-Pass Camera Effects preview.
Drawing Rectangle in the Viewport
Addednew methods gw.hRect() and gw.wRect() for drawing a colored rectangle in the viewport.
Drawing Triangles in the Viewport
Addednew methods gw.startTriangles(). gw.endTriangles() and gw.triangles() for drawing a series of triangles to the viewport.
Drawing TriStrip in the Viewport
Addedanew method gw.triStrip() for drawing a series of triangles to the viewport as a triangle strip.
Addedanew method setNeedsRedraw() which sets an internal MAXScript flag that theviewports need to be redrawn before MAXScript returns.
Addednew method isAnimPlaying() which returns true if the animation is playing back and false if it is not.
Addednew system global variable timeDisplayMode which can be used to get and set the time display mode.
Addednew methods renderers.GetDraftRenderer() and renderers.ClearDraftRenderer() for getting and resetting the former draft renderer which was retired in 3ds Max 6 but could still be present in old files.
MAXScript Source Filename Access
Addednew method getThisScriptFilename() which is the same as getSourceFileName() but has been available longer in the Avguard Extension and is providedfor backwards compatibility with scripts written to use the Extension.
Addedanew HiddenDOSCommand() method to execute DOS commands in a hidden window.
Addednew methods getClipBoardText(), setClipboardText(), getClipboardBitmap() and setClipboardBitmap() for getting and setting text and bitmap values from/to the Windows Clipboard.
Addednew properties sysinfo.processAffinity and sysinfo.systemAffinity for getting and setting the process and system affinity per CPU.
Addednew methods systemTools.getEnvVariable() and systools.setEnvVariable() for getting and setting values from/to the Windows Environment variables.
Added a new Windows struct providing methods to access Windows HWND values of child windows, 3ds Max and the Windows desktop.