update blender in a script

hello
I just wondered, is there a way to update the blenderwindow when running a script?
for example

while(1):
     print("test")
     blender.update()   #  update the blender window, is this posible??

Please help :slight_smile:

blender window?

do you mean the rest of the UI [which isn’t there in a runtime…]

no, it isn’t possible [offically, or probably at all]

I mean the 3d window, i used Tkinter some, and there was a command update(), and was hopind there was something simular in python

well, then why is this in the game engine forum?

I believe Blender.Draw.Redraw() will re-draw the blender window [even if python doesn’t stop running]. SPE when started from blender has the option of redrawing blender [even though it is non-responsive otherwise] every 30 seconds.

[quote=“z3r0 d”]well, then why is this in the game engine forum?

I believe Blender.Draw.Redraw() will re-draw the blender window [even if python doesn’t stop running].[quote]
i mean update the 3d window in real time engine is running. Thats why i am posting it here.

il take a look at the rewraw command…

uhh, I don’t know why on earth you would make a game engine script take so long to run that you want the 3d window to redraw

but I don’t think you’re going to get it to happen

lol, so i guess that means it cant be done.
the script would go in a loop, thats why i wanned it to redraw the 3d window.
Thanks annyway :slight_smile:

In game engine script has to load actual state of iteration, do a few iterations (in best case only one iteration) and save actual state of iteration. This way it will allow refreshing of 3d view.

Put the script in a controller linked to an ‘always’ sensor and set the pulse to 1 frame.

You can’t refresh the screen faster than your fps count anyway.

Just rewrite your algorithm to keep data in a property linked to an object.
Simple as that.

ciacio

Some data cant be stored like that way, but it dosent matter, thanks annnyway

Store your data in a global variable:

GameLogic.my_global_var = every kind of python object here

ciacio

i have alredy tryed that, but in this case it cant be done correctly. But thanks for all the replys :slight_smile: