(path)
| 428 | |
| 429 | |
| 430 | def write_camera_metadata(path): |
| 431 | x_fov, y_fov = scene_fov() |
| 432 | bbox_min, bbox_max = scene_bbox() |
| 433 | matrix = bpy.context.scene.camera.matrix_world |
| 434 | with open(path, "w") as f: |
| 435 | json.dump( |
| 436 | dict( |
| 437 | format_version=FORMAT_VERSION, |
| 438 | max_depth=MAX_DEPTH, |
| 439 | bbox=[list(bbox_min), list(bbox_max)], |
| 440 | origin=list(matrix.col[3])[:3], |
| 441 | x_fov=x_fov, |
| 442 | y_fov=y_fov, |
| 443 | x=list(matrix.col[0])[:3], |
| 444 | y=list(-matrix.col[1])[:3], |
| 445 | z=list(-matrix.col[2])[:3], |
| 446 | ), |
| 447 | f, |
| 448 | ) |
| 449 | |
| 450 | |
| 451 | def save_rendering_dataset( |
no test coverage detected