Share

Interface: maxOps

This Core Interface exposes various 3ds Max system properties and methods to MAXScript.

Scene File Personal Info

Methods:

<string>maxOps.GetSceneFileUserName()

Get the current User Name in Preferences / Files tab in Scene File Personal Information group.

Available in 3ds Max 2026.

<void>maxOps.SetSceneFileUserName <string>name persist:<boolean>
       persist default value: false

Set the User Name in Preferences / Files tab in Scene File Personal Information group.

Available in 3ds Max 2026.

<string>maxOps.GetSceneFileComputerName()

Get the current Computer Name in Preferences / Files tab in Scene File Personal Information group.

Available in 3ds Max 2026.

<void>maxOps.SetSceneFileComputerName <string>name persist:<boolean>
       persist default value: false

Set the Computer Name in Preferences / Files tab in Scene File Personal Information group.

Available in 3ds Max 2026.

Methods:

<Interface>maxOps.GetICuiMenuMgr()

Returns the CuiMenuMgr interface, which exposes properties and methods for managing 3ds Max menus.

Available since 3ds Max 2025.

<Interface>maxOps.GetICuiQuadMenuMgr()

Returns the CuiQuadMenuMgr interface, which exposes properties and methods for managing 3ds Max quad menus.

Available in 3ds Max 2025 and higher.

FindNodeFromBaseObject

Methods:

<node>FindNodeFromBaseObject <maxObject>object allowXRefNodes:<boolean> allowNonSceneNodes:<boolean> allowScriptedPlugins:<boolean> allowXrefObjects:<boolean> handleBranching:<boolean> preferSelected:<boolean>
       allowXRefNodes default value: true
       allowNonSceneNodes default value: true
       allowScriptedPlugins default value: false
       allowXrefObjects default value: false
       handleBranching default value: false
       preferSelected default value: false

Returns an INode that has a specified object as base object or modifier. The first INode found matching the requirements will be returned.

  • obj - The object to search using.
  • allowXRefNodes - If true, returns INode even if under scene Xref root node.
  • allowNonSceneNodes - If true, returns INode even if not found under scene root node or (if applicable) under scene Xref root node.
  • allowScriptedPlugins - If true, if obj is the delegate of a scripted plug-in, continues search using the scripted plugin.
  • allowXrefObjects - If true, if obj is wrapped by an XRef Object, continues search using the XRef Object.
  • handleBranching - If true, if obj is a branch of an object (such as Boolean), continues search using the object.
  • preferSelected - If true, if the first INode found is not selected, continue searching and if a selected INode is found return the selected node instead.
<node array>FindNodesFromBaseObject <maxObject>object allowXRefNodes:<boolean> allowNonSceneNodes:<boolean> allowScriptedPlugins:<boolean> allowXrefObjects:<boolean> handleBranching:<boolean>
       allowXRefNodes default value: true
       allowNonSceneNodes default value: true
       allowScriptedPlugins default value: false
       allowXrefObjects default value: false
       handleBranching default value: false

Returns all the INodes found matching requirements.

Available in 3ds Max 2025.

EXAMPLE:

b = box pos:[20,20,0]
bb = box pos:[40,40,0] parent:b
savemaxfile @"$temp\test_node_FindNodeFromBaseObject.max"
resetmaxfile quiet:true
xref_Scene = xrefs.addNewXRefFile @"$temp\test_node_FindNodeFromBaseObject.max"
s = sphere()
b = xref_Scene.tree.children[1]
bb = b.children[1]

maxOps.FindNodeFromBaseObject s.baseobject
--> $Sphere:Sphere001 @ [0.000000,0.000000,0.000000]
maxOps.FindNodeFromBaseObject s.baseobject allowXRefNodes:false allowNonSceneNodes:false
--> $Sphere:Sphere001 @ [0.000000,0.000000,0.000000]
maxOps.FindNodeFromBaseObject b.baseobject
--> $Box:Box001 @ [20.000000,20.000000,0.000000]
maxOps.FindNodeFromBaseObject b.baseobject allowNonSceneNodes:false
--> $Box:Box001 @ [20.000000,20.000000,0.000000]
maxOps.FindNodeFromBaseObject b.baseobject allowXRefNodes:false
--> undefined
maxOps.FindNodeFromBaseObject bb.baseobject
--> $Box:Box002 @ [40.000000,40.000000,0.000000]
maxOps.FindNodeFromBaseObject bb.baseobject allowNonSceneNodes:false
--> $Box:Box002 @ [40.000000,40.000000,0.000000]
maxOps.FindNodeFromBaseObject bb.baseobject allowXRefNodes:false
--> undefined

Version and License Info

Properties:

maxOps.IsRenderActive : boolean : Read 

Returns True if the renderer is active.

Available in 3ds Max 2016 and higher.

maxOps.productAppID: enum : Read         

productAppID enums: {#max}      

Returns the application ID.

The enum value returned is:

#max - 3ds Max

Note: The following values were available in versions prior to 3ds Max 2016:

#none - no ID

#viz - Autodesk VIZ

#gmax - gmax

#vizR -VIZrender

maxOps.productID : enum : Read   

productID enums: {#3dsMax} 

Available prior to 3ds Max 2017. Returns the 3ds Max "flavor".

The enum value returned is:

#3dsMax - 3ds Max Entertainment Version

Note: The #3dsMaxDesign value was available in versions prior to 3ds Max 2016.

#3dsMaxDesign - 3ds Max Design Version

maxOps.productVersion : enum : Read 

productVersion enums: {#productVersionDevel|#productVersionTrial|#productVersionOrdinary|#productVersionEdu|#productVersionNFR} 

Available prior to 3ds Max 2017. Returns the Product Version type.

The enum values returned are as follows:

#productVersionDevel - debug build, or licensed in-house

#productVersionTrial - trial license

#productVersionOrdinary - commercial license

#productVersionNFR - not for resale

#productVersionEdu - educational or student license

Note: All copies of 3ds Max return a hardwarelockid of "-1" while under the grace period and until they have been authorized. You can also check for that number and initiate your own demo mode.
maxOps.licenseBehavior : enum : Read 

licenseBehavior enums: {#licenseBehaviorPermanent|#licenseBehaviorExtendable|#licenseBehaviorNonextendable} 

Available prior to 3ds Max 2017. Returns the License Behavior.

The enum values returned are as follows:

#licenseBehaviorPermanent - permanent license, or hardware lock

#licenseBehaviorExtendable - term license, can be extended

#licenseBehaviorNonextendable - term license, cannot be extended

maxOps.licenseDaysLeft : integer : Read 

Available prior to 3ds Max 2017. Its return value is an integer indicating the number of full days left in the term of the license. A value of 0 means that today is the last day of validity. For permanent licenses, a fixed value is returned indicating greater than 10 years are left.

maxOps.isNetworkLicense 

The property is read-only with a boolean value: true means a network license, and false means a local license.

FOR EXAMPLE:

--This example displays the values of your Cdilla license:
rollout CdillaOPS "License Properties" width:220 height:270
(
groupBox grp1 "License Values" pos:[18,18] width:180 height:265
button btn5 "Days until Expiration" pos:[50,45] width:119 height:18
editText edt5 "" pos:[50,75] width:119 height:18
button btn6 "License Version" pos:[50,105] width:119 height:18
editText edt6 "" pos:[50,135] width:119 height:18
button btn7 "License Behavior" pos:[50,165] width:119 height:18
editText edt7 "" pos:[50,195] width:119 height:18
button btn8 "Hardware Lock ID" pos:[50,225] width:119 height:18
editText edt8 "" pos:[50,255] width:119 height:18
on btn5 pressed do
(
edt5.text = (maxOps.licenseDaysLeft as string)
)
on btn6 pressed do
(
version = maxOps.productVersion as string
edt6.text = substring version 15 version.count
)
on btn7 pressed do
(
version = maxOps.licenseBehavior as string
edt7.text = substring version 16 version.count
)
on btn8 pressed do
edt8.text = (hardwarelockid as string)
)
rof = newRolloutFloater "License Status" 230 380
addRollout CdillaOPS rof

Methods:

maxOps.isFeatureLicensed <integer>featureNumber 

Returns true if the given feature is licensed, false otherwise.

Trackbar, Controllers

Properties:

maxOps.trackbar : Interface : Read 

Contains the Trackbar Interface.

maxOps.overrideControllerRangeDefault : boolean : Read|Write 

When set to true, new procedural controllers that normally require a range will be set to infinite range. When set to false (default behavior prior to 3ds Max 8), the range of such controllers will be set explicitly to the current animation range, causing the controllers to stop updating after the last frame of the range if the scene animation range is increased later. Available in 3ds Max 8 and higher.

maxOps.springQuickEditMode : boolean : Read|Write 

Get/set Spring Quick Edit mode on and off. Corresponds to the checkbox in the Animation tab of the Preferences dialog.

maxOps.springRollingStart : integer : Read|Write 

Get/set the Spring Controller's Rolling Start value. Corresponds to the Rollback value in the Animation tab of the Preferences dialog.

Methods:

maxOps.getTrackBar() 

Returns the interface to the trackbar. See Trackbar Interface for details.

Progressive Mode

Properties:

maxOps.inProgressiveMode : boolean : Read 

Returns true if 3ds Max is in Progressive mode, false otherwise.

When a time sequence of matrices is computed and has to be assigned to the transformation matrix of a node that employs the standard PRS controller and the standard Euler XYZ controller for the rotation, we can achieve a better animation result if the euler angles for the current frame are calculated based on the angles from the previous frame. The Progressive Mode tells the Euler controller to derive angles based on the previous frame. It is assumed that in this mode, the node transformation is set in strictly forward time order.

Also, see beginProgressiveMode() and endProgressiveMode() methods below.

Methods:

<void>maxOps.beginProgressiveMode() 

Enables Progressive mode. See also maxOps.inProgressiveMode property above.

<void>maxOps.endProgressiveMode() 

Disables Progressive mode. See also maxOps.inProgressiveMode property above.

Delete Animation

Methods:

<void>deleteSelectedAnimation() 

Deletes the selected animation.

Ribbon

Methods:

<boolean>maxOps.isRibbonSupportEnabled()

Returns true if the ribbon is supported, false otherwise. The ribbon may be disabled in the 3dsmax.ini file, under the section "Performance", by setting the "DisableRibbon" key to 1. Available in 3ds Max 2018 and higher.

Create Tab

Properties:

maxOps.autoGrid : boolean : Read|Write 

Enable/Disable the AutoGrid option.

maxOps.startNewShapeLock : boolean : Read|Write 

Enable/Disable the Start New Shape option checkbox.

Methods:

<void>startNewShape() 

Start the creation of a new Shape.

Hierarchy Tab

Properties:

maxOps.pivotMode : enum : Read|Write 

pivotMode enums: {#none | #pivotOnly | #objectOnly | #hierarchyOnly} 

This property corresponds to the pivot buttons in the Adjust Pivot subpanel of the Hierarchy tab.

maxOps.affectChildren : boolean : Read|Write

This property corresponds to the Don't Affect Children button in the Adjust Transform subpanel of the Hierarchy tab.

Motion Paths

Properties:

maxOps.trajectoryMode : boolean : Read|Write                      

When set to true , the Hierarchy tab of the Command Panel will be switched to Motion Paths mode.

When set to false , the Hierarchy tab of the Command Panel will be switched to Parameters mode.

If the Command Panel is not in the Hierarchy tab, it will be switched to it automatically.

Available in 3ds Max 2008 and higher.

maxOps.trajectoryKeySubMode : boolean : Read|Write                   

When set to true , the Motion Paths mode will be switched to Key Sub-Object mode.

If the Command Panel is not in the Hierarchy tab, it will be switched to it automatically.

If the Hierarchy has not been set to Trajectories mode by setting maxops.trajectoryMode=true or by manually switching with the mouse , it will be set to Trajectories mode automatically.

Available in 3ds Max 2008 and higher.

maxOps.trajectoryAddKeyMode : boolean : Read|Write                 

When set to true, the Add Key mode in the Trajectories rollout of the Hierarchy tab of the Command Panel will be turned on. When false, it will be turned off.

If the Command Panel is not in the Hierarchy tab, it will be switched to it automatically.

If the Hierarchy has not been set to Trajectories mode by setting maxops.trajectoryMode=true or by manually switching with the mouse , it will be set to Trajectories mode automatically.

If the Trajectories mode is not in Key Sub-Object mode by setting maxops.trajectoryKeySubMode=true or by manually switching with the mouse, the Sub-Object mode will be set automatically.

Available in 3ds Max 2008 and higher.

maxOps.trajectoryPathGradation: enum : Read|Write

trajectoryPathGradation enums: {#speed|#wirecolor|#uicolor|#none}

Sets the gradation mode of the displayed motion paths. Available in 3ds Max 2018 and higher.

maxOps.selTrajectoryDrawFrameTicks: boolean : Read|Write

When set to true, the frame ticks will be displayed along the selected motion paths. Available in 3ds Max 2018 and higher.

maxOps.unselTrajectoryDrawFrameTicks: boolean : Read|Write

When set to true, the frame ticks will be displayed along the unselected motion paths. Available in 3ds Max 2018 and higher.

maxOps.unselTrajectoryDrawKeys: boolean : Read|Write

When set to true, the keys will be displayed along the unselected motion paths. Available in 3ds Max 2018 and higher.

maxOps.trimTrajectories: boolean : Read|Write

When set to true, trims the displayed motion paths. The motion paths are trimmed based on the value of fixedTrimRange. Available in 3ds Max 2018 and higher.

maxOps.fixedTrimRange: boolean : Read|Write

When set to true, the motion paths are trimmed based on the frame range, and use the values stored in trimTrajectoriesStart, and trimTrajectoriesEnd. When set to false, the motion paths are trimmed based on the value stored in trimTrajectoriesOffset. Motion path trimming is enabled or disabled based on the value of trimTrajectories. Available in 3ds Max 2018 and higher.

maxOps.trimTrajectoriesOffset: integer : Read|Write

Defines the frame offset applied when trimTrajectories is on, and when fixedTrimRange is set to false. Available in 3ds Max 2018 and higher.

maxOps.trimTrajectoriesStart: integer : Read|Write

Defines the start of the frame range applied when trimTrajectories is on, and when fixedTrimRange is set to false. Available in 3ds Max 2018 and higher.

maxOps.trimTrajectoriesEnd: integer : Read|Write

Defines the end of the frame range applied when trimTrajectories is on, and when fixedTrimRange is set to false. Available in 3ds Max 2018 and higher.

maxOps.drawAllHandles: boolean : Read|Write

When set to true, handles are drawn for knot control points along the motion path. Available in 3ds Max 2018 and higher.

maxOps.drawGradientTicks: boolean : Read|Write

When set to true, gradient ticks are drawn along the motion path. Available in 3ds Max 2018 and higher.

maxOps.drawKeyTimes: boolean : Read|Write

When set to true, key times are drawn at key points along the motion path. Available in 3ds Max 2019 and higher.

maxOps.selTrajectoryDrawKeys: boolean : Read|Write

When set to true, control points for keys are drawn along the motion path. Available in 3ds Max 2019 and higher.

maxOps.TrimTrajectories : boolean : Read|Write

When set to true, the trajectory path is trimmed according to the settings below.

maxOps.FixedTrimRange : boolean : Read|Write

When set to true, the trajectory path is trimmed according to .TrimTrajectoriesStart and .TrimTrajectoriesEnd. When false, the offset value specified by .TrimTrajectoriesOffset is used to trim the trajectory.

maxOps.TrimTrajectoriesOffset : integer : Read|Write

When .FixedTrimRange is false and .TrimTrajectories is true, this specifies the offset to trim the trajectory with.

maxOps.TrimTrajectoriesStart : integer : Read|Write
maxOps.TrimTrajectoriesEnd : integer : Read|Write

When .FixedTrimRange is true and .TrimTrajectories is true, this specifies the start and end offsets to trim the trajectory with.

Methods:

<void>maxOps.deleteSelectedTrajectoryKey() 

Deletes the selected trajectory key. Available in 3ds Max 2008 and higher.

<void>maxOps.breakSelectedKeyTangent() 

Breaks the selected trajectory key's tangent handles. This allows the individual control of the two tangent handles. Available in 3ds Max 2018 and higher.

<void>maxOps.unifySelectedKeyTangent() 

Unifies the selected trajectory key's tangent handles. This allows the movement of one handle to affect the relative position of the other handle. Available in 3ds Max 2018 and higher.

<void>maxOps.setSelectedKeyTangentToAuto() 

Unifies the selected trajectory key's tangent handles, and ensures both tangent handle reside on the same line. Available in 3ds Max 2018 and higher.

Display Tab

Properties:

maxOps.hideFrozenObjects : boolean : Read|Write 

Gets/Sets the state of the Hide Frozen Objects checkbox in the Display tab.

Note: You have to call completeRedraw() after setting this property.

Set Key Mode

Properties:

maxOps.setKeyMode : boolean : Read|Write 

Get/set the SetKey mode state.

maxOps.setKeySuspend : boolean : Read|Write 

Get/set the SetKey Suspend mode state.

maxOps.setKeyFilters : enum by value array : Read 

setKeyFilters enums: {#all | #position | #rotation | #scale | #ikParams | #objParams | #custAttribs | #modifiers | #materials|#other} 

Always returns the fixed list of the filter names.

maxOps.setKeyNodeSets : String array : Read 

Returns an array of node sets.

Note:

The array does not include "Selected".

maxOps.setKeyNodeSetCurrent : String : Read|Write 

Returns "" if the current setKey node set is "Selected". Setting it to "" sets the current setKey node set to "Selected".

Note:

A "SetKey NodeSet" is what is shown in the dropdown list above the Key Filters button in the status panel. The first entry in this dropdown is "Selected", which corresponds to a set name of "". The remaining items are all character nodes in the scene and all named selection sets in the scene.

Methods:

<boolean>maxOps.getSetKeyMode() 

This method returns true if Set Key mode is active, false if not active.

<void>maxOps.activateSetKeyMode <boolean>onOff

Sets the Set Key mode to the specified value where, true = on and false = off.

maxOps.getSetKeyFilterState <enum>filter 

filter enums: {#position | #rotation | #scale | #ikParams | #objParams | #custAttribs | #modifiers | #materials} 

Returns the state of the specified SetKey filter.

maxOps.setSetKeyFilterState <enum>filter <boolean>onOff 

filter enums: {#position | #rotation | #scale | #ikParams | #objParams | #custAttribs | #modifiers | #materials} 

Sets the state of the specified SetKey filter.

FOR EXAMPLE:

-- print SetKey Filters state
for filter in maxops.setKeyFilters do
format "% : %\n" (filter as string) (maxops.getSetKeyFilterState filter)
-- turn all on
for filter in maxops.setKeyFilters do
maxops.setSetKeyFilterState filter true
<void>maxOps.getDefaultTangentType<&enum>dfltInTangentType <&enum>dfltOutTangentType 

dfltInTangentType enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat} 
dfltInTangentType is Out parameter 
dfltOutTangentType enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat} 
dfltOutTangentType is Out parameter 

Returns the default In and Out tangent types into the two Out parameters passed by-reference.

Available in 3ds Max 8 and higher.

<void>maxOps.setDefaultTangentType <enum>dfltInTangentType <enum>dfltOutTangentType writeInCfgFile:<boolean> 

dfltInTangentType enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat} 
dfltOutTangentType enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat} 
writeInCfgFile default value: true 

Sets the default In and Out tangent types. When writeInCfgFile: is set to true (default), the changes will also be recorded in the configuration file, making them sticky between 3ds Max sessions.

Available in 3ds Max 8 and higher.

EXAMPLE:

maxops.setDefaultTangentType #slow #fast
--> OK
maxops.getDefaultTangentType &inTangent &outTangent
--> OK
inTangent
--> #slow
outTangent
--> #fast
Note: The flyout in the 3ds Max GUI provides icons only for the cases where the In and Out tangents are equal. The above method can be used to set the default tangents to any combination of In and Out types that cannot be represented by the flyout icons. In these cases, a special icon with a question mark "?" will be displayed in the GUI.

AutoKey Default Key

Properties:

maxOps.autoKeyDefaultKeyOn: boolean : Read|Write 

When this option is set to true (default), creating a key in AutoKey mode on a frame other than the one specified by maxops.autoKeyDefaultKeyTime will create a key on the frame specified by maxops.autoKeyDefaultKeyTime with the initial value of the animated property. This is the default behavior of 3ds Max since its first release.

When this option is set to false , no key other than the one on the current frame will be created by the AutoKey feature.

See also preferences.autoKeyDefaultKeyOn for a System Global that exposes the same property.

Available in 3ds Max 2008 and higher.

maxOps.autoKeyDefaultKeyTime : time : Read|Write 

When maxops.autoKeyDefaultOn is set to true , a key will be created automatically on the frame defined by this time value.

Available in 3ds Max 2017 and higher: The value can be set to any valid time value. In versions prior to 3ds Max 2017, the only possible values were 0f and 1f. See also preferences.autoKeyDefaultKeyTime for a System Global that exposes the same property as an integer value.

Available in 3ds Max 2008 and higher.

Paint Selection Brush

Properties:

maxOps.paintSelBrushSize : integer : Read|Write 
maxOps.paintSelBrushSizeUnscaled : integer : Read|Write

Get/Set the size of the Paint Selection brush. The Paint Selection is a selection mode accessible through the Selection Region flyout. The value corresponds to the "Paint Selection Brush Size" value under Customize > Preferences > General > Scene Selection. Note that right-clicking the Paint Selection icon in the main toolbar will open the Preferences dialog.

The paintSelBrushSizeUnscaled property is this setting without any DPI scaling (if any) applied.

Bitmap Importer

Methods:

<boolean>maxOps.canImportBitmap <filename>fileName 

Returns true if a bitmap importer is present for the extension in the file name, false otherwise. Does not check to see if the file exists or if it is a valid bitmap file.

Viewport Display

Methods:

bool>maxOps.displayActiveCameraViewWithMultiPassEffect() 

If the active view is a Camera view and a multi-pass effect is turned on in the camera's properties, then this function returns true . Otherwise, it does nothing and returns false .

maxOps.setActiveViewportTransparencyDisplay <integer>transparencyLevel 

Takes a single integer argument:

0 - turns off transparency in the active viewport.

1 - sets it to screen door.

2 - sets it to blended transparency.

<IObject>maxops.getViewportShadingSettings() 

Returns an <IObject:ViewportShadingSettings> object exposing several interfaces related to advanced viewport shading controls.

See Viewport Shading Settings for details.

Available in 3ds Max 2010 and higher.

EXAMPLE:

vss = maxops.getViewportShadingSettings()
<IObject:ViewportShadingSettings>
showInterfaces vss

Custom User Interface

Methods:

<boolean>maxOps.loadCUIFile <filename>fileName 

Returns true if successful and false otherwise.

Iterative Rendering

Properties:

<boolean>maxOps.rendUseIterative 

Get/set the Iterative Rendering mode in 3ds Max 2009 and higher.

When set to true , only the current frame will be rendered and no file will be saved to disk.

When set to false , the Render Dialog settings for Time Output and File Saving will be respected (this is the default and the only behavior in releases prior to 3ds Max 2009).

Note:

Iterative rendering cannot be activated using the render() method.

You can use max quick render after setting maxOps.rendUseIterative to true to perform an iterative rendering.

Render Element Manager

Methods:

maxOps.GetCurRenderElementMgr() 

Returns the current render element manager.

maxOps.GetRenderElementMgr <enum> 

{#Production|#Draft}

Gets a specific render element manager.

Note:

The #Draft renderer was retired in 3ds Max 6.

Calling this method with #Draft argument will return undefined in 3ds Max 6 and higher.

Node Name Suffix Length

Properties:

<integer>maxOps.nameSuffixLength 

Controls the number of digits appended as suffix to the name of newly created scene nodes, layers, and others.

Available in 3ds Max 2011 and higher.

Note:

In 3ds Max 2011, the default value was changed from 2 to 3 and is now controlled by the "NameSuffixLength" key in the [Preferences] category of the 3dsmax.ini file.

This is to ensure better sorting of up to 999 objects using the MAXScript sort() method. If you intend to work with more than 1000 objects, you can increase the maxOps.nameSuffixLength value to 4 or more to ensure enough leading zeros.

In addition, note that newly created nodes will receive a number one higher than the highest number in the scene without filling gaps. For example. if you create objects Box001, Box002, and Box003, and delete Box002, the next automatically named object will have the name Box004 and not Box002.

Collapse and Clone Nodes

Methods:

<boolean>maxOps.CollapseNode <node>node <boolean>noWarning 

Collapses the complete modifier stack of the node.

When noWarning is set to true, no prompt will be issued. Returns true if successful and false otherwise.

<boolean>maxOps.CollapseNodeTo <node>node <index>modIndex <boolean>noWarning 

Collapses the modifier stack up to the indexed modifier.

The modifiers are counted from top of the stack. All modifiers below and including the specified one will be collapsed.

When noWarning is set to true, no prompt will be issued.

Returns true if successful and false otherwise.

<boolean>maxOps.CloneNodes <node array>nodes offset:<point3> expandHierarchy:<boolean> cloneType:<enum> actualNodeList:<&node array> newNodes:<&node array>
       offset default value: [0,0,0]
       expandHierarchy default value: false
       cloneType enums: {#copy|#instance|#reference}
       cloneType default value: #copy
       actualNodeList default value: #()
       actualNodeList is Out parameter
       newNodes default value: #()
       newNodes is Out parameter

This method will return true if successful, otherwise it will return false .

  • nodes - This is the list of nodes that you want to clone.
  • offset - The positional offset that will be applied to the cloned nodes.
  • expandHierarchy - Indicates if children will be cloned in hierarchies.
  • cloneType - Specifies the clone type - Copy, Instance, or Reference.
  • actualNodeList - This node array will be filled in with the original nodes to be cloned. The reason for this is that there can be dependencies between nodes that causes other nodes to be added to the list. For example light/camera targets, nodes part of systems, part of groups or expanded hierarchies, and others.
  • newNodes - This node array will be filled in with the new cloned nodes. There is a one to one relationship between the nodes returned in the actualNodeList array and the newNodes array.
Note:

actualNodeList and newNodes take an argument of <&node array>, and are Out parameters. This is important because:

1) the variables must be passed by reference, and 2) we do not need to initialize the variables to arrays because they are only Out parameters (MAXScript does not convert the value passed in to an array).

FOR EXAMPLE:

s=sphere()

-- variables not passed by reference, does not work right
maxops.clonenodes s actualNodeList:a newNodes:b
a --> undefined
b --> undefined

-- variables passed by reference without initializing, works right
maxops.clonenodes s actualNodeList:&c newNodes:&d
c --> #($sphere01)
d --> #($sphere03)

Also note that the first argument type is specified as <&node array>nodes , In parameter. Because it is an In parameter, we know that the method does not change the contents of the array passed, so there is no point in passing this array by reference.

In addition, MAXScript automatically wraps the single argument passed into a temporary array, so we can use s instead of #(s) to supply the node array.

Warning:

You may not use maxOps.cloneNodes inside an undo off context. Doing so will crash 3ds Max when using the Undo function!

Window/Crossing Selection Type

Methods:

maxOps.setSelectionType <boolean>auto <enum>method 

method enums: {#window|#crossing|#leftToRight|#rightToLeft} 

Controls the window/crossing modes of the selection tool.

When the first argument is set to true, it enables the Customize>Preferences>General tab>Auto Window/Crossing By Direction option. The second argument can be either 0 or 1 or the equivalent enums #leftToRight and #rightToLeft.

When the first argument is set to false, it sets the state of the Window/Crossing icon in the Main Toolbar, while disabling the Customize > Preferences > General tab > Auto Window/Crossing By Direction. The second argument can be either 0 or 1 or the equivalent enums #window and #crossing.

In other words,

true 1 : Enables auto Window/Crossing: moving left-to-right is crossing selection

true 0 : Enables auto Window/Crossing: moving right-to-left is crossing selection

false 1 : Disables auto Window/Crossing, turns ON crossing selection

false 0 : Disables auto Window/Crossing, turns OFF crossing selection

The method returns true if successful, false otherwise.

Node Handle

Methods:

maxOps.getNodeByHandle <integer>handle 

Returns a node associated with a given handle.

Color By ID

Methods:

<void>maxOps.colorById <integer>id <&color>color 

color is Out parameter   

Returns a specific color for each unique ID passed. The result is written to the Out parameter by reference.

This method is used internally to generate colors representing Material and Object IDs in the respective RenderElements.

Available in 3ds Max 8 and higher.

FOR EXAMPLE:

for i = 0 to 9 do
(
 maxops.colorById i &theColor
 format "ID:% Color:%\n" i theColor
)

RESULT:

ID:0 Color:(color 100 100 100)
ID:1 Color:(color 213 16 100)
ID:2 Color:(color 70 188 100)
ID:3 Color:(color 183 104 100)
ID:4 Color:(color 40 20 100)
ID:5 Color:(color 153 192 100)
ID:6 Color:(color 10 108 100)
ID:7 Color:(color 123 24 100)
ID:8 Color:(color 236 196 100)
ID:9 Color:(color 93 112 100)

Find Nodes

Methods:

<void>maxOps.findNodes <node array>templateNodes <&node array>foundNodes nodePropsToMatch:<enum array>
       foundNodes is Out parameter
       nodePropsToMatch enums: {#nodePropMaterial|#nodePropLayer}
       nodePropsToMatch default value: #()

Finds nodes similar to the ones specified in the template. Optionally, matches material and layer properties.

Available in 3ds Max 2008 and higher.

FOR EXAMPLE:

(
resetMaxFile #noPrompt --reset max file
--create 10 boxes and 10 spheres:
for i = 1 to 10 do box pos:[i*50,0,0]
for i = 1 to 10 do sphere pos:[i*50,100,0]
$Box*.material = standard() --assign standard material to all boxes
$Box001.material = multiMaterial() --change material of first box
--find all objects similar to the Box01 and Sphere01
--that have the same material as the template object
maxOps.findNodes #($Box001,$Sphere001) &foundNodes nodePropsToMatch:#(#nodePropMaterial)
print foundNodes --print the resulting array
)

RESULT:

$Box:Box001 @ [50.000000,0.000000,0.000000]
$Sphere:Sphere001 @ [50.000000,100.000000,0.000000]
$Sphere:Sphere002 @ [100.000000,100.000000,0.000000]
$Sphere:Sphere003 @ [150.000000,100.000000,0.000000]
$Sphere:Sphere004 @ [200.000000,100.000000,0.000000]
$Sphere:Sphere005 @ [250.000000,100.000000,0.000000]
$Sphere:Sphere006 @ [300.000000,100.000000,0.000000]
$Sphere:Sphere007 @ [350.000000,100.000000,0.000000]
$Sphere:Sphere008 @ [400.000000,100.000000,0.000000]
$Sphere:Sphere009 @ [450.000000,100.000000,0.000000]
$Sphere:Sphere010 @ [500.000000,100.000000,0.000000]
OK

As you can see, only the first box was collected because all other boxes have a different material.

All spheres have the same material (no material at all), so they were all collected as similar to the $Sphere01.

Material Editor Mode

Properties:

maxOps.mtlDlgMode 

Get/set the Material Editor Mode in 3ds Max 2011 and higher.

If a Material Editor is already open, setting this property immediately switches the Editor to the given mode.

Possible values are:

#basic(0) - Compact Material Editor mode

#advanced(1) - Slate Material Editor mode

See also the MatEditor - Open and Close the Material Editor topic for more related methods.

The maxOps.mtlDlgMode property described above is also available through the MatEditor struct for convenience.

Scene Compression and Archiving Settings

<boolean>maxops.getCompressSceneFileOnSave()
<void>maxops.setCompressSceneFileOnSave <boolean>compress writeInCfgFile:<boolean>
writeInCfgFile default value: false

These methods get or set the file compression setting. Available in 3ds Max 2019 update 1 and higher.

Methods and higher. If writeInCfgFile is true, this setting is persisted across sessions. These correspond to the Customize > Preferences > Files > Compress on Save setting.

maxOps.archiveProgramName : string : Read|Write
maxOps.archiveOptions : string : Read|Write

These properties expose the Archive System settings found on the Files tab of the Preferences Settings dialog, and are used by the File > Archive command to create an archive of the current scene file. Available in 3ds Max 2020.1 Update and higher.

The .archiveProgramName property gets or sets the name (including the full path) of the program used to create the scene archive. By default this is [max_install]\maxzip.exe. Note that this property can only be set to an .exe or .bat file that exists. Attempting to set this property to a non-existent file or path, or an item that is not an executable or bat file, will fail with an error.

The .archiveOptions property gets or sets any additional command-line arguments passed to the archive program held in .archiveProgramName.

File Preferences

Properties

maxOps.overrideLanguageSpecifiedInSceneFile : boolean : Read|Write

Specifies whether to use the current default language specified for 3ds Max to convert strings in the scene file, if the file was created in an instance of 3ds Max using a different language. If false, the useCodePageSpecifiedInSceneFile (below) is used to determine the language conversion. This setting appears on the Files tab of the Preferences dialog under File String Data Handling.

maxOps.useCodePageSpecifiedInSceneFile : boolean : Read|Write

Specifies how to identify the scene file language. When true, the code page data embedded in the scene file is used to determine the language. If false, the Language ID embedded in the scene file is used. The Language ID generally produces better results. This setting appears on the Files tab of the Preferences dialog under File String Data Handling.

maxOps.languageToUseForFileIO : enum : Read|Write
       languageToUseForFileIO enums: {#current|#English|#German|#French|#Japanese|#Korean|#Chinese}

Gets/sets the default language setting for 3ds Max Scene files. This setting appears on the Files tab of the Preferences dialog under File String Data Handling.

maxOps.legacyFilesCanBeStoredUsingUTF8 : boolean : Read|Write

Specifies whether to encode strings in non-scene files such as material libraries as UTF-8. This setting appears on the Files tab of the Preferences dialog under File String Data Handling.

Methods

<void>maxOps.persistFileLanguageSettings()

Saves the settings for File String Data Handling on the Files tab of the Preferences dialog to the 3ds Max settings file (3dsMax.ini) so that they persist between sessions of 3ds Max.

Viewport Preferences

maxOps.showWorldAxis : boolean : Read|Write

Specifies whether to display a world axis in the lower-left corner of all viewports. The default is true. This setting appears on the Viewports tab of the Preferences dialog as Display World Axis.

3ds Max Batch Information

Properties:

maxOps.mxsCmdLineArgs 

Gets the dictionary of values passed from 3dsmaxbatch.exe in the -mxsString and -mxsValue command-line arguments.

Note: This dictionary is only valid when values are passed from 3dsmaxbatch.exe. If no values are passed, or if 3ds Max is run from 3dsmax.exe, this dictionary is undefined.

Example:

Command-line:

D:<3dsmaxpath>3dsmaxbatch demo_mxscmdline.ms -mxsString string1:"Hello"  -mxsValue value1:"[3,12,22]" -mxsValue value2:"Point3 3 8 2.3"

MAXScript:

opts = maxOps.mxsCmdLineArgs

for k in opts.keys do (
format "% == % class: %\n" k opts[k] (classOf opts[k])
)
-- output:
-- #string1 == Hello class: String
-- #value2 == [3,8,2.3] class: Point3
-- #value1 == [3,12,22] class: Point3

For more information on the 3ds Max Batch command-line arguments, see the 3ds Max Batch help topic.

Available in 3ds Max 2018.4 Update and higher.

Methods:

<boolean>maxops.isInNonInteractiveMode <boolean>checkTestMode

Returns true if 3ds Max is in non-interactive mode, such as when it is running via 3ds Max Batch (3dsmaxbatch.exe). Returns false if running with a user interface (3dsmax.exe).

The checkTestMode keyword argument specifies whether to check whether 3ds Max is running in "Non Interactive Test Mode" (see maxops.setInNonInteractiveTestMode() below). If so, this method returns true, even if running with a UI. This is intended for testing purposes. The default is false.

Note: In Non Interactive Mode, Max runs with the following limitations:
  • No splash screen, no welcome screen
  • Max starts up in minimized mode, and remains in minimized mode
  • Autobackup is disabled
  • Max window state and size is not loaded at startup, nor saved at shutdown
  • QuietMode is always on
  • NoNetworkRendering is always true
  • Loaded files are not added to recent document list
  • StartupTemplates are disabled
<void>maxops.setInNonInteractiveTestMode()

Sets 3ds Max to "Non Interactive Test Mode", where maxops.isInNonInteractiveMode() will return true, even if a UI is present, unless the checkTestMode keyword argument is false. Intended for testing purposes.

<boolean>maxops.isInSecureMode()

Returns true if 3ds Max is running in secure mode. Secure mode is set by the 3dsmax.exe command line option secure \[on|off\]. In secure mode:

  • digital signatures are verified for plugins/assemblies
  • certain functionality (such as mxsdotnet, ActiveX, OLE) is disabled or limited
  • blacklisted commands are prevented from being used (dos commands, registry access)
  • some .NET types and assemblies are whitelisted
  • python is disabled
  • Autodesk Store plugins are prevented from loading
  • user defined MCG assemblies are prevented from loading

Global Time

<void>GlobalScaleTime <interval>oldSegment <interval>newSegment modifyTimeline:<boolean> scaleToWholeFrames:<boolean>
   modifyTimeline default value: true
   scaleToWholeFrames default value: false

Re-scales a segment of animation keys, similar to the Re-scale Time dialog in the 3ds Max UI, and optionally re-scales the 3ds Max timeline. The parameters are:

  • oldSegment: The segment of the animation keys to modify.
  • newSegment: The new segment to apply to the oldSegment.
  • modifyTimeline: Specifies whether to re-scale the timeline in the 3ds Max UI. If false, only the keys in the timeline are re-scaled, the timeline itself is not changed.
  • scaleToWholeFrames: Specifies whether to scale the new segment to the nearest whole frame.

Example

s = sphere()
with animate on at time 25 s.radius += 1
with animate on at time 50 s.radius += 1
with animate on at time 75 s.radius += 1
with animate on at time 100 s.radius += 1
s.radius.keys
--> #keys(0f, 25f, 50f, 75f, 100f)
maxOps.GlobalScaleTime (interval 25 75) (interval 25 125) modifyTimeline:false
s.radius.keys
--> #keys(0f, 25f, 75f, 125f, 150f)

Other Miscellaneous

Properties

maxOps.IsWelcomeScreenEnabledAtStartup : boolean : Read

Returns whether the Welcome Screen is enabled for display at startup. This setting is controlled by a checkbox on the Welcome Screen.

maxOps.IsDesktopAnalyticsProgramOn : boolean : Read

Returns whether analytics is running.

maxOps.isSavingToFile : boolean : Read

Returns whether 3ds Max is currently saving a file.

Methods

<matrix3>maxOps.getTransformGizmoTM()

Returns the world transform of the current transform gizmo in the active viewport.

<string>maxOps.IncrementFileName <string>fileName versionSeparatorString:<string>
       versionSeparatorString default value: ""
<string>maxOps.IncrementSceneFileName <string>fileName
<string>maxOps.IncrementImageFileName <string>fileName

These functions return an incremented version of the specified fileName string.

  • The IncrementFileName() function takes an optional versionSeparatorString as a separator between the file string and the version number. If no separator is specified, the last punctuation character in the string (other than a period representing the file extension) is considered to be the separator.
  • IncrementSceneFileName() is identical to the IncrementFileName(), but does not have an optional separator argument.
  • The IncrementImageFileName() function is identical to incrementFileName(), but always has a separator of _ (underscore).

If there is no version number at the end of the filename (or if it does not match the versionseparatorString pattern), a version is added starting at 01, and incremented when passed to the function on subsequent calls.

For example:

fname = maxOps.incrementFileName "myfile"
--> "myfile01"
maxOps.incrementFileName fname
--> "myfile02"
fname = maxOps.incrementFileName "myfile-100" versionSeparatorString:"-"
--> "myfile-101"
-- But if the filename does not match the separator string:
fname = maxOps.incrementFileName "myfile100" versionSeparatorString:"-"
--> "myfile100-01"
-- IncrementImageFileName always uses underscore
fname = maxops.IncrementImageFileName "a1.jpg"
--> "a1_01.jpg"

Was this information helpful?