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.
Scripting Editor
A new tabbed Scripting Editor based on the open source Scintilla control and the SciTE editor has mostly replaced the original RichEdit-based Scripting Editor.
In addition to the Scripting Editor, both the Scripting 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!
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:
Scripting Editor - Menu Options:
Regular Expressions Find and Replace in the Scripting Editor
Scripting Editor - Output Pane
Scripting Editor - Keyboard Shortcuts:
Scripting Editor - Keyboard Shortcuts
Scripting Editor - Configuration and Customization:
Scripting Editor - Properties File Settings
Scripting Editor - MAXScript-Specific Language Settings
Scripting Editor - Customizing Syntax Color Schemes
Scripting Editor - Defining Custom Keyboard Shortcuts
Scripting Editor - Defining Custom Context Menu Items
Scripting Editor - Defining And Using Abbreviations
Scripting 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
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
The new enableHardwareMaterial()
and showHWTextureMap()
methods can be used to toggle the new flyout option in the Show Map In Viewports icon.
Viewport Controls
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.
Display Color Correction - Gamma and LUT
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
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.
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).
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
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.
Projection Modifier
Project_Mapping : ReferenceTarget
Several new properties related to Projection Quality were added to the Project_Mapping modifier.
New methods exportCage()
and importCage()
were added to the projectionModOps Interface exposed by the Projection Modifier.
Point Cache Modifier and SpaceWarp
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
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
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
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
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
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
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
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 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!
Avguard Extensions
The Avguard DLX Extension has been completely incorporated into 3ds Max 2008.
Node Related Methods
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().
Node Bounding Box Methods
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.
References, Dependencies, Instances
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.
CustAttributes Structure Methods
Custom Attributes Definition Values
Added two new methods: custAttributes.getDefClass()
and custAttributes.getDefInstances()
Controller Methods and Structures
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.
Meshop Structure 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
Added new methods: weldSpline(), findPathSegAndParam(), findLengthSegAndParam(), interpBezier3D(), tangetBezier3D().
Array Values
Added new methods - appendIfUnique()
and makeUniqueArray()
- which can be used to ensure that the array contains only unique values.
Global Variables Management
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.
Bitmap Values
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
Added new DataPairValue class - a wrapper around two values of any type.
String Value Methods
Added new methods toUpper(), toLower, substituteString(), 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
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().
Added a new method hasINIsetting()
which returns true if the given key and/or section exists in the supplied INI file.
Filename Parsing
Added a new method pathIsNetworkPath()
which returns true if the argument is a network path.
Plug-ins Loading
Added a new method scanForNewPlugins()
which scans for new plug-in classes and exposes them to MAXScript.
Viewports
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.
Animation Playback
Addednew method isAnimPlaying()
which returns true if the animation is playing back and false if it is not.
System Global Variables
Addednew system global variable timeDisplayMode
which can be used to get and set the time display mode.
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
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
Addedanew HiddenDOSCommand()
method to execute DOS commands in a hidden window.
Interaction With The Operating System
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.
Windows Registry Access
Added a new Registry struct providing methods to access Windows Registry keys and values.
Addednew HKey Value class representing a Registry Key value.