Notifications
Clear all

[Closed] Max Slow Down

Hey,

I have now made 2 different scripts at work that both tend to contain a lot of operations, but different kinds. But the problem I have occurs on both of them.

1st script compares the open edge vertices of a selected mesh with user chosen target meshes and then for all the vertices that are located approximately on the same spot it equalizes their positions and skin weights in order to make the seam between the meshes not visible. As some of the assets are out sourced and they are not always the same which causes tearing between them from the rig and animations.

2nd script runs through a selected folder getting all the .fbx files in it, opening them, selecting the visible mesh and removing its skin modifier and then exporting the selected mesh as an .obj

So the actual problem that I have ran across on both of these scripts is that with each run of either script they slow down. I have gone through help article on max documentation on how to make it faster which did make the initial run a lot faster, but it didn’t stop the slow down effect. I am also calling garbage collection after every major loop in either script so I’m quite clueless at this point at what is causing the slow down, besides I think it has something to do with the memory usage as the memory max is using does go up. And I have no idea how I could free that since garbage collection doesn’t seem to do the trick.
— Notice the edit on the bottom! —

For example on run times:
with the 1st script it processes the vertices of the selected mesh + 3-4 target meshes on the first run in 16-19 seconds and after that increases by 2-10 seconds on each run.
while as with the 2nd script it processes 237 .fbx files on the first run in 10 minutes and on the second run it took 42 minutes already.

I don’t have better documentation on the times/memory usage right now, but I’m planning to run some testing on them to try make one once I get the time.

EDIT: Seems like the problem is in my max as my colleague doesn’t get any slow down or increase of run time on the scripts when running them.