about summary refs log tree commit diff
path: root/makeblend/boxes.py
blob: e6ef521362176df02ca18988b34f550f8bf813cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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])