Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-09-18 09:20:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-18 09:20:43 +0400
commitb6631b8be74070562b4eb2c4230c7b6ffab92f4b (patch)
treef4158695369100f72999d383cc860df9603245ac /doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py
parentdc4cded2c22656828499831f13471506ed59fc0a (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.py11
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)
+