=ID Properties Python Doc Update=

The epydocs are now updated to have idproperties;
all the modules that have bindings for ID properties
now has docs for them.  E.g Materials have a .properties
members, Image, Texture, Scene, Object, NMEsh, and Mesh.

I realized that .properties was already taken in
Objects, so I renamed it to .idproperties.  There was
also a nasty little problem with an example inside
Object.getType; the entire example was being pasted inside
the return field.  I fixed it by just moving the return
definition to after the example, like it should be.
This commit is contained in:
2006-11-20 11:07:56 +00:00
parent a5a83ecd10
commit 19a4f41172
9 changed files with 66 additions and 17 deletions

View File

@@ -1,16 +1,25 @@
class IDProperty:
"""
The IDProperty wrapper type
===========================
@ivar name: the name of the property
@ivar type: the property type (is read-only)
@ivar data: the property's data.
The IDProperty Type
===================
@ivar name: The name of the property
@type name: string
@ivar type: The property type (is read-only)
@type type: int
@ivar data: The property's data. This data can be of several forms, depending on the
ID property type:
1. For arrays, data implements the [] and allows editing of the array.
2. For groups, data allows iteration through the group, and access using the []
operator (but note that you can access a group that way through the parent IDProperty too).
See L{IDGroup<IDGroup>}.
3. For strings/ints/floats, data just holds the value and can be freely modified.
"""
class IDGroup:
"""
The IDGroup wrapper type
========================
The IDGroup Type
================
This type supports both iteration and the []
operator to get child ID properties.
@@ -20,12 +29,14 @@ class IDGroup:
group['a float!'] = 0.0
group['an int!'] = 0
group['a string!'] = "hi!"
group['an array!'] = [0, 0, 1.0, 0] #note that any floats in the list
#makes the whole list a float array.
group['an array!'] = [0, 0, 1.0, 0]
group['a subgroup!] = {"float": 0.0, "an int": 1.0, "an array": [1, 2], \
"another subgroup": {"a": 0.0, "str": "bleh"}}
you also do del group['item']
Note that for arrays, the array type defaults to int unless a float is found
while scanning the template list; if any floats are found, then the whole
array is float.
"""
def newProperty(type, name, array_type="Float", val=""):
@@ -48,8 +59,8 @@ class IDGroup:
class IDArray:
"""
The IDArray wrapper type
========================
The IDArray Type
================
@ivar type: returns the type of the array, can be either IDP_Int or IDP_Float
"""