ddg.visualization.blender.camera module

ddg.visualization.blender.camera.camera(name='Camera', type_='PERSP', location=(0.0, 0.0, 0.0), collection=None)[source]

Add a camera.

Parameters:
namestr (default=’Camera’)

Name of the created camera.

type_str (default=’PERSP’)

Type of the camera, ‘PERSP’, ‘ORTHO’ or ‘PANO’.

locationsequence of 3 floats (default=(0.0, 0.0, 0.0))

Location of the camera.

collectionbpy.types.collection, default=None

Collection to link camera to, if the parameter is not given or set to None the camera gets linked to bpy.context.scene.collection.

Returns:
bpy.types.Object
ddg.visualization.blender.camera.look_at_point(bobj, point, world_up=(0.0, 0.0, 1.0), distance=None)[source]

Rotates camera such that it looks at the given point.

See ddg.visualization.blender.object.look_at_point for full documentation.

Parameters:
bobj: bpy.types.Object

Blender object to align.

pointsequence of 3 floats

Point of reference to turn object.

world_upsequence of 3 floats (default=(0.0, 0.0, 1.0))

Where the up direction should end up.

distancefloat (default=None)

Distance the object should have from the point.

ddg.visualization.blender.camera.clear(cameras=None, do_unlink=True)[source]

Delete all given cameras.

Parameters:
camerasIterable of bpy.type.Camera (default=None)

Cameras to be deleted. If the argument is not provided or None all cameras will be deleted.

do_unlinkbool (default=True)

Unlink cameras from their scenes, if needed, before deleting them.

ddg.visualization.blender.camera.set_background_image(camera_bobj, image_path)[source]

Add a background image to the camera.

The background image can be used as reference in the camera view but it won’t appear in the renders.

Parameters:
camera_bobjbpy.types.Object with a bpy.types.Camera as data

Camera object to which the image will be added.

image_pathstr

Path to the image.

ddg.visualization.blender.camera.set_background_movieclip(camera_bobj, movieclip_path)[source]

Add a background movieclip to the camera.

The background movieclip can be used as reference in the camera view but it won’t appear in the renders.

Parameters:
camera_bobjbpy.types.Object with a bpy.types.Camera as data

Camera object to which the movieclip will be added.

image_pathstr

Path to the movieclip.