The 3ds Max system global variables give you access to state information in the 3ds Max system.
Except where noted as read-only, you can both access and assign to the global variables.
Contains the currently active grid. If the home grid is active, returns the value undefined .
You can assign a grid node object to this variable to make it the currently active grid.
See Viewport Grids.
You can also return to the home grid by setting activegrid = undefined .
Lets you get and set a Color value that defines the global rendering environment (Rendering > Environment) ambient lighting color.
See Environment And Effects Dialog.
Lets you get and set a Controller value that defines the global rendering environment (Rendering > Environment) ambient lighting color controller.
See Environment And Effects Dialog.
animateMode
Gets or sets the current Auto Key Animation Mode.
Lets you get and set an Interval value that defines the start and end of the current active animation range.
This variable contains the corresponding values set in the Time Configuration dialog.
A Boolean value that specifies whether the user can change the state of the Animate button.
If set to false , the user can not change the Animate button state.
If set to true , the user can change the Animate button state.
A script can change the state of the Animate button using animButtonState regardless of the animButtonEnabled value.
SeeTime Control.
Lets you to get and set the state of the Animate button.
A Boolean value - true if Animate is on, false if Animate is off.
SeeTime Control.
Get/set whether auto backup is enabled as a <boolean>.
Get/set the time in minutes between auto backup as a <float>.
If the specified value is < 0.01 (the UI limit), the time is set to 0.01.
Lets you get and set a Color value that defines the global rendering environment (Rendering > Environment) background color.
See Environment And Effects Dialog.
Lets you get and set a Controller value that defines the global rendering environment (Rendering > Environment) background color controller.
See Environment And Effects Dialog.
Lets you get and set a String value that defines the viewport background image bitmap file name.
This variable contains the corresponding bitmap file name set in the Viewport Background dialog.
Lets you get and set whether the command panel is displayed.
A Boolean value - true if the command panel is displayed, false if not displayed.
SeeCommand Panels.
Contains a virtual array of materials and root level maps corresponding to the currently opened material library.
You can get library materials via array indexing and iterate over them in a for loop.
The array can be indexed by number, or by name or string to select by material name.
This variable is read-only. See MaterialLibrary Values.
Lets you get and set Float values that define the gamma preference settings.
They contain the corresponding values set in the Gamma tab of the Preferences dialog.
You could use these global variables to establish gamma for a MAXScript-created bitmap,
FOR EXAMPLE, |
This would cause the rendered bitmap to display using the current displays gamma setting if used as a rollout bitmap or button image. |
See also Interface: IDisplayGamma for Gamma-related properties and methods.
Lets you get and set whether Show Safe Frames is on for the active viewport.
A Boolean value - true if Show Safe Frames is on, false if off.
Lets you get and set a TextureMap value that defines the global rendering environment (Rendering > Environment) environment map.
See Environment And Effects Dialog.
Also see the System Global Variable useEnvironmentMap for control over the on/off state of the environment map.
Lets you get and set an Integer value that defines the time in milliseconds the user must hold down on a flyout before the flyout is activated.
This variable contains the corresponding value set in the General tab of the Preferences dialog.
Same as the System Global Variable preferences.flyOffTime.
Lets you get and set an Integer value that defines the current scene frame rate in frames-per-second.
This variable contains the corresponding value set in the Time Configuration dialog.
Contains a MAXTVNode value that defines the top-level Global Tracks node in Track View.
See Track View Nodes.
Contains an Integer value that defines the 3ds Max hardware lock ID.
Contains a Float value that defines the Hot Spot/FallOff Angle Separation value.
This variable contains the corresponding value set in the Rendering tab of the Preferences dialog.
These read-only variables access the current state of the keyboard Shift, Control, Alt and Escape keys.
They return true or false depending on the pressed state of the key at the time the variable is read.
Lets you get and set a Float value that defines the global rendering environment (Rendering > Environment) Global Lighting Tint Level.
See Environment And Effects Dialog.
Lets you get and set a Controller value that defines the global rendering environment (Rendering > Environment) Global Lighting Tint Level controller.
See Environment And Effects Dialog.
Lets you get and set a Color value that defines the global rendering environment (Rendering > Environment) Global Lighting Tint color.
See Environment And Effects Dialog.
Lets you get and set a Controller value that defines the global rendering environment (Rendering > Environment) Global Lighting Tint color controller.
See Environment And Effects Dialog.
Read only system global - listener edit window <WindowStream> value.
Contains a String value that defines the current local date and time.
An example of the value stored in localtime is:
The format of this string is controlled by the date format selected in the main Windows Regional Settings control panel.
See also Local and Universal Time.
Lets you get and set whether error logging quiet mode is enabled.
A Boolean value set to true when you do not want error messages from the renderer to bring up dialog boxes.
If set to false , error messages from the renderer will bring up dialog boxes.
3ds Max sets the corresponding internal variable to true during network rendering to suppress error messages such as the "Missing Maps" and "Missing Map Coordinates" dialogs.
If this variable is set to true and the renderer generates an error message, the renderer will exit.
After setting quiet mode, do not forget to clear it when you are done, since the user will not see any error messages from the renderer while quiet mode is enabled.
See also logsystem_struct for log system related methods.
Read-only system global - represents the Macro Recorder edit window <WindowStream> value.
Get/set the 3ds Max manipulate mode.
When true , manipulate mode is active.
See also the topic Scripted Manipulators for details.
Contains a String value that defines the file name for the currently open scene.
See How do I get the file name of the current scene? FAQ entry as well as 3ds Max File Loading and Saving.
Contains a String value that defines the directory path for the currently open scene.
The enum values returned are as follows:
Contains a virtual array of materials and root level maps corresponding to the slots in the material editor.
You can access material editor materials and root level maps via array indexing and iterate over them in a for loop.
The array can be indexed by number to specify slot number or name or string to select by material and root level map name.
This variable is read-only, but the elements (the materials in the slots) are assignable.
See Material Editor for methods for assigning materials and maps to the material editor slots.
Contains an Integer value that defines the number of current render effects defined in the Rendering > Effects dialog list.
SeeRenderEffect.
Contains an Integer value that defines the number of atmospheric events, as shown in Rendering > Environment.
See Environment And Effects Dialog.
Lets you get the number of sub-object levels supported by the object or modifier currently selected in the modifier stack.
If the Modify panel is not open or no objects are selected, the global contains the value undefined . See Modify Panel.
The subObjectLevel and numSubObjectLevels system global variables return values other than 'undefined' if you are in the Motion panel.
At the top of the Motion panel there is a Selection Level/Sub-Object drop-down list. This is for Trajectory mode, and switches you in and out of Keys SO mode.
Because of this, the test (subobjectlevel != undefined) is not a valid test of whether you are in the Modify panel.
Instead, use the test (getCommandPanelTaskMode() == #modify) .
Lets you get and set whether to playback the active viewport only.
This variable contains the corresponding value set in the Time Configuration dialog.
A Boolean value - true if Active Viewport Only is on, false if off. See Time Configuration Dialog.
preferences.autoKeyDefaultKeyOn
NEW in 3ds Max 2017: This System Global variable controls whether a default key with the current value will be created when a controller with no keys is animated in Auto Key mode at a time different from the value set by preferences.autoKeyDefaultKeyTime.
Corresponds to the checkbox exposed in the Main Menu > Customize > Preferences > Animation > Auto Key Default Frame group of controls.
Default is True.
When set to False, a new key will be created only at the current time, and the original value of the controller will be lost.
preferences.autoKeyDefaultKeyTime
NEW in 3ds Max 2017: This System Global variable controls the frame on which a default key with the current value will be created when a controller with no keys is animated in Auto Key mode at a different time.
Corresponds to the value spinner exposed in the Main Menu > Customize > Preferences > Animation > Auto Key Default Frame group of controls.
Default is 0.
The value can be set to any valid frame number.
Note that in versions prior to 3ds Max 2017, the default key time could only be set to 0 or 1.
Lets you get and set whether to use the same coordinate system for the Move, Rotate, and Scale tools in the 3ds Max toolbar.
A Boolean value - true if Constant is on, false if off.
This variable matches the Constant check box in the General page of Customize > Preferences.
A PRS animation controllers message notification system optimization was introduced in 3ds Max 6 and was enabled by default. It speeds up complex rigs using multiple animation controllers.
When set to true, the optimization is enabled and no redundant notifications are sent by the controllers.
When set to false, the animation system behaves as in 3ds Max 5 and earlier.
preferences.EnableOptimizeDependentNotifications
NEW in 3ds Max 2017: For internal use only.
Related Methods:
<array>GetOptimizeDependentNotificationsStatistics()
Returns the optimized dependent notification statistics as an array of two Integer64 values.
<void>ResetOptimizeDependentNotificationsStatistics()
Resets the statistics counters to zero.
Lets you get and set an Integer value that defines the time in milliseconds the user must hold down on a flyout before the flyout is activated.
This variable contains the corresponding value set in the General page of Customize > Preferences.
Same as the System Global Variable flyOffTime.
An optimization was introduced in 3ds Max 7 that checks to see if a node has already been invalidated before sending out notifications to it's dependents that it has been changed. It speeds up complex rigs, especially those that involve the new expose transform helper.
When set to true, the optimization is enabled and multiple notifications will not be sent out.
When set to false, the animation system behaves as in 3ds Max 6 and earlier.
Lets you get and set an Integer value that specifies the maximum number of g-buffer layers generated during a render.
Lets you get and set a Boolean value that defines whether cursor wrapping is limited to an area close to the spinner when you drag to adjust spinner value.
This variable contains the corresponding value set in the General page of Customize > Preferences.
This integer value defines the number of decimal digits displayed by spinners.
Corresponds to the Precision value in the Spinners group in Customize > Preferences > General.
This float value defines the spinner snap value.
Corresponds to the Snap value in the Spinners group in Customize > Preferences > General.
This Boolean value defines whether to use the spinner snap.
Corresponds to the Use Snap checkbox in the Spinners group in Customize > Preferences > General.
Lets you get and set whether to use small or large dots when representing vertices as dots.
A Boolean value set to true if you when using dots to represent vertices and a large size is desired.
The value of this variable only has effect when UseVertexDots is set to true .
This variable contains the corresponding value set in the Viewports page of Customize > Preferences.
Lets you get and set whether to use the Transform Gizmos.
A Boolean value - true if on, false if off.
This variable contains the corresponding value set in the Viewports page of Customize > Preferences.
Lets you get and set whether to represent vertices as dots.
A Boolean value set to true when you want to use dots as the representation of the vertices in a mesh. If set to false , ticks will be used.
This variable contains the corresponding value set in the Viewports page of Customize > Preferences.
Lets you get and set whether to playback in real time mode. This variable contains the corresponding value set in the Time Configuration dialog.
A Boolean value - true if Real Time is on, false if off.
See Time Configuration Dialog.
In versions prior 3ds Max 6, this global variable was used to get and set the renderer type (#production or #draft).
The #draft renderer option has been removed from 3ds Max 6, making this variable obsolete.
It only accepts and returns #production now and is kept for backwards compatibility of scripts from earlier versions that might be checking this value.
Lets you get and set whether to perform displacement mapping during a render.
A Boolean value - true if displacement mapping is to be performed, false if not.
Lets you get and set whether to perform Render Effects after a scene render.
A Boolean value - true if Render Effects are to be performed, false if not.
Lets you get and set an Integer value that defines the output size height for the active renderer.
This variable contains the corresponding value set in the Render Scene dialog.
See Render Scene Dialog.
Lets you get and set an Integer value that defines the output pixel aspect for the active renderer.
This variable contains the corresponding value set in the Render Scene dialog.
Lets you get and set an Integer value that defines the output size width for the active renderer.
This variable contains the corresponding value set in the Render Scene dialog.
See Render Scene Dialog.
Lets you get and set a String value that defines the output file name for the active renderer.
This variable contains the corresponding value set in the Render Scene dialog.
If this global variable is set to "" the Save File check box in the Render Scene dialog is unchecked.
When set to true , area lights will be examined and converted to point light sources when appropriate.
Contains a Node value that defines the root node of the scene.
The root node does not physically exist in the scene, rather it is a special node that is the parent node of all nodes that are not linked to another node.
The scene objects can be enumerated by accessing the children property of the root node.
A run-time error is generated if you try to perform other node operations on the root node.
Represents the scene root in scripts and Macro Recorder output.
The subAnims of rootScene include the node hierarchy, the Material Editor, Track View, Scene Material Library etc.
Contains a virtual array of materials and root level maps corresponding to the materials and root level maps present in the scene.
You can get scene materials and root level maps via array indexing and iterate over them in a for loop.
The array can be indexed by number, or by name or string to select by material or root level map name.
Contains a String value that defines the full directory path to the current Scripts directory.
Contains a virtual array of all the current named node selection sets in the Named Selection Set drop-down list on the 3ds Max toolbar.
You can get named selection sets via array indexing and iterate over them in a for loop.
The array can be indexed by number, or by name or string to select by named selection sets.
You can change, add and delete Named Selection Sets by using the standard array methods on the selectionSets array.
Lets you get and set the state of the Show End Result Toggle icon in the Modify panel.
A Boolean Value - true if Show End Result is on, false if off. See Modify Panel.
Lets you get and set whether to skip rendered frames during a render.
A Boolean Value - true if rendered frames are to be skipped, false if not.
Lets you get and set a Time value that defines the time associated with the 3ds Max time slider.
SeeTime Control.
Lets you get and set a Boolean value defining the Snap toggle state - on ( true ) or off ( false ).
See Status Bar Buttons as well as the SnapMode struct topic.
Lets you get and set a Name value defining whether 2D ( #2D ), 2.5D ( #2_5D ), or 3D ( #3D ) is the current snap type.
See Status Bar Buttons as well as the SnapMode struct topic.
A System Global variable which lets you get and set the Snap Preview Radius value.
Available in 3ds Max 7 and higher.
Also see the SnapMode struct topic.
A System Global variable which lets you get and set the Snap Radius value.
Available in 3ds Max 7 and higher.
Also see the SnapMode struct topic.
A System Global which lets you get and set the color value of the Snap Marker.
Available in 3ds Max 7 and higher.
A System Global which lets you get and set the Snap Marker Size.
Available in 3ds Max 7 and higher.
A System Global which lets you get and set whether to snap to frozen objects.
Available in 3ds Max 7 and higher.
A System Global which lets you get and set whether the snap should use axis constraints as Boolean value.
Corresponds to the checkbox in the "Grid and Snap Settings" dialog, Options tab.
Available in 3ds Max 7 and higher.
A System Global which lets you get and set whether to display rubber band as a Boolean value.
Corresponds to the checkbox in the "Grid and Snap Settings" dialog, Options tab.
Available in 3ds Max 7 and higher.
A System Global which lets you get and set the state of the "Use Axis Center As Start Snap Point" option as Boolean value.
Corresponds to the checkbox in the "Grid and Snap Settings" dialog, Options tab.
Available in 3ds Max 7 and higher up to3ds Max 2010.
Attempting to access this property will result in:
-- Runtime error: Cannot set this snap option. It has been deprecated as of 3ds Max 2011.
A System Global which lets you get and set whether the Snap Marker is displayed.
Available in 3ds Max 7 and higher.
A System Global which lets you get and set the Snap Strength as an integer value.
Available in 3ds Max 7 and higher.
A System Global which contains true if the Marker is currently snapped to something, false if not snapped.
Contains undefined if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains the node currently being snapped to.
Contains undefined if not snapped to a node or if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains the Snap System Flags as an integer.
Contains undefined if Snaps not active.
Available in 3ds Max 7 and higher.
A System Global which contains the last Snap Point as Point3 coordinate in local coordinates of the node snapped to.
Contains undefined if Snaps are not active.
Available in3ds Max 7 and higher.
A System Global which contains the last Snap Point as Point3 world coordinate.
Contains undefined if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains the last Snap Point as a Point3 screen coordinate.
Contains undefined if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains true if at least one Snap Point has been recorded.
Contains undefined if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains the last Snap Point as point3 world coordinate.
Contains undefined if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains the first snap point as point3 world coordinate.
Contains undefined if Snaps are not active.
Available in 3ds Max 7 and higher.
A System Global which contains the number of OSnaps as an integer.
Currently there are 6 sets of OSnaps - see below of details.
Available in 3ds Max 7 and higher.
Lets you get and set the sub-object level in the Modify panel if it is open. An Integer value of zero or greater up to the number of sub-object levels supported by the currently open modifier, typically in the order shown in the Sub-Object drop-down list.
A subObjectLevel of 0 means sub-object mode is off.
If the Modify panel is not open or sub-object level setting not permitted in the current modifier, the global contains the value undefined .
Use the numSubObjectLevels global variable to access the maximum valid subObjectlevel value.
See Modify Panel.
The subObjectLevel and numSubObjectLevels system global variables return values other than 'undefined' if you are in the Motion panel.
At the top of the Motion panel, there is a Selection Level/Sub-Object drop-down. This is for Trajectory mode, and switches you in and out of Keys SO mode.
Because of this, the test (subobjectlevel != undefined) is not a valid test of whether you are in the Modify panel. Instead, use the test (getCommandPanelTaskMode() == #modify).
A read only variable to get the desktop size in pixels as a <point2> value.
See also System Information and getMAXWindowSize() under Miscellaneous Functions
A read only variable to get the desktop color depth in bits per pixel as an <integer> value.
See also System Information.
Get/set the 3ds Max process priority as a <name> value. Valid priority values are #high , #normal , and #low .
See also System Information.
Lets you get and set an Integer value defining the system time resolution.
There are always 4800 ticks per second, this means that ticksPerFrame is dependent on the frames per second rate (ticksPerFrame * frameRate == 4800)
Lets you get and set whether to playback the active viewport only.
This variable contains the corresponding value set in the Time Configuration dialog.
A Boolean value - true if Active Viewport Only is on, false if off.
See Time Configuration Dialog.
Same as playActiveOnly System Global.
Lets you get and set whether to playback in real time mode.
This variable contains the corresponding value set in the Time Configuration dialog.
A Boolean value - true if Real Time is on, false if off.
See Time Configuration Dialog.
Same as realTimePlayback System Global.
Lets you get and set the viewport playback speed mode.
Get/set whether to loop the viewport playback. Only used when timeConfiguration . realTimePlayback is set to true.
See Time Configuration Dialog.
Available in 3ds Max 8 and higher.
Lets you get and set the state of the Time Configuration dialog 'Key Steps / Use TrackBar' check box.
A Boolean value - true if checked, false if not.
See Time Configuration Dialog.
Lets you get and set whether to playback the Time Display mode. It contains the corresponding value set in the Time Configuration dialog as a Name value.
Available in 3ds Max 2008 and higher. Previously available in the Avguard DLX Extension
Possible values are #frames, #smpte, #frameTicks, #timeTicks.
Get/set the 3ds Max axis constraints.
The axis constraints values are:
See Main Toolbar.
Get/set the 3ds Max command mode.
The value of the command mode is a <name> value if the command mode is a recognized command mode, otherwise the return value is an integer value.
The recognized command modes are:
#SELECT #MOVE #ROTATE #NUSCALE #USCALE #SQUASH #VIEWPORT #HIERARCHY #CREATE #MODIFY #MOTION #ANIMATION #CAMERA #NULL #DISPLAY #SPOTLIGHT #PICK
When setting the 3ds Max command mode, only the following command modes are valid:
See Main Toolbar.
A read/write variable containing a node value or undefined.
This variable reflects which node, if any, is the current reference coordinate system node.
Assignment to this variable must be a node value.
See Main Toolbar.
Get the 3ds Max command mode as Integer ID.
See Main Toolbar.
Lets you get and set the filter specifying which types of keys to show in the Trackbar.
A Name value - the valid values are: #all , #TMOnly , #currentTM , #object , and #mat .
Lets you get and set whether the Trackbar is visible.
A Boolean value - true if the Trackbar is visible, false if invisible.
Contains a MAXTVNode value that defines top-level World node in Track View.
This variable is read-only. See Track View Nodes.
Get/set the current unit display type as a <name>.
See Units Struct - Accessing System and Display Units.
Get/set the current metric unit display type as a <name>.
Valid metric unit display types are:
See Units Struct - Accessing System and Display Units.
Get/set the current US standard unit display type as a <name>.
Valid US standard unit display types are:
See Units Struct - Accessing System and Display Units.
Get/set the current US fraction display type as a <name>.
Valid US fraction display types are:
See Units Struct - Accessing System and Display Units.
Get/set the current custom unit name as a <string>
See Units Struct - Accessing System and Display Units.
Get/set the current custom unit value as a <float>
See Units Struct - Accessing System and Display Units.
Get/set the current custom unit type as a <name>.
Valid custom unit display types are:
See Units Struct - Accessing System and Display Units.
Get/set the current system unit scale value as a <float>.
This is the value shown in Customize Units Setup... > System Units Setup > System Units Scale group.
See Units Struct - Accessing System and Display Units.
Get/set the current system unit scale type as a <name>. This is the unit shown in Customize > Units Setup... > System Units Setup > System Units Scale group.
Valid system unit scale types are:
See Units Struct - Accessing System and Display Units.
Lets you get and set the global rendering environment (Rendering > Environment) Use Map value. A Boolean value - true if Use Map is on, false if off. See Environment And Effects Dialog.
Contains a MAXTVNode value that defines the top-level Video Post Track View node.
This variable is read-only. See Track View Nodes.
Lets you get and set the index of the active viewport.
See Accessing Active Viewport Info, Type, and Transforms.
Contains the number of viewports in the current viewport layout.
This variable is read-only. See Accessing Active Viewport Info, Type, and Transforms.
The following 3ds Max system global variables are specific to 3ds Max’s default scanline A-Buffer renderer.
These variables return undefined if the current renderer is not 3ds Max’s default scanline A-Buffer renderer.
Lets you get and set the anti-aliasing filter.
For a list of all of the anti-aliasing filters you can say:
The anti-aliasing filters and their parameters are described in 3ds Max Scanline A-Buffer Renderer Anti-Aliasing Filters.
Contains a float value that defines the anti-aliasing filtersize.
Lets you enables and disables global super sampling.
A Boolean value - true if Disable all Samplers is off , false if on.