show_actor

Light.show_actor()

Show an actor for a spotlight that depicts the geometry of the beam.

For a directional light or a positional light with cone_angle of at least 90 degrees the method doesn’t do anything. If the light is changed so that it becomes a spotlight, this method has to be called again for the actor to show. To hide the actor see hide_actor().

Examples

Create a scene containing a cube lit with a cyan spotlight and visualize the light using an actor.

>>> import pyvista as pv
>>> plotter = pv.Plotter()
>>> _ = plotter.add_mesh(pv.Cube(), color='white')
>>> for light in plotter.renderer.lights:
...     light.intensity /= 5
...
>>> spotlight = pv.Light(position=(-1, 1, 1), color='cyan')
>>> spotlight.positional = True
>>> spotlight.cone_angle = 20
>>> spotlight.intensity = 10
>>> spotlight.exponent = 40
>>> spotlight.show_actor()
>>> plotter.add_light(spotlight)
>>> plotter.show()
../../../_images/pyvista-Light-show_actor-1_00_00.png