RSS FEED

Undocumented MAXScript Features

Every now and then, I stumbled upon an undocumented command or optional keyword. Some of them were later added to the documentation, many of them are still undocumented. Some of those are listed in this article (I'm skipping a lot of stuff I don't find useful like the non-creatable MEditBkgnd texture map, creatable PFlow related classes etc).

Box3 Values
Just like the documented Box2 class, only in 3D. Pretty handy, using Box3 returned by the getNodeBBox method is much more flexible than the min+max array that's usually used instead. Edit: now documented, see Box3 Values.

Constructor
Box3() -- returns new 'empty' Box3 value
Box3 <min_point3> <max_point3>
Properties
<Box3>.min: Point3
<Box3>.max: Point3
<Box3>.center: Point3
Methods
contains <Box3> <point3>
intersects <Box3> <Box3>

translate <Box3> <point3>
scale <Box3> <point3>
enlargeBy <Box3> <float>

rectify <Box3>
makeCube <Box3> <point3> <float>

empty <Box3>
isEmpty <Box3>

getNodeBBox <node>
-- bool test for contained position
-- bool test for overlapping boxes

-- move box coords by offset
-- scale from the center of the box
-- expand box coords by offset

-- doesn't work
-- cube by center and size

-- set the box to a special 'empty' state
-- bool test for the special 'empty' state

-- node bounding box as a Box3 value
Missing Render Dialog Variables
The following variables are missing from the Render Scene Dialog Global System Variables listing.
rendLockImageAspectRatio: Boolean
rendImageAspectRatio: Float
rendPixelAspectRatio: Float
rendUseImgSeq: Boolean
rendImgSeqType: Integer
Multiplier Curve and Ease Curve Access
Edit: now documented, see Controller Ease and Multiplier Curves.
getMultiplierCurve <controller> <index>
getEaseCurve <controller> <index>
High-precision Matrix Inverse
Used for example by the CreateCameraFromView function.
inverseHighPrecision <matrix3>
Xref Scene Overlay
As mentioned by Eric Craft in the Undocumented MAXScript Features thread.
<XRefScene>.overlay Boolean default:false
Primitive -> BodyObject Conversion
Sphere, Torus, Cylinder etc. convert nicely, Teapot doesn't.
convertToBody <node>
convertToJoinBodies <node>
convertToBodyCutter <node>
Editable Poly Current CommandMode
See the corresponding method in the Edit Poly chapter.
<enum><EditablePoly>.getCommandMode()
GUID Generator
Next time you need a UUID, you know what to use:
genGUID() --> "{F2FBBC06-1A6B-49C8-9FD6-31C597BA3265}"
Lyric Directory System Global
Don't ask me, the folder it points to doesn't even exist on my machine.
lyricDirectory: String
ToolTip Customization
See 2 small cookies in 3ds Max 2017 for more details.
viewport.appendTooltip <tooltip_def>
tipSystem.showTip <integer>elapsedTime <string>tipContent <float>xRatio <float>yRatio <HWND>hParent
MaxOps Methods and Properties
<bool>maxOps.affectChildren
<void>maxOps.activateSetKeyMode <void>onOff
<matrix3>maxOps.getTransformGizmoTM()

<TSTR by value>maxOps.incrementFileName <TSTR by value>fileName versionSeparatorString:<TSTR by value="">
<TSTR by value>maxOps.incrementSceneFileName <TSTR by value>fileName
<TSTR by value>maxOps.incrementImageFileName <TSTR by value>fileName

<bool>maxOps.useCodePageSpecifiedInSceneFile
<bool>maxOps.legacyFilesCanBeStoredUsingUTF8
<enum>maxOps.languageToUseForFileIO -- enums: {#current|#English|#German|#French|#Japanese|#Korean|#Chinese}
<void>maxOps.persistFileLanguageSettings()
SceneExplorerManager Methods
Mentioned in passing inside the What's New section, missing from the Interface: SceneExplorerManager chapter.
SceneExplorerManager.GetActiveExplorer()
SceneExplorerManager.SetActiveExplorer <&TSTR>explorerName
SceneExplorerManager.CreateLayerManager <&TSTR>explorerName
SceneExplorerManager.IsDefaultLayer <RefTarget>layer
Profiler Methods
Missing from the reference, see the Improving Animation Performance using Maya's Profiler knowledge network article.
getEnableProfiling()
setEnableProfiling()
Assert Display Getter
Another of the getter/setter pairs that are not mentioned at all or just one of the pair. See 3ds Max Assert Display Functions for its counterpart and more information.
getMaxAssertDisplay()
TMCache Switch
If you ever noticed your scripted rigs breaking in 2017 while they work perfectly well in 2016, be sure to check this. For more information about TMCache, see Fixing IK solver animation editing in 3ds Max 2017.
preferences.enableTMCache = off
DontRepeatMessages Context
Legacy setting, see preferences.dontRepeatRefMsg.
with dontRepeatMessages off ...
Convert to Integer
Unlike the as integer cast, thiw one will error out when a string is passed to it.
int <number>
IndirectRefTargContainer
See RefTargContainer, same constructor and methods apply. For example usage, check the source of my Advanced Sweep scripted modifier where the RefTargContainer is used to store CurveCtl as a maxObject parameter.
IndirectRefTargContainer..
NodeMonitor
Similar to the NodeTransformMonitor but doesn't pass transform messages. Searching cgtalk and looking for denisT's posts and sample code will tell you more, for example Using controllers with scripted plugins - "this node".
nodeMonitor <node>
SnapshotAsMesh Optional RenderMesh Keyword
See the cgtalk thread. Still missing from the official documentation.
snapshotAsMesh <node> [ renderMesh:<boolean> ] 
RenderPresets Optional loadNodes Argument
As mentioned in 3ds max 7 release notes, loading presets that contain node associations displays a dialog requiring user interaction. To bypass the dialog, you can use the following syntax:
<boolean>renderPresets.Load <integer>which <filename>file <bitArray>categories [ loadNodes:<enum: {#Yes|#No|#Cancel|#Prompt}> ]
Specifying loadNodes with #Yes, #No or #Cancel will not display the Prompt window and will perform the same actions as pressing the respective buttons in the prompt. Specifying #Prompt will display the dialog and require user input. If you do not specify loadNodes and the file contains nodes associated, the prompt window will be displayed.

Optional Keyword Arguments for Cloned Objects
Just like with the createInstance function, you can pass any of the constructor arguments when creating a cloned object (say copy obj transform:TM).
copy <MAXWrapper_object> [ keyarg1:v ] [ keyarg2:v ] ..
instance <MAXWrapper_object> [ keyarg1:v ] [ keyarg2:v ] ..
reference <MAXWrapper_object> [ keyarg1:v ] [ keyarg2:v ] ..
CreateInstance Optional ForceCreate Argument
Allows creation of classes that otherwise return Runtime error: Not creatable.
createInstance <MAXClass> forceCreate:<boolean=false> [ keyarg1:v ] [ keyarg2:v ] ...
Scripted SimpleSpline Plug-ins
Similar to Scripted SimpleObject Plug-ins, instead of a predefined mesh variable, a bezierShape one is used. See for example my Arrow spline primitive script for example usage.
plugin simpleSpline ...
on buildShape do <expr>
Similar Nodes
Same criteria as used by Edit > Select Similar.
getSimilarNodes <node>
Current Selection Set Name
As displayed in the main menu bar, i.e. returns "Create Selection" if empty.
getCurNameSelSet()
SkinOps Methods Missing Arguments
See Anybody know a workaround for the DQ skinning bug?.
skinOps.getVertexDQWeight <Skin> <vertexID>
skinOps.setVertexDQWeight <Skin> <vertexID> <weight>
Is Undo Disabled
Companion function for the enableUndo function.
isUndoDisabled()
Animatable Pointer
Same as refs.getAddr.
getAnimPointer <MAXWrapper_object>
ShowDialog
Hide/show existing dialog without destroying it.
showDialog <rollout> <boolean>
Dialog Visibility
Useful whenever you want to test if the dialog is displayed (for example in the isChecked macroScript event handler). Similar to <rollout>.inDialog.
isDialogVisible <rollout>
Numbered String
Used by Render to Texture, adds a 4-character zero-padded suffix (or more, if the string representation of number is longer).
createNumberedFilename <string> <number>
Biped Methods
As posted to For those of you still stuck using biped and copy-collections.
<integer>biped.numCopies <collection_value> (#pose|#posture|#track)
<ICP_MXBipedCopy>biped.getCopy <collection_value> (#pose|#posture|#track) <index>
biped.deleteCopy <collection_value> (#pose|#posture|#track) <index>
biped.deleteAllCopies <collection_value> (#pose|#posture|#track)
Is Particle System
isParticleSystem <node>
Direct 3D Cache Allocation
For related methods, check the Direct 3D Cache Allocation Query Functions chapter.
setD3DMeshCacheSize <number>
And related Editable Poly methods:
<bool><EditablePoly>.GetCache_SystemOn()
<void><EditablePoly>.SetCache_SystemOn <bool>on
<bool><EditablePoly>.GetCache_SuspendDXCache()
<void><EditablePoly>.SetCache_SuspendDXCache <bool>suspend
<integer><EditablePoly>.GetCache_Cutoff()
<void><EditablePoly>.SetCache_Cutoff <integer>count
Link Constraint Methods
These used to be erroneously filed under Link_Control and were later removed as a part of the cleanup. They belong to the Link_Constraint chapter.
LinkCtrl.getLinkCount <controller>
LinkCtrl.getLinkTime <controller> <index>
LinkCtrl.setLinkTime <controller> <index> <time>
LinkCtrl.getLinkNode <controller> <index>
LinkCtrl.setLinkNode <controller> <index> <node>
LinkCtrl.addLink <controller> <node> <time>
LinkCtrl.deleteLink <controller> <index>
Visual Leak Detector
VLD.Disable()
VLD.Enable()
VLD.Restore()
VLD.ReportLeaks()
VLD.RefreshModules()
VLD.ResolveCallstacks()
VLD.EnableModule <unused> -- just returns OK
VLD.DisableModule <unused> -- just returns OK
VLD.TestLeakMemory <int_amount>
Commiting/Reverting Temporary 'Set Key animation mode' Buffers
SetKey.commitBuffer <MAXWrapper_object>
SetKey.bufferPresent <MAXWrapper_object>
SetKey.revertBuffer <MAXWrapper_object>
SetKey.subAnimRevertBuffer <MAXWrapper_object> <index>
SetKey.subAnimCommitBuffer <MAXWrapper_object> <index>
SetKey.subAnimBufferPresent <MAXWrapper_object> <index>
<bool>maxOps.allTracksCommitSetKeyBuffer()
<void>maxOps.allTracksRevertSetKeyBuffer()
<void>maxOps.allTracksSetKeyBufferPresent()
Templates and Workspaces
StartupTemplate.ShowUI()
StartupTemplate.ShowNewSceneUI()
StartupTemplate.GetAllNames()
StartupTemplate.GetAvailWorkspaces()
StartupTemplate.Activate <string>
StartupTemplate.GetWorkspace <string>
StartupTemplate.SetWorkspace <string> <string>
StartupTemplate.GetScene <string>
StartupTemplate.GetName <string>
StartupTemplate.GetDescription <string>
StartupTemplate.GetProjectFolder <string>
StartupTemplate.GetThumbnail <string>
StartupTemplate.SelectProjectFolder <string>
StartupTemplate.SelectThumbnail <string>
StartupTemplate.SelectScene <string>
StartupTemplate.SetScene <string> <string>
StartupTemplate.SetName <string> <string>
StartupTemplate.SetDescription <string> <string>
StartupTemplate.SetProjectFolder <string> <string>
StartupTemplate.GetViewSettings <string>
StartupTemplate.GetViewCubeConfig <string>
StartupTemplate.GetRollupConfig <string>
StartupTemplate.GetUIColorSettings <string>
StartupTemplate.GetUserPaths <string>
StartupTemplate.SnapshotViewSettings <string>
StartupTemplate.SnapshotViewCubeConfig <string>
StartupTemplate.SnapshotRollupConfig <string>
StartupTemplate.SnapshotUIColorSettings <string>
StartupTemplate.SnapshotUserPaths <string>
StartupTemplate.Delete <string>
StartupTemplate.Import <filename>
StartupTemplate.Export <string> <filename>
StartupTemplate.Load <filename>
StartupTemplate.LoadAll <???>
StartupTemplate.Save <string> <filename>
StartupTemplate.SaveAll <???>
Edit Poly Methods
A categorized index of some of these with descriptions and sample code available on the IllusionCatalyst website. For sample usage and a wrapper in the style of polyop methods, see the polyModOp struct.
<void>setVert <&bitArray>vertSet <&point3>point node:<node>

<void>getVertsUsingFace <&bitArray>vertSet <&bitArray>faceSet node:<node>
<void>getVertsUsingEdge <&bitArray>vertSet <&bitArray>edgeSet node:<node>
<void>getFacesUsingEdge <&bitArray>faceSet <&bitArray>edgeSet node:<node>
<void>getEdgesUsingVert <&bitArray>edgeSet <&bitArray>vertSet node:<node>
<void>getFacesUsingVert <&bitArray>faceSet <&bitArray>vertSet node:<node>
<void>getElementsUsingFace <&bitArray>elementSet <&bitArray>faceSet <&bitArray>fenceSet node:<node>

<point3 by value>GetFaceNormal <index>faceID node:<node>
<point3 by value>GetFaceCenter <index>faceID node:<node>
<float>GetFaceArea <index>faceID node:<node>
<bitArray>GetOpenEdges node:<node>

<integer>getVertexFlags <index>vertexID node:<node>
<integer>getEdgeFlags <index>edgeID node:<node>
<integer>getFaceFlags <index>faceID node:<node>
<void>setVertexFlags <&bitArray>vertexSet <DWORD>flagsToSet flagMask:<DWORD> generateUndoRecord:<bool> node:<node>
<void>setEdgeFlags <&bitArray>edgeSet <DWORD>flagsToSet flagMask:<DWORD> generateUndoRecord:<bool> node:<node>
<void>setFaceFlags <&bitArray>faceSet <DWORD>flagsToSet flagMask:<DWORD> generateUndoRecord:<bool> node:<node>
<bool>getVerticesByFlag <&bitArray>vertexSet <DWORD>flagsRequested flagMask:<DWORD> node:<node>
<bool>getEdgesByFlag <&bitArray>edgeSet <DWORD>flagsRequested flagMask:<DWORD> node:<node>
<bool>getFacesByFlag <&bitArray>faceSet <DWORD>flagsRequested flagMask:<DWORD> node:<node>

<bool>SmGrpFloaterVisible()
<void>SmGrpFloater()

<bool>MatIDFloaterVisible()
<void>MatIDFloater()

<void>CommitPaintDeform()
<void>CancelPaintDeform()
There are of course many more, like the numerous PolyB* methods, and then a whole lot of global scripted structs like uvwManipUtils, PolyBoost, PolyToolsUI, Ribbon_Modeling, Main_Ribbon and heaps of others but while not documented, those are easy to find and study in the stdscripts folder.

DISCLAIMER: All scripts and snippets are provided as is under Creative Commons Zero (public domain, no restrictions) license. The author and this blog cannot be held liable for any loss caused as a result of inaccuracy or error within these web pages. Use at your own risk.

This Post needs Your Comment!

Anonymous

Thank you!!!
this is valuable resources...i got some solution from this.

Return to top