[Bf-python] mesh block selection

Willian Padovani Germano wgermano at ig.com.br
Sun Oct 5 15:41:45 CEST 2003


From: <models at paposo.com>
(...)
> About redrawing the scene after Scene.link().
> Try runnng this script:
>
> import Blender
> obj = Blender.Object.New('Mesh')
> mesh = Blender.NMesh.New()
>
> for j in range(0,100:
>     v = Blender.NMesh.Vert()
>     v.co[0] = j
>     v.co[1] = j
>     v.co[2] = 0
>     mesh.verts.append(v)
>
> obj.link(mesh)
> sc = Blender.Scene.getCurrent()
> sc.link(obj)
>
> Hit alt-P and look in the 3dview.  It doesn't update. You have to drag
> something around, etc. for the window to update and redraw the new linked
> object. That's what i was saying.

I understood it.  What I meant is that script writers can (and do) update
any window themselves.  The script above is not complete.  In its end, you
need to redraw at least the 'VIEW3D'.  As I said, check one of the many
redraws bpython has: there's one in Blender, a few in Window
(Redraw(spacetipe), RedrawAll() and queued redraws) and one in Draw, for gui
scripts.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list