diff options
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) + |