On 17/05/2015 at 20:39, xxxxxxxx wrote:
I have a loop that goes through all the lines of a file with:
for line in fileinput.input(my_file,mode="rb") :
I was trying to update the Status bar but it is not updating.
Even setting it to spin, leaves it with the bars but with no movement.
Is there a way to for the update of the status bar?
Why is it not updating?
On 18/05/2015 at 08:32, xxxxxxxx wrote:
Now I just have it inside a while loop:
and I even included a c4d.EventAdd() right after the c4d.StatusSetBar(progress) and I still have no refresh in the status bar.
On 18/05/2015 at 10:08, xxxxxxxx wrote:
in which context are you experiencing this (Python plugin (which function), Python script, Python node, Python generator,...)?
On 18/05/2015 at 10:45, xxxxxxxx wrote:
I'm testing it as a script and it doesn't work.
But after this, I will be creating a CommandPlugin.
Will it work there, if it is not working in the script?
On 19/05/2015 at 07:35, xxxxxxxx wrote:
actually I would have to look up. But my assumption is, that the script is executed in the same thread, that handling the entire GUI. And if you are looping in this thread, there's obviously no one, who could update the status bar.
In a plugin, you have (nearly) all freedom. You could either offload the work into a thread. Or you can break up your loop to give the GUI "time to breathe". This all highly depends on your actual implementation.
On 19/05/2015 at 07:59, xxxxxxxx wrote:
Ok, I found out why it was not displaying. I had a misbehaved loop inside my main loop that was taking just too long and, inside that misbehaved loop there was NO updates to the status bar.