~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Only works for 'basic type' properties (bool, int and float)!
 
3
Multi-dimensional arrays (like array of vectors) will be flattened into seq.
 
4
"""
 
5
 
 
6
collection.foreach_get(attr, some_seq)
 
7
 
 
8
# Python equivalent
 
9
for i in range(len(seq)):
 
10
    some_seq[i] = getattr(collection[i], attr)
 
11