diff options
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]) |