[Bf-taskforce25] RNA and API wrap-up

Campbell Barton ideasman42 at gmail.com
Wed Jul 1 13:20:24 CEST 2009


On Wed, Jul 1, 2009 at 3:49 AM, Toni Alatalo<antont at kyperjokki.fi> wrote:
> Campbell Barton kirjoitti:
>>> mesh.verts.as_array(attr="no", filter={'selected' : 1})
>>> So we could easily add other allowed filtering attributes (not thinking about vertices at the moment but also for other properties).
>>>
>> yep, this looks good.
>>
>
> is this reinventing numpy?
>
> i haven't yet used the more advanced features of it, like .. what do
> they call it, their slices or something, so am not sure if those
> syntaxes give similar behaviour.
>
> ~Toni

Python3's buffer types copied from numpy I think. The buffer
stride/offset/length stuff is a standard in py3 so we shouldnt need to
re-invent.

With mesh.verts.foreach_*() functions, the nice thing is we dont have
to worry about what type is passed to it - could be a numpy array or a
python array.array() type. as long as it supports pythons buffer
protocol.

If we want to be able to give the user a new buffer rather then
filling an existing one we have the option to return a new buffer or a
thin wrapped buffer that is referencing a blender internal array.
Either way we could return a python array, numpy array or our own
rna-array which could have useful utility functions.


More information about the Bf-taskforce25 mailing list