Recalculate Lighting in Editor via Python

I am working on a script that does some faked terrain erosion within the editor.

However, I noticed that Blender.Redraw() does not recalculate lighting in the editor. As an example, I can start with a flat grid and programmatically lift vertices to form a mountain, but the entire mountain remains the same shade of grey regardless of each face’s normal.

I have the same problem in all lighting modes when the mesh is set to smooth.

Entering and exiting edit mode seems to invoke lighting recalculation, but is there a more elegant solution?

Thanks for reading!

In the Mesh-Module:


…recalculates the vertex normals from face normals - needed for smooth shading.