Skip to content

Instantly share code, notes, and snippets.

@joshua-taylor
Last active January 7, 2023 11:02
Show Gist options
  • Save joshua-taylor/79e2d8e010c7314233b14cc45c994826 to your computer and use it in GitHub Desktop.
Save joshua-taylor/79e2d8e010c7314233b14cc45c994826 to your computer and use it in GitHub Desktop.
How to get started with data viz and Blender
import bpy
#Add a light:
bpy.ops.object.light_add(type='AREA', align='WORLD', location=(2.8, -8, 14),)
data = [1,5,2,6]
barDist = 1.2
#Add a some cubes to create a bar chart from the data:
for row,bar in enumerate(data):
bpy.ops.mesh.primitive_cube_add(size=1, enter_editmode=False, align='WORLD',
location=(barDist*row, 3, -0.5),
scale=(1, 1, 0.2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment