diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-06-30 16:52:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-06-30 16:52:16 +0400 |
commit | 30dcada24d1820e5aed4e1a671543e040918e910 (patch) | |
tree | fac786d2adc97ac939e35d4dd9a94b1f526021d8 /projectfiles_vc9 | |
parent | 0c14be3b5820d7130a281e95da664753a0ff2793 (diff) |
python access to RNA arrays.
coords = array.array('f', [0.0]) * len(me.verts) * 3
m.verts.foreach_get('co', coords)
the reverse works with set also.
currently works for python buffers or sequences (slower)
Quick speed test with 1,179,654 verts.
*foreach_get*
list 0.377
array 0.032
py 10.29
*foreach_set*
list 0.184
array 0.028
py 9.79
where python was done like this...
----
i= 0
for v in m.verts:
co = v.co
l[i] = co[0]; l[i+1] = co[0]; l[i+2] = co[0]
i+=3
----
some of the error checking here needs to be cleaned up to account for different invalid bad inputs.
Diffstat (limited to 'projectfiles_vc9')
0 files changed, 0 insertions, 0 deletions