[Bf-python] short term goals

Joseph Gilbert jgilbert at TIGR.org
Tue Jul 19 15:57:10 CEST 2005


Sounds wonderbar,
So we want to add a tp_tp_getset methods to every class and deprecate 
the tp_getattr and tp_setattr methods. I like it :)

I added something on the wiki here about (my preference :) ) regarding 
constants:
http://wiki.blender.org/bin/view.pl/Blenderdev/UseOfConstantsInTheAPI
This section talks about how to add module level contant objects which 
are bound internally to C #defines. I think Ken identified that some of 
this code is boilerplate and could go into gen_utils.c.  Generating a 
module constant and returning a module level constant could become a 
'boilerplate' util and you would need to only insert a new constant 
using this code into the init() methods. Calls to get/set for constants 
would be as easy as:

to get a constant for setting or returning:
loop{
    my_py_List.append(return_ModuleConstant("MODULE.CONSTANT_NAME"));
}
return my_py_List;

to pull the value from the constant:
value = PyInt_AS_LONG(PyDict_GetItemString(py_constant->dict, "value"));

Anyway just my suggestion :)

Willian Padovani Germano wrote:

> Hi Ken,
>
> Stephen and I discussed a little during yesterday's meeting.  It is a 
> good time to consider an overhaul, making the API more consistent and 
> clean, based on things we've learned and feedback from users.  A wiki 
> page and a forum thread will be used to collect suggestions so we can 
> get a clear picture of all needed changes.  Specifically about 
> getsetters, Stephen suggested that it could be done already, but for 
> now we'd also keep the old get/setStuff().  There are a few issues 
> like defining strict practices for arguments and return values, but 
> these can be solved later w/o much work, if you'd like to start soon 
> on this.
>
> For example, there's a mix of const dicts (ex: Window.Types, etc.) and 
> strings (ex: camera.type) being passed as arguments.  It'd be nice to 
> stick to just one alternative and we favor const dicts (open for 
> discussion, of course).
>
> Stephen may have something to add about our chat, not sure I 
> reproduced the results well here, but a suggestion then is that you 
> could add getsetters but w/o removing old get/setStuff for now.  It 
> should be trivial to do it at once soon.  Simultaneosly we can start 
> asking the community and feeding info to a wiki page and when you're 
> back with your experience on this we can set a plan.
>
> Ken Hughes wrote:
>
>> So any suggestions for things I can work on which everyone agrees needs
>> to be done, but doesn't change the existing API?
>>  (1) changing over to tp_getset
>>  (2) adding get/set of attributes in addition to x.getStuff()/ 
>> x.setStuff()
>>  (3) something totally different?
>>
>> I board my train Thursday morning Pacific time.... really would like to
>> have something else to do besides stare out the window, read Harry 
>> Potter, and drink.
>>
>> Ken
>>
>> _______________________________________________
>> Bf-python mailing list
>> Bf-python at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-python
>>
>>
>
>




More information about the Bf-python mailing list