(direction, camera_dist=2.0)
| 121 | |
| 122 | |
| 123 | def set_camera(direction, camera_dist=2.0): |
| 124 | camera_pos = -camera_dist * direction |
| 125 | bpy.context.scene.camera.location = camera_pos |
| 126 | |
| 127 | # https://blender.stackexchange.com/questions/5210/pointing-the-camera-in-a-particular-direction-programmatically |
| 128 | rot_quat = direction.to_track_quat("-Z", "Y") |
| 129 | bpy.context.scene.camera.rotation_euler = rot_quat.to_euler() |
| 130 | |
| 131 | bpy.context.view_layer.update() |
| 132 | |
| 133 | |
| 134 | def randomize_camera(camera_dist=2.0): |
no outgoing calls
no test coverage detected