This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/python/intern
Campbell Barton 30dcada24d 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.
2009-06-30 12:52:16 +00:00
..
2.5
2009-06-18 19:25:58 +00:00
2009-04-01 12:43:07 +00:00
2009-06-05 12:48:58 +00:00
2009-06-05 12:48:58 +00:00
2009-06-30 12:52:16 +00:00
2009-06-18 19:51:22 +00:00
2008-11-29 13:36:08 +00:00
2009-06-20 13:53:14 +00:00
2009-06-14 12:53:47 +00:00
2009-06-23 00:09:26 +00:00