[Bf-python] tp_getset update

Yehoshua Sapir yasapir at gmail.com
Thu Aug 11 07:50:21 CEST 2005


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
 |
 |  addScriptLink(...)
 |      (text, evt) - Add a new object scriptlink.
 |      (text) - string: an existing Blender Text name;
 |      (evt) string: FrameChanged, Redraw or Render.
 |
 |  buildParts(...)
 |      Recalcs particle system (if any)
 |
 |  clearIpo(...)
 |      () - Unlink ipo from this object
 |
 |  clearScriptLinks(...)
 |      () - Delete all scriptlinks from this object.
 |      ([s1<,s2,s3...>]) - Delete specified scriptlinks from this object.
 |
 |  clearTrack(...)
 |      Make this object not track another anymore. Optionally specify:
 |      mode
 |              2: Keep object transform
 |      fast
 |              >0: Don't update scene hierarchy (faster)
 |
 |  clrParent(...)
 |      Clears parent object. Optionally specify:
 |      mode
 |              nonzero: Keep object transform
 |      fast
 |              >0: Don't update scene hierarchy (faster)
 |
 |  copyAllPropertiesTo(...)
 |      () - copy all properties from this object to another object
 |
(and so on)



More information about the Bf-python mailing list