Blender Git Commit Log

Git Commits -> Revision 578950c

Revision 578950c by Campbell Barton (master)
November 16, 2009, 19:03 (GMT)
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"]

Commit Details:

Full Hash: 578950c97724d2869f1fa7959b39a260cd723717
SVN Revision: 24592
Parent Commit: 66dfaab
Lines Changed: +149, -44

4 Modified Paths:

/source/blender/makesrna/intern/rna_access.c (+6, -0) (Diff)
/source/blender/makesrna/RNA_access.h (+2, -0) (Diff)
/source/blender/python/intern/bpy_interface.c (+6, -5) (Diff)
/source/blender/python/intern/bpy_rna.c (+135, -39) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021