Last active
January 7, 2023 11:02
-
-
Save joshua-taylor/79e2d8e010c7314233b14cc45c994826 to your computer and use it in GitHub Desktop.
How to get started with data viz and Blender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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