Lighting#

class ansys.stk.core.graphics.Lighting#

Lighting in the 3D scene.

Overview#

enabled

Get or set whether or not lighting is enabled.

ambient_intensity

Get or set the ambient intensity throughout the scene.

diffuse_intensity

Get or set the diffuse intensity from the sun.

night_lights_intensity

Get or set the overall brightness for the night light’s image overlay, night overlay.

Examples#

Control the Lighting of the 3D scene

# Scenario scenario: Scenario object
# Modify the lighting levels
manager = scenario.scene_manager
lighting = manager.scenes.item(0).lighting
lighting.ambient_intensity = 0.20  # Percent
lighting.diffuse_intensity = 4  # Percent
lighting.night_lights_intensity = 5  # Percent

Set Vehicle Lighting Properties

# Satellite satellite: Satellite object
lighting = satellite.graphics.lighting
# Settings for vehicle in sunlight
sunlight = lighting.sunlight
sunlight.visible = True
sunlight.color = Colors.Yellow
sunlight.line_width = LineWidth.WIDTH4
# Settings for vehicle in penumbra
penumbra = lighting.penumbra
penumbra.visible = True
penumbra.color = Colors.Orange
penumbra.line_width = LineWidth.WIDTH3
# Settings for vehicle in umbra
umbra = lighting.umbra
umbra.visible = True
umbra.color = Colors.Red
umbra.line_width = LineWidth.WIDTH2

Import detail#

from ansys.stk.core.graphics import Lighting

Property detail#

property Lighting.enabled: bool#

Get or set whether or not lighting is enabled.

property Lighting.ambient_intensity: float#

Get or set the ambient intensity throughout the scene.

property Lighting.diffuse_intensity: float#

Get or set the diffuse intensity from the sun.

property Lighting.night_lights_intensity: float#

Get or set the overall brightness for the night light’s image overlay, night overlay.