HDRI Skylight Manager

Published: March 1, 2024

Last Edited: October 10, 2024


Tools used:

Blender
Python

About the Plugin

The HDRI Skylight Manager is a plugin for Blender that I made, providing a quick and easy way to place and align lights in relation to an HDRI environment.

A GIF showing the plugin in action.
A GIF showing the plugin in action.

Those familiar with Marmoset Toolbag are probably disappointed to see that Eevee lacks a way to position directional lights in relation to the current HDRI environment. Making setting up quick renders in Blender’s Eevee renderer a bit harder.

The Skylight Manager allows the user to quickly set up HDRI Environment maps and quickly add “skylights”, which are simply sun lights that automatically derive their positional, rotational, and colour values from a controller and reference image.

How it Works

A snippet of code from the plugin
A snippet of code from the plugin

The plug-in creates a reference image plane with one or more empty objects attached to it. The empties are constrained to the surface of the plane, so we can easily convert their relative positions to XY coordinates. Then using some maths, we can convert the XY coordinates of the empties into yaw and pitch angles which we can feed to the corresponding sun lights.

The plugin showcase scene with different lighting setups. The lighting was all setup with the HDRI Skylight Manager.
The plugin showcase scene with different lighting setups. The lighting was all setup with the HDRI Skylight Manager.