MCPcopy Create free account
hub / github.com/openai/point-e / normalize_scene

Function normalize_scene

point_e/evals/scripts/blender_script.py:97–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95
96
97def normalize_scene():
98 bbox_min, bbox_max = scene_bbox()
99 scale = 1 / max(bbox_max - bbox_min)
100
101 for obj in scene_root_objects():
102 obj.scale = obj.scale * scale
103
104 # Apply scale to matrix_world.
105 bpy.context.view_layer.update()
106
107 bbox_min, bbox_max = scene_bbox()
108 offset = -(bbox_min + bbox_max) / 2
109 for obj in scene_root_objects():
110 obj.matrix_world.translation += offset
111
112 bpy.ops.object.select_all(action="DESELECT")
113
114
115def create_camera():

Callers 1

save_rendering_datasetFunction · 0.85

Calls 2

scene_bboxFunction · 0.85
scene_root_objectsFunction · 0.85

Tested by

no test coverage detected