[Closed] Interface updates while busy
I am using Windows 7 and max 2011, and I think perhaps this is a windows issue rather than max/maxscript, but the problem affects the running of scripts in a very damaging way, so I try to ask about it here.
Whenever I run a script that has a running time of more than a few seconds, the dialog/max interface inevitably freezes with a “Not responding” note in the window title bar, and UI changes like in progress bars or maxscript listener no longer update, until the script has finished. This is really annoying, as many of my scripts work with large datasets and take a long time to complete. Now I have no idea when they will finish, or how they are doing.
It seems to me like this is perhaps some automatic windows safeguard to prevent bugged applications from destroying windows UI performance?
Thanks for the link. I also found some info on the net. Disabling the following service seems to do the trick, although I’m uncertain about any side effects this might have:
Windows 7 64bit Ultimate: Control Panel -> System and Security -> Administrative Tools -> Services -> Desktop Window Manager Session Manager
It seems to interfere with general redraw so that although my progress bar will now draw correctly through the whole execution, the rest of my dialog interface does not recover from the overlapping OpenFile dialog (which has just been closed) until execution is done. However, this is probably the way it always used to be? When running scripts in XP I would often end up looking at a “dead” screen where only the progress bar was updating.
Well, the only “almost” perfect way around it that I found (and know about) so far is using ProgressStart End and Update. That perfectly prevents windows from stalling the 3ds Maxs UI.
But the side effect is that it will hide all UI elements unless you fool with it like I do but it only works for custom local scripts (without users) as the viewport is fully exposed during run time.
Davy
Yeah, disabling that service seems to disable everthing “Aero”, so I guess many would shy away from that. It saves me rewriting all my old scripts though.
Not sure I fully understood the problem you are having…
when you run your script, since it takes a lot of time (for whatever reasons), 3dsmax “freezes” until it finishes running your script, right?
You could use dotnetobject “CSharpUtilities.SynchronizingBackgroundWorker”
in order to run whatever function you want asynchronously. This will prevent 3dsmax from freezing.
Well, max does “freeze”, but that is ok, I don’t really want to be doing other stuff in max while my script is running. The problem is that Windows 7 decides that max/maxscript is hanging/not responding and therefore shuts down UI updates in max/maxscript windows, even if my script is making calls to (a local) progress bar or maxscript listener.
As discussed in the other thread mentioned above, rewriting a script to use the “global” max progress bar will circumvent the issue. It’s a case of either max being sloppy about letting windows know something is still happening or windows being too quick to decide nothing is happening, but I don’t know which.
Disabling the service mentioned above stops the erroneous behaviour (and Aero with it). There appears to be other workarounds too, including your suggestion.
The annoying thing is that 3ds Max is not stalling or freezing, it “is” calculating things and doing stuff…but it is just the combination of the OS not knowing that 3ds Max is still busy, even if you update with a pushPrompt etc.
I also searched a registry to disable that from happening, or increase the time when windows decides a progam is not responding, no luck.
In general, I hate this kind of behaviour of windows. I can know myself when a program is not responding, I don’t need windows to decide that for me. If you could disable that, quite sure you can somehow…all would be fixed.
Davy
Hopefully it is not just about “knowing” that an application is “not responding”, but also about taking precautions so that the application in question does not impact system stability (access to cpu/memory resources etc.). If that is the case, then the functionality at least makes some sense. However, it’s clearly not working as intended in this instance.
Well, it is just for users convinience I suppose cause that thing that happens does not prevent 3ds Max from using more memory nor restricting CPU resources…it keeps ongoing no mather what.
So for me so far, that feature of windows does not do anything useful other than annoying me
Davy