INNER CODE UNIT · Python
randomize_camera
VITA-Group/Diffusion4D · rendering/blender.py:141
def randomize_camera(camera_dist=2.0,Direction_type='front',az_front_vector=None):
direction = random_unit_vector()
set_camera(direction, camera_dist=camera_dist,Direction_type=Direction_type,az_front_vector=az_front_vector)
def _set_camera_at_size(i: int, scale: float = 1.5) -> bpy.types.Object:
"""Debugging function to set the camera on the 6 faces of a cube.
Args:
i (int): Index of the face of the cube.
scale (float, optional): Scale of the cube. Defaults to 1.5.
Returns:
bpy.types.Object: The camera object.
"""
if i == 0:
x, y, z = scale, 0, 0