Interfaces > Core Interfaces > maxOps |
This Core Interface exposes various 3ds Max system properties and methods to MAXScript.
Topic Navigation | |
---|---|
Window/Crossing Selection Type |
maxOps.IsRenderActive : boolean : Read
Returns True if the renderer is active.
Available in 3ds Max 2016 and higher.
Available prior to 3ds Max 2017. Returns the 3ds Max "flavour".
#3dsMax - 3ds Max Entertainment 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
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
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.
The property is read-only with a boolean value: true means a network license, and false means a local license.
Returns true if the given feature is licensed, false otherwise.
Contains the Trackbar Interface.
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.
Get/set Spring Quick Edit mode on and off. Corresponds to the checkbox in the Animation tab of the Preferences dialog.
Get/set the Spring Controller's Rolling Start value. Corresponds to the Rollback value in the Animation tab of the Preferences dialog.
Returns the interface to the trackbar. See Trackbar Interface for details.
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.
Enables Progressive mode. See also maxOps.inProgressiveMode property above.
Disables Progressive mode. See also maxOps.inProgressiveMode property above.
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.
Enable/Disable the AutoGrid option.
Enable/Disable the Start New Shape option checkbox.
maxOps.pivotMode : enum : Read|Write pivotMode enums: {#none | #pivotOnly | #objectOnly | #hierarchyOnly}
This property corresponds to the pivot buttons in the Pivot subpanel of the Hierarchy Panel.
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.
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.
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: bool : 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: bool : 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: bool : 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: bool : 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: bool : 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: bool : Read|Write
When set to true, both the keys and the tangents are drawn along the motion path. When set to false, only the keys are displayed. Available in 3ds Max 2018 and higher.
maxOps.drawGradientTicks: bool : Read|Write
When set to true, both the keys and the tangents are drawn along the motion path. When set to false, only the keys are displayed. Available in 3ds Max 2018 and higher.
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.
Gets/Sets the state of the Hide Frozen Objects checkbox in the Display tab.
Get/set the SetKey mode state.
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.
Returns an array of node sets.
Returns "" if the current setKey node set is "Selected". Setting it to "" sets the current setKey node set to "Selected".
This method returns true if Set Key mode is active, false if not active.
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 <bool>onOff filter enums: {#position | #rotation | #scale | #ikParams | #objParams | #custAttribs | #modifiers | #materials}
Sets the state of the specified SetKey filter.
<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.
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.
When maxops.autoKeyDefaultOn is set to true , a key will be created automatically on the frame defined by this time value.
NEW in 3ds Max 2017: 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.
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.
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.
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 .
Takes a single integer argument:
0 - turns off transparency in the active viewport.
2 - sets it to blended transparency.
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.
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).
Returns the current render element manager.
Gets a specific render element manager.
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.
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.
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.
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.
<bool>maxOps.CloneNodes <&node array>nodes offset:<point3> expandHierarchy:<boolean> cloneType:<enum> actualNodeList:<&node array> newNodes:<&node array>
This method will return true if successful, otherwise it will return false .
This is the list of nodes that you want to clone. nodes is In parameter.
The positional offset that will be applied to the cloned nodes. offset is In parameter.
Indicates if children will be cloned in hierarchies.
Specifies the clone type - Copy, Instance, or Reference.
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.
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.
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).
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.
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.
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
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.
<void>maxOps.findNodes <&node array>templateNodes <&node array>foundNodes nodePropsToMatch:<&enum array> templateNodes is In parameter foundNodes is Out parameter nodePropsToMatch enums: {#nodePropMaterial|#nodePropLayer} nodePropsToMatch default value: #() nodePropsToMatch is In parameter
Finds nodes similar to the ones specified in the template. Optionally, matches material and layer properties.
Available in 3ds Max 2008 and higher.
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.
#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.
Properties:
maxOps.mxsCmdLineArgs
Gets the dictionary of values passed from 3dsmaxbatch.exe in the -mxsString and -mxsValue command-line arguments.
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 Update 4 and higher.