The MXSCallstackCaptureDepth context allows you to better control how the MAXScript call stack is captured, which can aid in debugging. With deep stacks and/or lots of arrays, big structures, etc present in the call stack, doing a stack capture can be an expensive operation. This context specifies how many levels of the mxs call stack is captured if a mxs runtime exception is thrown.
Setting MXSCallstackCaptureDepth to -1 captures the full call stack.
Available in 3ds Max 2026.1 and higher.
For example:
with MXSCallstackCaptureDepth 3 -- capture 3 levels of the call stack on exception
(
setproperty obj #prop val
)
MXSCallstackCaptureDepth is also present as a MAXScript System Global