redraw screen after transform

hi i try a transform with Blender 2.5 and python api like this :

x=1
for u in range(1,10):
	bpy.ops.transform.shrink_fatten(value=x, proportional='DISABLED',
        proportional_editing_falloff='SMOOTH', proportional_size=1, mirror=False, snap=False)
	time.sleep(2)
	x+=1

the screem did not redraw the and the object too, who got a solution
in old blender i use

Blender.Redraw()

I don’t know the answer but I suggest to take a look to the operator_modal_draw.py that ships with Blender/scripts/templates.

Basically you add a function that will be called whenever a pixel need to be drawn on screen.


# Add the region OpenGL drawing callback
# draw in view space with 'POST_VIEW' and 'PRE_VIEW'
self._handle = context.region.callback_add(draw_callback_px, (self, context), 'POST_PIXEL')

thank you for your prompt response,i try this

import time
import bpy

import operator_modal_draw

x=1

for u in range(1,10):
bpy.ops.transform.shrink_fatten(value=x, proportional=‘DISABLED’,
proportional_editing_falloff=‘SMOOTH’, proportional_size=1, mirror=False, snap=False)

Add the region OpenGL drawing callback

draw in view space with ‘POST_VIEW’ and ‘PRE_VIEW’

self._handle = bpy.context.region.callback_add(operator_modal_draw.draw_callback_px,(self, bpy.context), ‘POST_PIXEL’)
time.sleep(2)
print(x)
x+=1

but i get this error

location:<unknown location>:-1
Traceback (most recent call last):
File “Text”, line 13, in <module>
NameError: name ‘self’ is not defined

location:<unknown location>:-1

location:<unknown location>:-1