[Bf-funboard] Access to internals struct's from python API

Ильдар Ильдар
Sun May 1 10:01:40 CEST 2016


We can leverage strongest part of python — numpy and all scientific
python stack if we provide access to internal data structures.

Inside python we can use struct module or numpy's fromstring
vertices = np.fromstring(bpy.give_my_some_bytes(), dtype=[
	('x', np.float64),
	('y', np.float64),
	('z', np.float64)
])
Both this way much faster then iterating over numbers inside python.

Binary structures and numpy will allow to directly pass data to
compiled extensions or even use numba (python JIT compiler which
support OpenCL and CUDA) and Cython to speedup python code.

-- 
===8@))-\-<
http://akhil.ru



More information about the Bf-funboard mailing list