When drawing a mesh with python (see the script appended) and manipulating its location, blender doesn’t update its views. I first thought, the ‘setLocation()’ function doesn’t work as I expected, but when I select the plane and push ‘s’ (scale) or ‘g’ (grab), the view finally gets updated and the translation shown.
I would like to manipulate objects interactively using scripts, so here my question: Is there some other, more immediate way than ‘Blender.Redraw()’ to update the view from python?
Thanks for your answer! - and sorry for answering so late…
Trying the following commands:
Blender.Redraw()
Blender.Draw.Redraw()
Blender.Draw.Redraw( 1 )
Blender.Draw.Draw()
with and without
plane.update()
I could observe the following results:
the behavior with or without ‘plane.update()’ was in all cases the same.
the first draw command (the one I originally used) shows the mesh immediately but doesn’t display its translation. (Even when I used one of the other three draw commands in combination with the first one, the translation would not be shown.)
the other three draw commands all caused the following behavior:
the mesh would be shown only after the “sleep” but with the translation applied to it. Probably the draw command is called only once after the script’s execution is completed.
What I wanted is some command showing the position of the mesh before and after the translation. This was the behavior of the script in one of the older blender versions (2,36?) but it seems not to be realizable anymore.
At least the last three draw commands show the mesh in its final position and it seems I have to be happy with them.