I would like to use blender to visualize a scatter plot animation with data from a large 2D array, such as
a = np.array([[0, 0, 0],
[1, 2, 1],
[4, 0, 1]]).
Here a[i] describes the position of the i-th mesh/object. I wish to create these objects in the blender scene. The following code does that with cubes, but is too slow when a contains thousands of vectors.
import bpy
import numpy as np
a = np.array([[0, 0, 0],
[1, 2, 1],
[4, 0, 1]])
for pos_vec in a:
bpy.ops.mesh.primitive_cube_add(location=pos_vec)
How can I do this without looping in python or make it as fast as possible?