unreal.LightComponent

class unreal.LightComponent(outer=None, name='None')

Bases: unreal.LightComponentBase

Light Component

C++ Source:

  • Module: Engine

  • File: LightComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • absolute_location (bool): [Read-Write] If RelativeLocation should be considered relative to the world, rather than the parent

  • absolute_rotation (bool): [Read-Write] If RelativeRotation should be considered relative to the world, rather than the parent

  • absolute_scale (bool): [Read-Write] If RelativeScale3D should be considered relative to the world, rather than the parent

  • affect_dynamic_indirect_lighting (bool): [Read-Write] Whether the light should be injected into the Light Propagation Volume

  • affect_global_illumination (bool): [Read-Write] Whether the light affects global illumination, when ray-traced global illumination is enabled.

  • affect_reflection (bool): [Read-Write] Whether the light affects objects in reflections, when ray-traced reflection is enabled.

  • affect_translucent_lighting (bool): [Read-Write] Whether the light affects translucency or not. Disabling this can save GPU time when there are many small lights.

  • affects_world (bool): [Read-Write] Whether the light can affect the world, or whether it is disabled. A disabled light will not contribute to the scene in any way. This setting cannot be changed at runtime and unbuilds lighting when changed. Setting this to false has the same effect as deleting the light, so it is useful for non-destructive experiments.

  • asset_user_data (Array(AssetUserData)): [Read-Write] Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • bloom_max_brightness (float): [Read-Write] After exposure is applied, scene color brightness larger than BloomMaxBrightness will be rescaled down to BloomMaxBrightness.

  • bloom_scale (float): [Read-Write] Scales the additive color.

  • bloom_threshold (float): [Read-Write] Scene color must be larger than this to create bloom in the light shafts.

  • bloom_tint (Color): [Read-Write] Multiplies against scene color to create the bloom color.

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • cast_deep_shadow (bool): [Read-Write] Whether the light should cast high quality hair-strands self-shadowing. When this option is enabled, an extra GPU cost for this light.

  • cast_dynamic_shadows (bool): [Read-Write] Whether the light should cast shadows from dynamic objects. Also requires Cast Shadows to be set to True.

  • cast_raytraced_shadow (bool): [Read-Write] Whether the light shadows are computed with shadow-mapping or ray-tracing (when available).

  • cast_shadows (bool): [Read-Write] Whether the light should cast any shadows.

  • cast_shadows_from_cinematic_objects_only (bool): [Read-Write] Whether the light should only cast shadows from components marked as bCastCinematicShadows. This is useful for setting up cinematic Movable spotlights aimed at characters and avoiding the shadow depth rendering costs of the background. Note: this only works with dynamic shadow maps, not with static shadowing or Ray Traced Distance Field shadows.

  • cast_static_shadows (bool): [Read-Write] Whether the light should cast shadows from static objects. Also requires Cast Shadows to be set to True.

  • cast_translucent_shadows (bool): [Read-Write] Whether the light is allowed to cast dynamic shadows from translucency.

  • cast_volumetric_shadow (bool): [Read-Write] Whether the light shadows volumetric fog. Disabling this can save GPU time.

  • component_tags (Array(Name)): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • contact_shadow_length (float): [Read-Write] Length of screen space ray trace for sharp contact shadows. Zero is disabled.

  • contact_shadow_length_in_ws (bool): [Read-Write] Where Length of screen space ray trace for sharp contact shadows is in world space units or in screen space units.

  • deep_shadow_layer_distribution (float): [Read-Write] Change the deep shadow layers distribution 0:linear distribution (uniform layer distribution), 1:exponential (more details on near small details).

  • detail_mode (DetailMode): [Read-Write] If detail mode is >= system detail mode, primitive won’t be rendered.

  • disabled_brightness (float): [Read-Write] Brightness factor applied to the light when the light function is specified but disabled, for example in scene captures that use SceneCapView_LitNoShadows. This should be set to the average brightness of the light function material’s emissive input, which should be between 0 and 1.

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • enable_light_shaft_bloom (bool): [Read-Write] Whether to render light shaft bloom from this light. For directional lights, the color around the light direction will be blurred radially and added back to the scene. for point lights, the color on pixels closer than the light’s SourceRadius will be blurred radially and added back to the scene.

  • force_cached_shadows_for_movable_primitives (bool): [Read-Write] Enables cached shadows for movable primitives for this light even if r.shadow.cachedshadowscastfrommovableprimitives is 0

  • hidden_in_game (bool): [Read-Write] Whether to hide the primitive in game, if the primitive is Visible.

  • ies_brightness_scale (float): [Read-Write] Global scale for IES brightness contribution. Only available when “Use IES Brightness” is selected, and a valid IES profile texture is set

  • ies_texture (TextureLightProfile): [Read-Write] IES texture (light profiles from real world measured data)

  • indirect_lighting_intensity (float): [Read-Write] Scales the indirect lighting contribution from this light. A value of 0 disables any GI from this light. Default is 1.

  • intensity (float): [Read-Write] Total energy that the light emits.

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • light_color (Color): [Read-Write] Filter color of the light. Note that this can change the light’s effective intensity.

  • light_function_fade_distance (float): [Read-Write] Distance at which the light function should be completely faded to DisabledBrightness. This is useful for hiding aliasing from light functions applied in the distance.

  • light_function_material (MaterialInterface): [Read-Write] The light function material to be applied to this light. Note that only non-lightmapped lights (UseDirectLightMap=False) can have a light function. Light functions are supported within VolumetricFog, but only for Directional, Point and Spot lights. Rect lights are not supported.

  • light_function_scale (Vector): [Read-Write] Scales the light function projection. X and Y scale in the directions perpendicular to the light’s direction, Z scales along the light direction.

  • lighting_channels (LightingChannels): [Read-Write] Channels that this light should affect. These channels only apply to opaque materials, direct lighting, and dynamic lighting and shadowing.

  • max_distance_fade_range (float): [Read-Write] Max Distance Fade Range

  • max_draw_distance (float): [Read-Write] Max Draw Distance

  • mobility (ComponentMobility): [Read-Write] How often this component is allowed to move, used to make various optimizations. Only safe to set in constructor.

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • physics_volume_changed_delegate (PhysicsVolumeChanged): [Read-Write] Delegate that will be called when PhysicsVolume has been changed *

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • ray_start_offset_depth_scale (float): [Read-Write] Controls how large of an offset ray traced shadows have from the receiving surface as the camera gets further away. This can be useful to hide self-shadowing artifacts from low resolution distance fields on huge static meshes.

  • relative_location (Vector): [Read-Write] Location of the component relative to its parent

  • relative_rotation (Rotator): [Read-Write] Rotation of the component relative to its parent

  • relative_scale3d (Vector): [Read-Write] Non-uniform scaling of the component relative to its parent. Note that scaling is always applied in local space (no shearing etc)

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • samples_per_pixel (int32): [Read-Write] Samples per pixel for ray tracing

  • shadow_bias (float): [Read-Write] Controls how accurate self shadowing of whole scene shadows from this light are. At 0, shadows will start at the their caster surface, but there will be many self shadowing artifacts. larger values, shadows will start further from their caster, and there won’t be self shadowing artifacts but object might appear to fly. around 0.5 seems to be a good tradeoff. This also affects the soft transition of shadows

  • shadow_resolution_scale (float): [Read-Write] Scales the resolution of shadowmaps used to shadow this light. By default shadowmap resolution is chosen based on screen size of the caster. Note: shadowmap resolution is still clamped by ‘r.Shadow.MaxResolution’

  • shadow_sharpen (float): [Read-Write] Amount to sharpen shadow filtering

  • shadow_slope_bias (float): [Read-Write] Controls how accurate self shadowing of whole scene shadows from this light are. This works in addition to shadow bias, by increasing the amount of bias depending on the slope of a surface. At 0, shadows will start at the their caster surface, but there will be many self shadowing artifacts. larger values, shadows will start further from their caster, and there won’t be self shadowing artifacts but object might appear to fly. around 0.5 seems to be a good tradeoff. This also affects the soft transition of shadows

  • should_update_physics_volume (bool): [Read-Write] Whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved. see: GetPhysicsVolume()

  • specular_scale (float): [Read-Write] Multiplier on specular highlights. Use only with great care! Any value besides 1 is not physical! Can be used to artistically remove highlights mimicking polarizing filters or photo touch up.

  • temperature (float): [Read-Write] Color temperature in Kelvin of the blackbody illuminant. White (D65) is 6500K.

  • transmission (bool): [Read-Write] Whether light from this light transmits through surfaces with subsurface scattering profiles. Requires light to be movable.

  • use_attach_parent_bound (bool): [Read-Write] If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together.

  • use_ies_brightness (bool): [Read-Write] true: take light brightness from IES profile, false: use the light brightness - the maximum light in one direction is used to define no masking. Use with InverseSquareFalloff. Will be disabled if a valid IES profile texture is not supplied.

  • use_ray_traced_distance_field_shadows (bool): [Read-Write] Whether to use ray traced distance field area shadows. The project setting bGenerateMeshDistanceFields must be enabled for this to have effect. Distance field shadows support area lights so they create soft shadows with sharp contacts. They have less aliasing artifacts than standard shadowmaps, but inherit all the limitations of distance field representations (only uniform scale, no deformation). These shadows have a low per-object cost (and don’t depend on triangle count) so they are effective for distant shadows from a dynamic sun.

  • use_temperature (bool): [Read-Write] false: use white (D65) as illuminant.

  • visible (bool): [Read-Write] Whether to completely draw the primitive; if false, the primitive is not drawn, does not cast a shadow.

  • volumetric_scattering_intensity (float): [Read-Write] Intensity of the volumetric scattering from this light. This scales Intensity and LightColor.

property affect_dynamic_indirect_lighting

[Read-Only] Whether the light should be injected into the Light Propagation Volume

Type

(bool)

property bloom_max_brightness

[Read-Only] After exposure is applied, scene color brightness larger than BloomMaxBrightness will be rescaled down to BloomMaxBrightness.

Type

(float)

property bloom_scale

[Read-Only] Scales the additive color.

Type

(float)

property bloom_threshold

[Read-Only] Scene color must be larger than this to create bloom in the light shafts.

Type

(float)

property bloom_tint

[Read-Only] Multiplies against scene color to create the bloom color.

Type

(Color)

property cast_shadows_from_cinematic_objects_only

[Read-Only] Whether the light should only cast shadows from components marked as bCastCinematicShadows. This is useful for setting up cinematic Movable spotlights aimed at characters and avoiding the shadow depth rendering costs of the background. Note: this only works with dynamic shadow maps, not with static shadowing or Ray Traced Distance Field shadows.

Type

(bool)

property cast_translucent_shadows

[Read-Only] Whether the light is allowed to cast dynamic shadows from translucency.

Type

(bool)

property contact_shadow_length

[Read-Write] Length of screen space ray trace for sharp contact shadows. Zero is disabled.

Type

(float)

property contact_shadow_length_in_ws

[Read-Write] Where Length of screen space ray trace for sharp contact shadows is in world space units or in screen space units.

Type

(bool)

property disabled_brightness

[Read-Only] Brightness factor applied to the light when the light function is specified but disabled, for example in scene captures that use SceneCapView_LitNoShadows. This should be set to the average brightness of the light function material’s emissive input, which should be between 0 and 1.

Type

(float)

property enable_light_shaft_bloom

[Read-Only] Whether to render light shaft bloom from this light. For directional lights, the color around the light direction will be blurred radially and added back to the scene. for point lights, the color on pixels closer than the light’s SourceRadius will be blurred radially and added back to the scene.

Type

(bool)

property force_cached_shadows_for_movable_primitives

[Read-Only] Enables cached shadows for movable primitives for this light even if r.shadow.cachedshadowscastfrommovableprimitives is 0

Type

(bool)

property ies_brightness_scale

[Read-Only] Global scale for IES brightness contribution. Only available when “Use IES Brightness” is selected, and a valid IES profile texture is set

Type

(float)

property ies_texture

[Read-Only] IES texture (light profiles from real world measured data)

Type

(TextureLightProfile)

property light_function_fade_distance

[Read-Only] Distance at which the light function should be completely faded to DisabledBrightness. This is useful for hiding aliasing from light functions applied in the distance.

Type

(float)

property light_function_material

[Read-Only] The light function material to be applied to this light. Note that only non-lightmapped lights (UseDirectLightMap=False) can have a light function. Light functions are supported within VolumetricFog, but only for Directional, Point and Spot lights. Rect lights are not supported.

Type

(MaterialInterface)

property light_function_scale

[Read-Only] Scales the light function projection. X and Y scale in the directions perpendicular to the light’s direction, Z scales along the light direction.

Type

(Vector)

property lighting_channels

[Read-Only] Channels that this light should affect. These channels only apply to opaque materials, direct lighting, and dynamic lighting and shadowing.

Type

(LightingChannels)

property ray_start_offset_depth_scale

[Read-Only] Controls how large of an offset ray traced shadows have from the receiving surface as the camera gets further away. This can be useful to hide self-shadowing artifacts from low resolution distance fields on huge static meshes.

Type

(float)

set_affect_dynamic_indirect_lighting(new_value)None

Set Affect Dynamic Indirect Lighting

Parameters

new_value (bool) –

set_affect_translucent_lighting(new_value)None

Set Affect Translucent Lighting

Parameters

new_value (bool) –

set_bloom_max_brightness(new_value)None

Set Bloom Max Brightness

Parameters

new_value (float) –

set_bloom_scale(new_value)None

Set Bloom Scale

Parameters

new_value (float) –

set_bloom_threshold(new_value)None

Set Bloom Threshold

Parameters

new_value (float) –

set_bloom_tint(new_value)None

Set Bloom Tint

Parameters

new_value (Color) –

set_brightness(new_intensity)

deprecated: ‘set_brightness’ was renamed to ‘set_intensity’.

set_enable_light_shaft_bloom(new_value)None

Set Enable Light Shaft Bloom

Parameters

new_value (bool) –

set_force_cached_shadows_for_movable_primitives(new_value)None

Set Force Cached Shadows for Movable Primitives

Parameters

new_value (bool) –

set_ies_brightness_scale(new_value)None

Set IESBrightness Scale

Parameters

new_value (float) –

set_ies_texture(new_value)None

Set IESTexture

Parameters

new_value (TextureLightProfile) –

set_indirect_lighting_intensity(new_intensity)None

Set Indirect Lighting Intensity

Parameters

new_intensity (float) –

set_intensity(new_intensity)None

Set intensity of the light

Parameters

new_intensity (float) –

set_light_color(new_light_color, srgb=True)None

Set color of the light

Parameters
set_light_function_disabled_brightness(new_value)None

Set Light Function Disabled Brightness

Parameters

new_value (float) –

set_light_function_fade_distance(new_light_function_fade_distance)None

Set Light Function Fade Distance

Parameters

new_light_function_fade_distance (float) –

set_light_function_material(new_light_function_material)None

Set Light Function Material

Parameters

new_light_function_material (MaterialInterface) –

set_light_function_scale(new_light_function_scale)None

Set Light Function Scale

Parameters

new_light_function_scale (Vector) –

set_lighting_channels(channel0, channel1, channel2)None

Set Lighting Channels

Parameters
  • channel0 (bool) –

  • channel1 (bool) –

  • channel2 (bool) –

set_shadow_bias(new_value)None

Set Shadow Bias

Parameters

new_value (float) –

set_shadow_slope_bias(new_value)None

Set Shadow Slope Bias

Parameters

new_value (float) –

set_specular_scale(new_value)None

Set Specular Scale

Parameters

new_value (float) –

set_temperature(new_temperature)None

Set Temperature

Parameters

new_temperature (float) –

set_transmission(new_value)None

Set Transmission

Parameters

new_value (bool) –

set_use_ies_brightness(new_value)None

Set Use IESBrightness

Parameters

new_value (bool) –

set_use_temperature(new_value)None

Set Use Temperature

Parameters

new_value (bool) –

set_volumetric_scattering_intensity(new_intensity)None

Set Volumetric Scattering Intensity

Parameters

new_intensity (float) –

property shadow_bias

[Read-Only] Controls how accurate self shadowing of whole scene shadows from this light are. At 0, shadows will start at the their caster surface, but there will be many self shadowing artifacts. larger values, shadows will start further from their caster, and there won’t be self shadowing artifacts but object might appear to fly. around 0.5 seems to be a good tradeoff. This also affects the soft transition of shadows

Type

(float)

property shadow_resolution_scale

[Read-Only] Scales the resolution of shadowmaps used to shadow this light. By default shadowmap resolution is chosen based on screen size of the caster. Note: shadowmap resolution is still clamped by ‘r.Shadow.MaxResolution’

Type

(float)

property shadow_sharpen

[Read-Only] Amount to sharpen shadow filtering

Type

(float)

property shadow_slope_bias

[Read-Only] Controls how accurate self shadowing of whole scene shadows from this light are. This works in addition to shadow bias, by increasing the amount of bias depending on the slope of a surface. At 0, shadows will start at the their caster surface, but there will be many self shadowing artifacts. larger values, shadows will start further from their caster, and there won’t be self shadowing artifacts but object might appear to fly. around 0.5 seems to be a good tradeoff. This also affects the soft transition of shadows

Type

(float)

property specular_scale

[Read-Only] Multiplier on specular highlights. Use only with great care! Any value besides 1 is not physical! Can be used to artistically remove highlights mimicking polarizing filters or photo touch up.

Type

(float)

property temperature

[Read-Only] Color temperature in Kelvin of the blackbody illuminant. White (D65) is 6500K.

Type

(float)

property use_ies_brightness

take light brightness from IES profile, false: use the light brightness - the maximum light in one direction is used to define no masking. Use with InverseSquareFalloff. Will be disabled if a valid IES profile texture is not supplied.

Type

(bool)

Type

[Read-Only] true

property use_ray_traced_distance_field_shadows

[Read-Only] Whether to use ray traced distance field area shadows. The project setting bGenerateMeshDistanceFields must be enabled for this to have effect. Distance field shadows support area lights so they create soft shadows with sharp contacts. They have less aliasing artifacts than standard shadowmaps, but inherit all the limitations of distance field representations (only uniform scale, no deformation). These shadows have a low per-object cost (and don’t depend on triangle count) so they are effective for distant shadows from a dynamic sun.

Type

(bool)

property use_temperature

use white (D65) as illuminant.

Type

(bool)

Type

[Read-Only] false