about summary refs log tree commit diff
path: root/makeblend/boxes.py
diff options
context:
space:
mode:
Diffstat (limited to 'makeblend/boxes.py')
-rwxr-xr-xmakeblend/boxes.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/makeblend/boxes.py b/makeblend/boxes.py
new file mode 100755
index 0000000..e6ef521
--- /dev/null
+++ b/makeblend/boxes.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])