• 1/3

Preventing 3ds Max from 'Not Responding' when MAXScript is doing a lot of work

Posted by MaxStation, 6 February 2012 12:00 am

When you run a script that's doing a lot of work 3ds Max tends to show 'Not Responding' in the title bar and won't print progress messages in the Listener either. Luckily there is the windows.processPostedMessages() function that can help!

Call the function just before you print the output to the listener:

for i=1 to 100 do
(
 s=timeStamp()

 -- put your code here

 e=timeStamp()
 windows.processPostedMessages()
 format "%s\n" ((e-s)/1000.0)
)

11 Comments

jona vark

Posted 6 February 2012 2:52 pm

OK.. here's a SIMPLER question. How do we get support for Maxscript to fill in the gaps in the poor documentation without paying for it? Or, to complete missing info for interfaces that aren't documented in Maxscript? Maybe you can answer that one?

spacefrog

Posted 6 February 2012 10:55 pm

I agree totally with previous posters. What i had in mind for longer time already...
Why not taking a capable & mighty but still lightweight IDE and write the plugins and lexers for Maxscript ?

The specific IDE i have in mind when writing this is FlashDevelop:
it's be far the slickest, quickest and lightest IDE i have ever used, and it's completely open source. It should be pretty straight forward building a bridge to maxscript and the corresponding mxs lexer...
I do not have the spare time currently to investigate in such a project, but it's one of the things that's constantly sitting in my back-brain for some time now...

and regarding the original topic:
You might send that processMessages() tip to the Max Core team too, the latest Max releases are known too notoriously cause that "Application has stopped responding" windows message because it fails to process it's pending windows messages in the main loop....

MaxStation

Posted 7 February 2012 7:26 am

Thanks for the feedback, yes it seems there are a couple of entries missing from the windows struct:

#Struct:windows(
getChildHWND:; Public,
postMessage:; Public,
getHWNDData:; Public,
sendMessage:; Public,
getMAXHWND:; Public,
addChild:; Public,
processPostedMessages:; Public,
getChildrenHWND:; Public,
getDesktopHWND:; Public)

I'll forward the request for documentation on the missing entries.

Support for MaxScript: forums

Better documentation & an IDE: wish and vote for it on the 3ds Max Community wishlist: https://autodesk.uservoice.com/forums/80701-publicsdkandscriptingenhancements

jona vark

Posted 7 February 2012 8:48 am

Agreed on the IDE but I could live with what we have if there were some support beyond what we have now. In my render manager, which I wrote to add power management and direct VNC to servers from the manager, I got everything working but the interface for render progress seems to be broken. Also, in the docs, there is at least one interface that is suggested but not documented anywhere.

I see "Maxstation" has responded to one of the posts here.. but not my request. It is disheartening to say the least. I have written to Bobo and searched high and low for examples but there are none. ...

My render manager works well. I can control the power of all of the nodes in my render farm of 40 machines. I can manage jobs and I can access the desktop of all of the servers from it. But I still have to run the Monitor to see the progress. If I could just get someone to talk with it may only take an hour or so to complete the progress reporting code, if it is even possible. But, again, the fact that I get no response indicates that in reality it isn't possible?


So HOW do I get help?

jona vark

Posted 7 February 2012 8:52 am

With regard to the forums being a support portal... you know.. Blender is free and the same support system exists for them, but users have the code! SO AD, you're slowly falling behind the times. We need more robust support. You can only get help in the forums for things that have been done already. If you are doing something new you're SOL! I posted questions and code samples in the forums and received no response. So at that point to I abandon my new code?

jona vark

Posted 7 February 2012 8:52 am

With regard to the forums being a support portal... you know.. Blender is free and the same support system exists for them, but users have the code! SO AD, you're slowly falling behind the times. We need more robust support. You can only get help in the forums for things that have been done already. If you are doing something new you're SOL! I posted questions and code samples in the forums and received no response. So at that point to I abandon my new code?

Rockin

Posted 7 February 2012 10:12 am

Thanks, very useful tip!

I have one question though, it seems this doesn't help in this case:
I have a progressbar inside a window, but it doesn't update until the script finishes the job.

Any ideas?

MaxStation

Posted 8 February 2012 7:29 am

Hi Rockin, just tried this and it seems to work fine for me (and gives me the 'Not Responding' pretty quickly if i comment the windows.processPostedMessages() out, does this not work for you?

rollout t "Test" (
button b "Test"
progressbar p color:red
on b pressed do (
maxi=10
maxj=50000
for i = 1 to maxi do (
for j = 1 to maxj do (
o=sphere radius:10
delete o )
p.value = 100.0*i/maxi
windows.processPostedMessages()
)
p.value = 0))
createDialog t 400 80

jona vark

Posted 8 February 2012 8:59 am

Maxstation:

So kind of you to take the time to help someone here.

You have told us that the available "support" is the forums. But most questions go unanswered there, like mine:

http://community.softimage.com/forum/autodesk-3ds-max/maxscript/maxscript---backburner---netrendermgr-progress/

If that's support I am the Wizard of OZ. Up for the challenge? Answer the question.


Rockin

Posted 8 February 2012 2:38 pm

Thanks, I've just tried your code and indeed it does work.
However, when I tried it inside an older script of mine it didn't update the progress bar. I think there's something wrong on my part... I'll investigate it further. Still, this is a great tip!

@jona vark
Unfortunately support to *anything* related to backburner is weak, so I guess this is reflected in maxscript access and documentation. As customers we must express our dissatisfaction with that .

You could try posting in the max script section on cgtalk, those guys helped me more than once...
http://forums.cgsociety.org/forumdisplay.php?s=477895bed173b17d711f4a94f58388a3&f=98

MaxStation

Posted 9 February 2012 5:38 am

Hi Jona, i hope this post helps a bit: http://area.autodesk.com/blogs/maxstation/n93_getting_backburner_status_information_from_maxscript

Add Your Comment

You must be logged in to post a comment. Login here or Register

Please only report comments that are spam or abusive.