[Bf-python] tp_getset update
Yehoshua Sapir
yasapir at gmail.com
Thu Aug 11 16:40:25 CEST 2005
Ken Hughes wrote:
> Yehoshua Sapir wrote:
>
>> Ken Hughes wrote:
>>
>>> Yehoshua Sapir wrote:
>>>
>>>>
>>>>> (3) does anyone have an idea how the doc field in the
>>>>> tp_getset is
>>>>> accessed? For example:
>>>>>
>>>>> {"bias",
>>>>> (getter)Lamp_getBias, (setter)Lamp_setBias,
>>>>> "Lamp shadow map sampling bias",
>>>>> NULL},
>>>>>
>>>>> If I try "print lamp.bias.__doc__" I get a doc string explaining
>>>>> how to use a float (which is the type of "bias"). I haven't found
>>>>> anything in the Python docs which explain how to access this
>>>>> field; maybe it isn't implemented yet?
>>>>
>>>>
>>>>
>>>>
>>>> help(lamp) and help(lamp.bias) work.
>>>
>>>
>>>
>>>
>>> from:
>>>
>>> help(lamp)
>>> help(lamp.bias)
>>>
>>> I get:
>>>
>>> Help on Blender Lamp:
>>>
>>> [Lamp "Spot"]
>>>
>>> Help on float:
>>>
>>> 5.0
>>>
>>> ????
>>> Ken
>>> _______________________________________________
>>
>>
>>
>> from:
>>
>> import Blender
>> lamp = Blender.Object.Get('Lamp')
>> help(lamp)
>>
>> I get:
>>
>> Help on Blender Object object:
>>
>> class Blender Object(object)
>> | Methods defined here:
>> |
>> | __cmp__(...)
>> | x.__cmp__(y) <==> cmp(x,y)
>> |
>> | __repr__(...)
>> | x.__repr__() <==> repr(x)
>> |
>> | addProperty(...)
>> | () - Add a property to this object
>> (and so on)
>
>
> With latest CVS and Python 2.3, I get:
>
> Help on Blender Object:
>
> [Object "Lamp"]
>
> Ken
>
Oh. I'm using 2.4 ... That the code works in 2.3 must mean there's some
other way you're supposed to be able to access them... No idea what that is.
More information about the Bf-python
mailing list