| 106 | ########################################################################################## |
| 107 | |
| 108 | def loadFile(name): |
| 109 | # load standard json file |
| 110 | if os.path.isfile(name): |
| 111 | with open(name) as file: |
| 112 | data = json.load(file) |
| 113 | # load file chunks if too big |
| 114 | elif os.path.isdir(name.split(".")[0]): |
| 115 | data = {} |
| 116 | chunks = glob.glob('{dir}/{dir}_*.{ext}'.format(dir=name.split(".")[0], ext=name.split(".")[1])) |
| 117 | for chunk in chunks: |
| 118 | with open(chunk) as file: |
| 119 | data.update(json.load(file)) |
| 120 | else: |
| 121 | raise Exception("Can't find {}".format(name)) |
| 122 | return data |
| 123 | |
| 124 | |
| 125 | # Load scene graphs |