Skip to content

Instantly share code, notes, and snippets.

Created Aug 11, 2018
What would you like to do?
render `numpy` voxels in Blender
import bpy
import numpy as np
objs =
scn = bpy.context.scene
scene_objs = [
# objs['sand'],
# objs['grass'],
# objs['water'],
voxel_data = np.load('/home/u/p/cat_1st_demo/render_bendich/_cartesian_model.npy').astype('int')
for x in range(voxel_data.shape[0]):
for y in range(voxel_data.shape[1]):
for z in range(voxel_data.shape[2]):
obj = scene_objs[voxel_data[x,y,z]].copy()
obj.location = (x*2.1, y*2.1, z*2.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment