What is New in MAXScript > What was New in MAXScript in Previous Versions > What was New in MAXScript in 3ds Max 2008 >

# What was New in MAXScript in 3ds Max 2008

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.

## SciTE MAXScript Editor

The MAXScript Editor Windows

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.

MAXScript Editor Commands

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:

### MAXScript Editor - Menu Options:

File Menu

Edit Menu

Search Menu

Regular Expressions Find and Replace in the MAXScript Editor

MAXScript Editor - Output Pane

View Menu

Tools Menu

Options Menu

Language Menu

Windows Menu

Help Menu

### MAXScript Editor - Keyboard Shortcuts:

MAXScript Editor - Keyboard Shortcuts

### MAXScript Editor - Configuration and Customization:

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

List of Editor Menu Commands

List of Editor Key Commands

MAXScript Editor - Defining And Using Abbreviations

MAXScript Editor - Defining Custom Status Bars

## New 3ds Max Features Exposure

The following new features have been added to 3ds Max 2008 and have been exposed to MAXScript:

### Viewport Shading - Illumination and Shadows

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.

### Adaptive Degradation

Adaptive Degradation Access

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.

### Show Map In Viewports

Show Hardware MapIn Viewports

The new enableHardwareMaterial() and showHWTextureMap() methods can be used to toggle the new flyout option in the Show Map In Viewports icon.

### Viewport Controls

Viewport.SetFOV

The new viewport.setFOV() method sets the active viewport's field of view in degrees.

Viewport.GetFocalDistance

The new method viewport.getFocalDistance() and viewport.setFocalDistance() get and set the active viewport's focal distance.

ViewportPan, Zoom and Rotate

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.

### Display Color Correction - Gamma and LUT

Interface: IDisplayGamma

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.

### Scene Explorer

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.

### ActionItem Override

Interface: ActionItemOverrideManager

This new core interface exposes the ActionItem Override feature to MAXScript.

### Working Pivot

Interface: WorkingPivot

This new core interface exposes the Working Pivot feature to MAXScript.

Axis_Helper : Helper

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.

### Polygon Modeling

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).

Edit_Poly Chamfer Properties

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.

### Unwrap_UVW Modifier

Unwrap6Interface

The new unwrap6 interface exposed by the Unwrap_UVW Modifier provides access to new properties.

Unwrap_UVW : Modifier

A new property .baseMaterial_list was added to the Unwrap_UVW Modifier.

### Projection Modifier

Project_Mapping : ReferenceTarget

Several new properties related to Projection Quality were added to the Project_Mapping modifier.

Projection Modifier Cage

New methods exportCage() and importCage() wereadded to the projectionModOps Interface exposed by the Projection Modifier.

### Point Cache Modifier and SpaceWarp

Point_Cache: 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.

### Load / Save Animation

Interface: LoadSaveAnimation

Several new methods were added to the LoadSaveAnimation Interface, as well as a stripLayers: option to some existing methods.

### Biped

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.

### DirectX Shader

DirectX_9_Shader

Several new methods related to getting the shader's techniques have been added to the function publishing interface exposed by the DirectX Shader Material

### Export

Interface: s3dexporter

This new core interface provides access to some actions in the Shockwave 3D Exporter Dialog.

### Render Scene Dialog

Pre-Render Script Evaluation Order Changes in 3ds Max 2008

The evaluation order of Pre- and Post-Render Scripts has been changed.

### mental ray

mr_Sky_Portal : light

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.

### Bake Elements

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.

### MaxOps Interface

Interface: maxOps

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.

### MenuMan Interface

Interface: menuMan

A new method createMenuItemFromAction() was added to the menuMan Interface.

### AnimHandle System

AnimHandle System

The new AnimHandle System provides a unique ID number for every entity in the scene including nodes, modifiers, materials, controllers and so on.

### Node Event System

Node Event System

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.

### Default Actions

Interface: defaultActions

The new default Actions core interface provides access to the default actions for several events like missing UVWs, missing DLLs and so on.

## MAXScript Language Improvements

The following new features have been added to MAXScript in 3ds Max 2008:

Verbatim String Literals

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.

OpenBitmap

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.

Encrypting Script Files

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!

## Avguard Extensions

The Avguard DLX Extension has been completely incorporated into 3ds Max 2008.

### Node Related Methods

IntersectRayScene

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().

Node Deformable Methods

Added new methods isDeformable(), numPoints() and getPointPos().

Node Bounding Box Methods

Added new methods nodeGetBoundingBox() and nodeLocalBoundingBox().

getNodeTM Method

Added a new method getNodeTM() which returns the node's transformation matrix, including the cases where the node is XRef Scene Object.

### References, Dependencies, Instances

refs.dependentNodes()

Added a new method for getting nodes dependent on a given MAXObject.

notifyDependents()

Added a new method for notifying all dependents of a MAXObject.

disableRefMsgs() and enableRefMsgs()

Added new methods for disabling and enabling the Reference System.

replaceInstances Method

Updated the existing replaceInstances() method.

AreNodesInstances Method

Added a new method areNodesInstances() which returns true if the two nodes passed as arguments are instances.

Interface: Layer Manager

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.

### CustAttributes Structure Methods

Custom Attributes Definition Values

Added two new methods: custAttributes.getDefClass() and custAttributes.getDefInstances()

### Controller Methods and Structures

clearControllerNewFlag Method

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.

BezierDefaultParams Structure

TCBDefaultParams Structure

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.

### Meshop Structure Methods

Meshop Vertex Methods

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.

### Polyop Structure Methods

Editable Poly Methods

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.

### Spline Shape Methods

New SplineShape Methods

Added new methods: weldSpline(), findPathSegAndParam(), findLengthSegAndParam(), interpBezier3D(), tangetBezier3D().

### Array Values

Array Values

Added new methods - appendIfUnique() and makeUniqueArray() - which can be used to ensure that the array contains only unique values.

### Global Variables Management

globalVars Structure

The GlobalVars struct provides methods to collect, inspect and manage global variables.

Persistents Structure

The Persistents struct provides methods to collect, inspect and manage persistent global variables.

### Bitmap Values

pasteBitmap

Added new methods - pasteBitmap() and getBitmapInfo() - which can be used to paste a bitmap into another bitmap and get info about the bitmap.

### DataPair Values

DataPair Values

Added new DataPairValue class - a wrapper around two values of any type.

### String Value Methods

String ValueMethods

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.

### Quat and Euler Value Methods

Euler Angles Methods

Quat Related Methods

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 and Space Warps

World Space Modifiers - Force-Related Methods

Addednew methods thatcan be used to calculate forces from World Space Modifiers.

### File Input and Output

BinStream for Binary Reading and Writing

Added new BinStream I/Omethods writeLongLong(), writeDouble(), writeFloatAsDouble(), readLongLong(), readDouble() and readDoubleAsFloat().

Accessing INI File Keys

Added a new method hasINIsetting() which returns true if the given key and/or section exists in the supplied INI file.

### Filename Parsing

File Name Parsing

Added a new method pathIsNetworkPath() which returns true if the argument is a network path.

### Plug-ins Loading

Miscellaneous Functions

Added a new method scanForNewPlugins() which scans for new plug-in classes and exposes them to MAXScript.

### Viewports

Viewport Grids

Addednew methods setGridSpacing() and setGridMajorLines() for setting the spacing and major lines of the viewport grids.

Viewport.GetViewportDib()

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.

Refreshing the Viewports

Addedanew method setNeedsRedraw() which sets an internal MAXScript flag that theviewports need to be redrawn before MAXScript returns.

### Animation Playback

isAnimPlaying

Addednew method isAnimPlaying() which returns true if the animation is playing back and false if it is not.

### System Global Variables

timeDisplayMode

Addednew system global variable timeDisplayMode which can be used to get and set the time display mode.

### Renderers

Renderers

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.

### Mouse Cursor

Mouse Cursors

Addednew read-only property mouse.inAbort

### Paths and Filenames

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.

### Executing External Commands

Executing External Commands

Addedanew HiddenDOSCommand() method to execute DOS commands in a hidden window.

### Interaction With The Operating System

Copy To and From Clipboard

Addednew methods getClipBoardText(), setClipboardText(), getClipboardBitmap() and setClipboardBitmap() for getting and setting text and bitmap values from/to the Windows Clipboard.

System Information

Addednew properties sysinfo.processAffinity and sysinfo.systemAffinity for getting and setting the process and system affinity per CPU.

System Tools

Addednew methods systemTools.getEnvVariable() and systools.setEnvVariable() for getting and setting values from/to the Windows Environment variables.

Windows Structure

Added a new Windows struct providing methods to access Windows HWND values of child windows, 3ds Max and the Windows desktop.

### Windows Registry Access

Registry Structure

Added a new Registry struct providing methods to access Windows Registry keys and values.

HKey Values

Addednew HKey Value class representing a Registry Key value.

#### See Also

- Documentation Changes in 3ds Max 2008
- New in MAXScript