ddg.visualization.blender.light module

ddg.visualization.blender.light.light(name='Light', type_='SUN', location=(0.0, 0.0, 0.0), collection=None, color=(1.0, 1.0, 1.0), specular=1.0, energy=10.0)[source]

Add a light.

Parameters:
namestr (default=’Light’)

Name of the created light

type_str (default=’SUN’)

Type of the light, ‘POINT’, ‘SUN’, ‘SPOT’ or ‘AREA’

locationIterable of three floats (default=(0., 0., 0.))

Location of the light.

collectionbpy.types.collection (default=None)

Collection to link light to. If the parameter is not given or set to None the light gets linked to bpy.context.scene.collection.

colorIterable of three floats (default=(1.,1.,1.))

RGB color of the light.

specularfloat (default=1.0)

Specular value of the light in the illumination model.

energy: float (default=10.0)

Energy of the light in Watts.

Returns:
bpy.types.Object
ddg.visualization.blender.light.look_at_point(bobj, point, world_up=(0, 0, 1), distance=None)[source]

Rotates light so that it points toward a given point.

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

Parameters:
bobjbpy.types.Object

Blenders object to move.

pointiterable of 3 floats

Point of reference to turn object.

world_upiterable of 3 floats (default=(0,0,1))

Where the up direction should end up.

distancefloat (default=None)

Distance the object should have from the point.

ddg.visualization.blender.light.clear(lights=None, do_unlink=True)[source]

Delete all given lights.

Parameters:
lightsIterable of bpy.type.Light (default=None)

Lights to be deleted. If the argument is not provided or None all lights will be deleted.

do_unlinkbool (default=True)

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