Re: Progressbar in scripting

2013-12-04 Thread Alok Gandhi
It depends on how the progress bar is implemented. If there is a long process 
with just one update to progress bar then it will not have any effect. You need 
to increment or update the progress caption or something similar at some 
frequency.

Sent from my iPhone

 On Dec 4, 2013, at 2:56 AM, Szabolcs Matefy szabol...@crytek.com wrote:
 
 Thanks folks, however the progress bar is driven by the script, yet it is in 
 not responding state, and I cannot do anything, however it should be quite 
 important to have the feedback of what's happening. I turned off the logging, 
 because I gain at least double speed. Now the user who should run the script 
 will have no clue if XSI is running or hung.
 
 
 
 -Original Message-
 From: softimage-boun...@listproc.autodesk.com 
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Luc-Eric 
 Rousseau
 Sent: Wednesday, December 04, 2013 1:56 AM
 To: softimage@listproc.autodesk.com
 Subject: Re: Progressbar in scripting
 
 no, the problem is not that the ui is not redrawing. it's Windows'
 desktop compositor that's graying out the window by drawing on top of it.
 
 On Tue, Dec 3, 2013 at 6:59 PM, Jack Kao jack@grapecity.com wrote:
 You may also try sprinkle some Desktop.RedrawUI() in your script to 
 force UI update. Use it with caution though as it will slow you down. 
 :/
 
 
 From: softimage-boun...@listproc.autodesk.com
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok 
 Gandhi
 Sent: Wednesday, December 04, 2013 2:02 AM
 
 
 To: softimage@listproc.autodesk.com
 Subject: Re: Progressbar in scripting
 
 
 
 Yes I agree with Luc-Eric, if you implement an increment in progress 
 bar, even with the cancel button disabled, this should keep the freezing 
 away.
 
 
 
 On Tue, Dec 3, 2013 at 11:50 AM, Luc-Eric Rousseau 
 luceri...@gmail.com
 wrote:
 
 This is not something that XSI does and calling Refresh will have no 
 effect.  Windows starts to fade out applications that stop responding 
 to messages after a few seconds, and then eventually will show a 
 message saying the application has stopped responding (which is true,
 although it doesn't mean it's hung).If you're driving a progress
 bar yourself, you need to do poll for the cancel button more often to 
 let softimage breathe and pump messages.  I think incrementing the 
 value also does it but I cannot recall.
 
 
 On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy 
 szabol...@crytek.com
 wrote:
 OK, I'm doing a script, that reads plenty of data from different 
 files, etc.
 After a few seconds, the screen fades into white, the progressbar is 
 white, and it looks like XSI is hang (however it works). I tried the 
 Refresh command to make sure that the views and everything is 
 refreshed, in vain.
 Any idea on this issue?
 
 
 
 
 
 --
 Error! Filename not specified.
 
 



Re: Progressbar in scripting

2013-12-04 Thread Sergio Mucino
If you divide the process into smaller sub-processes and update 
accordingly as Alok suggests, you could add a small descriptive text 
line that would let the user know what the script is currently doing...


Sergio M.

On 04/12/2013 8:40 AM, Alok Gandhi wrote:

It depends on how the progress bar is implemented. If there is a long process 
with just one update to progress bar then it will not have any effect. You need 
to increment or update the progress caption or something similar at some 
frequency.

Sent from my iPhone


On Dec 4, 2013, at 2:56 AM, Szabolcs Matefy szabol...@crytek.com wrote:

Thanks folks, however the progress bar is driven by the script, yet it is in 
not responding state, and I cannot do anything, however it should be quite 
important to have the feedback of what's happening. I turned off the logging, 
because I gain at least double speed. Now the user who should run the script 
will have no clue if XSI is running or hung.



-Original Message-
From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Luc-Eric Rousseau
Sent: Wednesday, December 04, 2013 1:56 AM
To: softimage@listproc.autodesk.com
Subject: Re: Progressbar in scripting

no, the problem is not that the ui is not redrawing. it's Windows'
desktop compositor that's graying out the window by drawing on top of it.


On Tue, Dec 3, 2013 at 6:59 PM, Jack Kao jack@grapecity.com wrote:
You may also try sprinkle some Desktop.RedrawUI() in your script to
force UI update. Use it with caution though as it will slow you down.
:/


From: softimage-boun...@listproc.autodesk.com
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
Gandhi
Sent: Wednesday, December 04, 2013 2:02 AM


To: softimage@listproc.autodesk.com
Subject: Re: Progressbar in scripting



Yes I agree with Luc-Eric, if you implement an increment in progress
bar, even with the cancel button disabled, this should keep the freezing away.



On Tue, Dec 3, 2013 at 11:50 AM, Luc-Eric Rousseau
luceri...@gmail.com
wrote:

This is not something that XSI does and calling Refresh will have no
effect.  Windows starts to fade out applications that stop responding
to messages after a few seconds, and then eventually will show a
message saying the application has stopped responding (which is true,
although it doesn't mean it's hung).If you're driving a progress
bar yourself, you need to do poll for the cancel button more often to
let softimage breathe and pump messages.  I think incrementing the
value also does it but I cannot recall.


On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy
szabol...@crytek.com
wrote:

OK, I'm doing a script, that reads plenty of data from different
files, etc.
After a few seconds, the screen fades into white, the progressbar is
white, and it looks like XSI is hang (however it works). I tried the
Refresh command to make sure that the views and everything is
refreshed, in vain.
Any idea on this issue?





--
Error! Filename not specified.






--




Re: Progressbar in scripting

2013-12-04 Thread Alan Fregtman
Also don't forget the progressbar has 2 text fields.

There's .Caption for the left-aligned text, and there's .StatusText for the
right-aligned text.

If you define .StatusText it will take over the percentage display so if
you wanna see % still, you need to put it in the string yourself.

Usually I use .Caption to describe the general process and .StatusText to
say which item I'm currently processing, plus a percentage and sometimes
even an estimate of time left.

To estimate time left you just need to measure the time between each loop
iteration. I usually add it to a list and average the value, and then I can
compute roughly how many seconds the ??? remaining iterations will take,
and format it as XmXs.



On Wed, Dec 4, 2013 at 9:33 AM, Sergio Mucino sergio.muc...@modusfx.comwrote:

 If you divide the process into smaller sub-processes and update
 accordingly as Alok suggests, you could add a small descriptive text line
 that would let the user know what the script is currently doing...

 Sergio M.


 On 04/12/2013 8:40 AM, Alok Gandhi wrote:

 It depends on how the progress bar is implemented. If there is a long
 process with just one update to progress bar then it will not have any
 effect. You need to increment or update the progress caption or something
 similar at some frequency.

 Sent from my iPhone

  On Dec 4, 2013, at 2:56 AM, Szabolcs Matefy szabol...@crytek.com
 wrote:

 Thanks folks, however the progress bar is driven by the script, yet it
 is in not responding state, and I cannot do anything, however it should be
 quite important to have the feedback of what's happening. I turned off the
 logging, because I gain at least double speed. Now the user who should run
 the script will have no clue if XSI is running or hung.



 -Original Message-
 From: softimage-boun...@listproc.autodesk.com [mailto:softimage-bounces@
 listproc.autodesk.com] On Behalf Of Luc-Eric Rousseau
 Sent: Wednesday, December 04, 2013 1:56 AM
 To: softimage@listproc.autodesk.com
 Subject: Re: Progressbar in scripting

 no, the problem is not that the ui is not redrawing. it's Windows'
 desktop compositor that's graying out the window by drawing on top of it.

  On Tue, Dec 3, 2013 at 6:59 PM, Jack Kao jack@grapecity.com
 wrote:
 You may also try sprinkle some Desktop.RedrawUI() in your script to
 force UI update. Use it with caution though as it will slow you down.
 :/


 From: softimage-boun...@listproc.autodesk.com
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
 Gandhi
 Sent: Wednesday, December 04, 2013 2:02 AM


 To: softimage@listproc.autodesk.com
 Subject: Re: Progressbar in scripting



 Yes I agree with Luc-Eric, if you implement an increment in progress
 bar, even with the cancel button disabled, this should keep the
 freezing away.



 On Tue, Dec 3, 2013 at 11:50 AM, Luc-Eric Rousseau
 luceri...@gmail.com
 wrote:

 This is not something that XSI does and calling Refresh will have no
 effect.  Windows starts to fade out applications that stop responding
 to messages after a few seconds, and then eventually will show a
 message saying the application has stopped responding (which is true,
 although it doesn't mean it's hung).If you're driving a progress
 bar yourself, you need to do poll for the cancel button more often to
 let softimage breathe and pump messages.  I think incrementing the
 value also does it but I cannot recall.


 On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy
 szabol...@crytek.com
 wrote:

 OK, I'm doing a script, that reads plenty of data from different
 files, etc.
 After a few seconds, the screen fades into white, the progressbar is
 white, and it looks like XSI is hang (however it works). I tried the
 Refresh command to make sure that the views and everything is
 refreshed, in vain.
 Any idea on this issue?





 --
 Error! Filename not specified.




 --





RE: Progressbar in scripting

2013-12-03 Thread gareth bell
Do you see anything occurring in the command box at the bottom of xsi?

Date: Tue, 3 Dec 2013 11:11:44 -0500
From: sergio.muc...@modusfx.com
To: softimage@listproc.autodesk.com
Subject: Re: Progressbar in scripting


  

  
  
I've seen this happen with quite a few tools and programs (Softimage
is not the only one here). From what I understand, it's an
application problem. What's going on is that the application in
question (Softimage in this case) stops sending notifications to the
OS (I presume because it's busy doing stuff), so the OS thinks the
application is hung, and informs you about it. I don't think there's
anything you can do about it (although I could be wrong, so I hope
someone could expand on this in case I am), since it has to be taken
care of at the application level. In other words, no matter what
process the application is doing, it'd need to notify the OS it's
actually working (scripts are notorious to trigger these states).

Cheers!



On 03/12/2013 10:20 AM, Szabolcs Matefy
  wrote:



  
  
  
  
OK, I’m doing a script, that reads plenty
  of data from different files, etc. After a few seconds, the
  screen fades into white, the progressbar is white, and it
  looks like XSI is hang (however it works). I tried the Refresh
  command to make sure that the views and everything is
  refreshed, in vain. Any idea on this issue?
 


  Cheers
 
Szabolcs
  
  ___

  This message contains confidential information and is intended
  only for the individual named. If you are not the named addressee
  you should not disseminate, distribute or copy this e-mail. Please
  notify the sender immediately by e-mail if you have received this
  e-mail by mistake and delete this e-mail from your system. E-mail
  transmission cannot be guaranteed to be secure or error-free as
  information could be intercepted, corrupted, lost, destroyed,
  arrive late or incomplete, or contain viruses. The sender
  therefore does not accept liability for any errors or omissions in
  the contents of this message, which arise as a result of e-mail
  transmission. If verification is required please request a
  hard-copy version. Crytek GmbH - http://www.crytek.com -
  Grüneburgweg 16-18, 60322 Frankfurt - HRB77322 Amtsgericht
  Frankfurt a. Main- UST IdentNr.: DE20432461 - Geschaeftsfuehrer:
  Avni Yerli, Cevat Yerli, Faruk Yerli




-- 

  

  inline: CUserssergio.mucinoDownloadsSergioMucino_Signature_email.gif

Re: Progressbar in scripting

2013-12-03 Thread Luc-Eric Rousseau
This is not something that XSI does and calling Refresh will have no
effect.  Windows starts to fade out applications that stop responding
to messages after a few seconds, and then eventually will show a
message saying the application has stopped responding (which is true,
although it doesn't mean it's hung).If you're driving a progress
bar yourself, you need to do poll for the cancel button more often to
let softimage breathe and pump messages.  I think incrementing the
value also does it but I cannot recall.

On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy szabol...@crytek.com wrote:
 OK, I’m doing a script, that reads plenty of data from different files, etc.
 After a few seconds, the screen fades into white, the progressbar is white,
 and it looks like XSI is hang (however it works). I tried the Refresh
 command to make sure that the views and everything is refreshed, in vain.
 Any idea on this issue?




RE: Progressbar in scripting

2013-12-03 Thread Jack Kao
You may also try sprinkle some Desktop.RedrawUI() in your script to force
UI update. Use it with caution though as it will slow you down. :/





*From:* softimage-boun...@listproc.autodesk.com [mailto:
softimage-boun...@listproc.autodesk.com] *On Behalf Of *Alok Gandhi
*Sent:* Wednesday, December 04, 2013 2:02 AM
*To:* softimage@listproc.autodesk.com
*Subject:* Re: Progressbar in scripting



Yes I agree with Luc-Eric, if you implement an increment in progress bar,
even with the cancel button disabled, this should keep the freezing away.



On Tue, Dec 3, 2013 at 11:50 AM, Luc-Eric Rousseau luceri...@gmail.com
wrote:

This is not something that XSI does and calling Refresh will have no
effect.  Windows starts to fade out applications that stop responding
to messages after a few seconds, and then eventually will show a
message saying the application has stopped responding (which is true,
although it doesn't mean it's hung).If you're driving a progress
bar yourself, you need to do poll for the cancel button more often to
let softimage breathe and pump messages.  I think incrementing the
value also does it but I cannot recall.


On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy szabol...@crytek.com
wrote:
 OK, I’m doing a script, that reads plenty of data from different files,
etc.
 After a few seconds, the screen fades into white, the progressbar is
white,
 and it looks like XSI is hang (however it works). I tried the Refresh
 command to make sure that the views and everything is refreshed, in vain.
 Any idea on this issue?






-- 
*Error! Filename not specified.*


Re: Progressbar in scripting

2013-12-03 Thread Luc-Eric Rousseau
no, the problem is not that the ui is not redrawing. it's Windows'
desktop compositor that's graying out the window by drawing on top of
it.

On Tue, Dec 3, 2013 at 6:59 PM, Jack Kao jack@grapecity.com wrote:
 You may also try sprinkle some Desktop.RedrawUI() in your script to force UI
 update. Use it with caution though as it will slow you down. :/


 From: softimage-boun...@listproc.autodesk.com
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok Gandhi
 Sent: Wednesday, December 04, 2013 2:02 AM


 To: softimage@listproc.autodesk.com
 Subject: Re: Progressbar in scripting



 Yes I agree with Luc-Eric, if you implement an increment in progress bar,
 even with the cancel button disabled, this should keep the freezing away.



 On Tue, Dec 3, 2013 at 11:50 AM, Luc-Eric Rousseau luceri...@gmail.com
 wrote:

 This is not something that XSI does and calling Refresh will have no
 effect.  Windows starts to fade out applications that stop responding
 to messages after a few seconds, and then eventually will show a
 message saying the application has stopped responding (which is true,
 although it doesn't mean it's hung).If you're driving a progress
 bar yourself, you need to do poll for the cancel button more often to
 let softimage breathe and pump messages.  I think incrementing the
 value also does it but I cannot recall.


 On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy szabol...@crytek.com
 wrote:
 OK, I’m doing a script, that reads plenty of data from different files,
 etc.
 After a few seconds, the screen fades into white, the progressbar is
 white,
 and it looks like XSI is hang (however it works). I tried the Refresh
 command to make sure that the views and everything is refreshed, in vain.
 Any idea on this issue?






 --
 Error! Filename not specified.



RE: Progressbar in scripting

2013-12-03 Thread Jack Kao
I see.

-Original Message-
From: softimage-boun...@listproc.autodesk.com
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Luc-Eric
Rousseau
Sent: Wednesday, December 04, 2013 9:56 AM
To: softimage@listproc.autodesk.com
Subject: Re: Progressbar in scripting

no, the problem is not that the ui is not redrawing. it's Windows'
desktop compositor that's graying out the window by drawing on top of
it.

On Tue, Dec 3, 2013 at 6:59 PM, Jack Kao jack@grapecity.com wrote:
 You may also try sprinkle some Desktop.RedrawUI() in your script to
force UI
 update. Use it with caution though as it will slow you down. :/


 From: softimage-boun...@listproc.autodesk.com
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Alok
Gandhi
 Sent: Wednesday, December 04, 2013 2:02 AM


 To: softimage@listproc.autodesk.com
 Subject: Re: Progressbar in scripting



 Yes I agree with Luc-Eric, if you implement an increment in progress
bar,
 even with the cancel button disabled, this should keep the freezing
away.



 On Tue, Dec 3, 2013 at 11:50 AM, Luc-Eric Rousseau luceri...@gmail.com
 wrote:

 This is not something that XSI does and calling Refresh will have no
 effect.  Windows starts to fade out applications that stop responding
 to messages after a few seconds, and then eventually will show a
 message saying the application has stopped responding (which is true,
 although it doesn't mean it's hung).If you're driving a progress
 bar yourself, you need to do poll for the cancel button more often to
 let softimage breathe and pump messages.  I think incrementing the
 value also does it but I cannot recall.


 On Tue, Dec 3, 2013 at 10:20 AM, Szabolcs Matefy szabol...@crytek.com
 wrote:
 OK, I'm doing a script, that reads plenty of data from different files,
 etc.
 After a few seconds, the screen fades into white, the progressbar is
 white,
 and it looks like XSI is hang (however it works). I tried the Refresh
 command to make sure that the views and everything is refreshed, in
vain.
 Any idea on this issue?






 --
 Error! Filename not specified.