[Bf-taskforce25] context proposal

Brecht Van Lommel brecht at blender.org
Sun Dec 7 21:40:38 CET 2008


Hi,

On Sat, 2008-12-06 at 19:13 +0100, Ton Roosendaal wrote:
> One thing to look a bit further at is how the "data context" would 
> work.

Thanks for the feedback, I've updated this part of the document to work
with callback functions. Note there is some example code at the bottom
that should explain things better.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Context

What I'm still struggling with is how to make the system so that python
can wrap it. It's not just a matter of having a 'clean API' as mentioned
in the meeting I think, names and types also need to be provided unless
this is wrapped manually.

Ideally python could get and set any blender data into the context, and
also its own data that blender may not know about in advance. For this
reason I've still made it based on identifier names, but also native get
functions for easier access. An RNA type can also be specified, this way
python can do something with the data without having to manually wrap
it.

Also I've made list/arrays works based on an iterator. This is not the
easiest solution always, building a listbase or returning an array may
be simpler but perhaps less memory efficient. Not sure if that matters
much in practice, in that case we could decide to not use iterators.

Brecht.




More information about the Bf-taskforce25 mailing list