To return to the try()catch() performance degredation, here's an example of where it's required, and where the use of "with MXSCallstackCaptureEnabled off" is inadequate.
Where I'm iterating over all the scene objects and modifiers and getting or setting a parameter, I can usually use "hasproperty", but for some classes this doesn't work; for example the cloth modifier.
Create a box and add a cloth modifier.
m=$.modifiers[1]
hasproperty m "bias"
getproperty m "bias"
As you can see, even though hasproperty returns true, when I attempt to get the property, I get an exception.
My script aims to work without hard-coding every class property, so it is essential that I can use maxscript to a) list the class properties, then b) check that an object has that property before c) getting or setting that property.
As the behaviour of some classes(maybe only the cloth modifier, but maybe others) does not allow me to reliably check for the existance of a property, I have to set get/setproperty within a try/catch.
So... this was all well and good in 3dsmax versions up to 2017 as try/catch doesn't degrade performance too much. In 2017 I can't use try/catch anymore, so I either have to hard-code a test for invalid classes (something I can't do till I actually stumble across this bug), or I use the new MXSCallstackCaptureEnabled method to bring the try/catch performance closer to what it was in 2016 and before.
I would do this, but this now introduces code that isn't supported in versions prior to 2017 so I am now forced to add another test to return the max version and to run a different copy of the same chunk of code depending on the max version. This does not seem like a good place to end up!
If the new stack-trace method was disabled by default, none of this would be an issue, and where I was developing in a known 2017 environment, I would be able to enable the enhanced stack-trace as required. Assuming I am not missing another far easier approach to circumvent these issues, can I request that you pass this back to your developers and ask them to consider reverting to the original stack-trace behaviour with the new behaviour only active when explicitly called.
Patrick Macdonald
Lighting TD
http://patrick.reformstudios.com
Developer of Mission Control , the spreadsheet editor for 3ds Max
http://mcontrol.reformstudios.com