Im very new to Blender and and python and have written a simple script in python
to generate random poses of my rigged mesh.
The script works fine when n=1 and i push the Run Script button multiple times -> I see multiple different poses in the 3D viewport.
I now want to set n = 100 and see the poses displayed one after the other in the vieport. Unfortunately this doesnt happen. Instead I see the first pose, a long delay and then the last pose. There is no update of the viewport.
How can I force the viewport to update at the end of my loop? bpy.data.scenes.update() doesnt seem to do anything.
Unfortunately I dont understand how to implement your solution.
Where do I start i.e. what files do I have to create and where do I have to put them?
Lets assume I call the little script I wrote in my first post RandHandPose.py then where would I put it? Where would I put the timer script you provided and how would I call RandHandPose.py from that script?
Also, is there absolutely no way to refresh the Blender 3D viewport? In 2.49 there was the redraw() method which seemed to work but I cant find the equivalent version in 2.57 (the version im using).
I say this is a hack because according to the FAQ its not a supported technique
and wont be accepted in any user supplied addons. The correct way is, as batFinger pointed out, modal timers or frame handlers.