I am showing 2 progress bars in a window and the text above each progress bar is some text to describe it. However, I am finding that the text doesn't draw until the whole progress has finished. The progress bars work fine as they are refreshing regularly. The text, however, doesn't draw and refresh until the window progress bars have finished.
Basically, is there any quick way to refresh a window via mel, so that any text labels etc definitely show?
A snippet of the mel script is below. Where am I going wrong? I'm am pretty useless with Maya UI mel stuff. Bear in mind, it's not tabulated properly because of the text entry on this forum.
waitCursor -state on; string $pWin,$progressControl; string $vertprogressControl; string $version = about -v; string $release = substring $version 1 1; if ( float( $release ) > 3 ) // only version 4... { $pWin = window -s 0 -tb 1 -widthHeight 320 120 "BlendsTransporter"; columnLayout -adjustableColumn 1 -rowSpacing 2; text -label "Blendmesh being matched."; separator -style "single";
Well, there's a "refresh" command that will redraw 3D views (and possibly other UI elements?) in the middle of a script, because redrawing is suspended while your script is executing.
My copy of Maya is on a machine that's currently not up and running (I just moved) so I can't test it, but maybe if you throw in a refresh command just after the showWindow command it will fully draw the window? It's worth trying.
This is just a guess since you only posted a snipet of the code you are using, but are you starting some process before the window has a chance to draw? If the CPU is taking a big hit from your script, your GUI will not get fully drawn until there are available cycles.
Yeah, this is my suspicion too, but how do I avoid that problem? The script goes on to generate new blendshape meshes from a base mesh. Quite processor intensive.
How do I allow the window to drawrefresh before I continue with the script? I have tried the refresh method and the pause method. Any other ideas?
Any assistance in this area would be most useful. I am finding this is a common report from several people. Is it a bug with Maya?
I'd bet $5 that there's an undocumented command that does this. You should try posting this question in the new Maya UI discussion under the Maya tab on www.cgtalk.com.
I still think the text should have shown anyway, but the way to overcome my problem was to use the "text -e" command to edit the text label after the "showWindow" command. This forced the text to show.