diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-18 09:20:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-18 09:20:43 +0400 |
commit | b6631b8be74070562b4eb2c4230c7b6ffab92f4b (patch) | |
tree | f4158695369100f72999d383cc860df9603245ac /doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py | |
parent | dc4cded2c22656828499831f13471506ed59fc0a (diff) |
fixes for python api docs.
also move foreach_get/set examples into their own py example files (prefer not to have example code built into blenders binary).
Diffstat (limited to 'doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py')
-rw-r--r-- | doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py new file mode 100644 index 00000000000..05163b332a9 --- /dev/null +++ b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py @@ -0,0 +1,11 @@ +""" +Only works for 'basic type' properties (bool, int and float)! +Multi-dimensional arrays (like array of vectors) will be flattened into seq. +""" + +collection.foreach_get(attr, some_seq) + +# Python equivalent +for i in range(len(seq)): + some_seq[i] = getattr(collection[i], attr) + |