So, I've noticed that some operations in Max, when done to a large number of objects (500, 1000, etc) seem to go slower on each object.
For example, I have about 500 groups in a scene I'm working on. I select all of them, ungroup, and the modifier window blinks like mad as refreshes. It selects each group, ungroups, selects the next, etc... but after it does this for awhile, I notice that each successive blink is slightly longer than the next. Basically, I can ungroup 100 objects in 10 seconds, but ungrouping 500 objects takes 100 seconds.
By itself, this isn't a big deal, but if you do the same thing on an even larger number of objects, sometimes this causes crashes. It's not specific to just ungroup, it seems to be on a lot of different operations; some Maxscripts, applying modifiers to large groups, renaming objects, collapsing large groups of objects to editable polys, etc.
Anybody know what's causing this, aside from bad programming? Short of breaking this up into smaller batches, is there an easy way to fix this?
Any info would be appreciated... this is starting to drive me crazy.
Replies
http://www.kxcad.net/autodesk/Autodesk_MAXScript_Reference_9/How_To_Make_It_Faster_.htm
as a general rule of thumb you can speed things up alot by opening your script with
disableSceneRedraw()
suspendEditing()
and ending it with
enableSceneRedraw()
resumeEditing()
This will stop all viewport updates and command panel updates until the script is finished.
Thanks. Won't fix it for unscripted things, but at least now I have an idea why it's trying to eff up my day.
gc()
anything within the brackets wont trigger an undo entry. This can really make things fast, but has obvious drawbacks :shifty: