pyvista.Plotter.remove_all_lights

pyvista.Plotter.remove_all_lights#

Plotter.remove_all_lights(only_active: bool = False) None[source]#

Remove all lights from the scene.

Parameters:
only_activebool, default: False

If True, only remove lights from the active renderer. The default is that lights are stripped from every renderer.

Examples

Create a plotter and remove all lights after initialization. Note how the mesh rendered is completely flat

>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> pl.remove_all_lights()
>>> pl.renderer.lights
[]
>>> _ = pl.add_mesh(pv.Sphere(), show_edges=True)
>>> pl.show()
../../../_images/pyvista-Plotter-remove_all_lights-71ae0ec80c871022_00_00.png

Note how this differs from a plot with default lighting

>>> pv.Sphere().plot(show_edges=True, lighting=True)
../../../_images/pyvista-Plotter-remove_all_lights-71ae0ec80c871022_01_00.png