[Bf-python] Attribute casing
Ken Hughes
khughes at pacific.edu
Thu Aug 18 20:15:37 CEST 2005
Yehoshua Sapir wrote:
> Gilbert, Joseph wrote:
>
>> Yes correctNorMap sounds like it should be correct for the texture
>> button. Col, Nor, etc are part of a bit toggle regarding mtex->mapto.
>> These should be module constants. Col, Nor, Var are attributes that relate to
>> mtex->colFac, mtex->norFac, and mtex->varFac attributes of the Mtex
>> struct.
>>
> My patch avoids exposing the bitfield to the Python scripter and instead
> provides Python Booleans. (For example, there's a correctNorMap
> attribute that gives you True or False rather than having to do math
> with some bitfield and a constant.) The interface is a lot nicer IMO.
> Anyway, because of this, I have separate variables for the map to buttons.
I think this is a good approach to making the BPython API resemble the
UI as much as possible. In fact, I was prepping for "tp_getset-ing"
sceneRender.c (Blender.Scene.RenderData) and noticed that Joseph had
done this for the myriad of button in the Scene UI. (Plus he had a nice
generic bitfield manipulation procedure which I modified slightly and
put into gen_utils.c) So while I'm adding new atributes to modules, can
I get a consensus that I also implement enable/disable attribures for
bitfield access?
Ken
More information about the Bf-python
mailing list