blendersynth.blender.light
- class blendersynth.blender.light.Light(light)[source]
Light object, for managing lights in the scene
- animate_path(frames=(0, 250), fracs=(0, 1))
Animate object along path.
- Parameters:
frames (
tuple) – tuple of keyframes to animate at - length Nfracs (
tuple) – tuple of fractions along path to animate at - length N
- property axes: ndarray
Return 3x3 rotation matrix (normalized) to represent axes
- property color
Color of light source
- classmethod create(light_type='POINT', name='Light', intensity=1.0, color=(1.0, 1.0, 1.0), location=(0, 0, 0))[source]
Create a new Light object
- Parameters:
light_type (
str) – Type of light to create (seelight_types)name (
str) – Name of lightintensity (
float) – Intensity of lightcolor (
Union[mathutils.Vector,ndarray,List,Tuple]) – Color of lightlocation (
Union[mathutils.Vector,ndarray,List,Tuple]) – Location of light
- Returns:
Lightobject
- property energy
Energy of light source
- follow_path(path, zero=True, animate=True, frames=(0, 250), fracs=(0, 1))
Follow path, with optional animation setting.
- Parameters:
path (
Curve) – Curve objectzero (
bool) – If True, set camera location to (0, 0, 0) [aligns camera with path]animate (
bool) – If True, animate camera along pathframes (
tuple) – tuple of keyframes to animate at - length Nfracs (
tuple) – tuple of fractions along path to animate at - length N
- classmethod from_scene(key)[source]
Create object from scene key
- Parameters:
key – Key of object in scene
- Returns:
Lightobject
- light_types = ['POINT', 'SUN', 'SPOT', 'AREA']
List of available light types
- property location: mathutils.Vector
Location of object
- property matrix_world
Return world matrix of object(s).
- path_keyframe(frame, offset)
Set keyframe for camera path offset
- Parameters:
frame (
int) – Frame numberoffset (
float) – Offset fraction (0-1)
- remove()
Delete .obj from bpy.data if it exists
- render_visibility(value, frame=None)
Show/hide object in render
- Parameters:
value (
bool) – True to show, False to hideframe (
int) – Optional frame for animating
- rotate_by(rotation)
Add a rotation to the object. Must be in XYZ order, euler angles, radians.
- property rotation_euler: mathutils.Euler
Rotation in euler XYZ angles
- scale_by(scale)
Scale object
- set_color(value, frame=None)
Set color of light source
- Parameters:
value (
VectorLike) – RGB[A] colorframe (
int) – Optional frame for animating
- set_dimensions(dimensions, frame=None)
Set dimensions of object.
- Parameters:
dimensions (
VectorLikeOrScalar) – Dimensions to set. Either single value or 3 long vectorframe (
int) – Optional frame for animating
- set_energy(value, frame=None)
Set energy of light source
- Parameters:
value (
float) – Energy of light sourceframe (
int) – Optional frame for animating
- Returns:
- set_location(location, frame=None)
Set location of object.
- Parameters:
location (
VectorLike) – Location vector to setframe (
int) – Optional frame for animating
- set_rotation_euler(rotation, frame=None)
Set euler rotation of object.
- Parameters:
rotation (
VectorLike) – Rotation vectorframe (
int) – Optional frame for animating
- set_scale(scale, frame=None)
Set scale of object.
- Parameters:
scale (
VectorLikeOrScalar) – Scale to set. Either single value or 3 long vectorframe (
int) – Optional frame for animating
- track_to(obj)
Track to object.
- Parameters:
obj (
Union[BsynObject,Object]) – BsynObject or Blender Object to track to
- translate(translation)
Translate object
- untrack()
Remove track to constraint from object
- viewport_visibility(value, frame=None)
Show/hide object in viewport
- Parameters:
value (
bool) – True to show, False to hideframe (
int) – Optional frame for animating