ID property access from python for pose channels, bones and any ID objects.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 Nov 2009 19:03:40 +0000 (19:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 Nov 2009 19:03:40 +0000 (19:03 +0000)
commit578950c97724d2869f1fa7959b39a260cd723717
treecb7617ce9dde194ddd575961474cd40e8ac23b22
parent66dfaabb9dd385b5b29c0b91874d1a4755e6ffe0
ID property access from python for pose channels, bones and any ID objects.
The advantage with this is that global property definitions are not needed to add a property to an object.

to avoid confusion these are accessed like a dictionary (closely matching how the BGE accesses properties)

 ob["mySetting"] = 1.0

 bone["foo"] = {"one":1, "two":2.1, "three":"Three"}

 if "foo" in bone: print("prop found...")

At the moment these can also be accessed as attributes, will be changed shortly. eg.
 bone.foo == bone["foo"]
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_access.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c