diff options
author | hanemile <hanemile@protonmail.com> | 2018-12-24 22:54:04 +0100 |
---|---|---|
committer | hanemile <hanemile@protonmail.com> | 2018-12-24 22:54:04 +0100 |
commit | 8ca97c4e416d3bf32ab9caf54d738d699fc47eb1 (patch) | |
tree | c78530b551c8f355583fbbba1068e1041363857a /makeblend/build.py | |
parent | 501adaa4dc7f5542dfc93b7c61cbd57c3fbc0c8f (diff) |
cron commit
Diffstat (limited to 'makeblend/build.py')
-rw-r--r-- | makeblend/build.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/makeblend/build.py b/makeblend/build.py new file mode 100644 index 0000000..e6ef521 --- /dev/null +++ b/makeblend/build.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import sys +import json +import bpy + +def addPlane(data): + + if None in data["Quadrants"]: + x = data["boundary"]["Center"]["X"] + y = data["boundary"]["Center"]["Y"] + w = data["boundary"]["Width"] + + bpy.ops.mesh.primitive_plane_add(size=w, view_align=False, enter_editmode=False, location=(x, y, 0)) + + for subtree in data["Quadrants"]: + if subtree != None: + addPlane(subtree) + +with open("2500.json") as f: + data = json.load(f) + + addPlane(data[0]["Quadrants"][0]) |