[Bf-python] [Fwd: [pygame] numpy array module now in the pygame development tree]

Toni Alatalo antont at kyperjokki.fi
Fri Jan 4 10:47:06 CET 2008


for your information,

the ancient but living pygame library (sdl wrapper + stuff, so gives 
pixel access to displays etc) has now finally integrated support for the 
new numpy, replacing the ancient Numeric it had (two step older version 
of numpy, the current project at scipy.org is now the 3rd numpy afaik .. 
during >10years or so. the scipy one is probably pretty permanent now, 
numpy is so central there and the research labs using it are not going 
to go away i bet :)

it is used in the pygame.surfarray module for fast processing of 2d 
pixel arrays i.e. images. the old Numeric was already used in the '90s 
for old school style real-time flame effects etc :)

seems they also decided to add the headers needed to compile in the 
project itself, so that nothing from numpy is needed to compile pygame, 
but the optional module can be installed by users who want it and the 
support is always compiled in:

"""

Additionally the compile time dependency on Numeric has been resolved by
importing the necessary headers directly into pygame. So you won't need
Numeric at compile time anymore to build the surfarray module, but still
will have to install it later on, if you need to use pygame.surfarray.
"""

This might be a good approach for Blender too?

And I think, besides animating duplivert swarms via the keybuffer like Theo has done, and perhaps adding numarray support for the particles to be able to animate them quickly too with numpy (i asked Janne Karhu at the conference and iirc he said the particles are in a continuous memory area (buffer) that would suite numpy processing), a most interesting area in Blender would be exactly the same as it now is on pygame: image manipulation in e.g. composite nodes. So pygame now has current example of how that could be implemented.

So just for info if someone happens to get to work on this. Am personally totally booked for a month or two now at least and don't need this urgently, but some day probably will :)

~Toni


-------------- next part --------------
An embedded message was scrubbed...
From: Marcus von Appen <mva at sysfault.org>
Subject: [pygame] numpy array module now in the pygame development tree
Date: Fri, 4 Jan 2008 09:15:53 +0100
Size: 3866
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20080104/136de197/attachment.mht>


More information about the Bf-python mailing list