Light Painter now has Gobos!

And a breakthrough in Blender unit testing

Unit Tests

For a few months, an issue has been on my mind. I wanted to implement basic unit tests for Light Painter, just to prevent accidental regression and (re)introducing bugs.

I used blender-addon-tester for my nView add-on, but it’s delicate and requires some manual setup. I needed something simpler and more flexible.

But I found a solution.

Did you know you can download Blender as a Python module? Instead of running as a standalone app, developers can import Blender into any Python script and access Blender’s features.

What does this mean for unit tests? It means that after importing Blender into my test scripts, I can install and run the add-on as if it was in the app!

The great thing is it doesn’t require extra dependencies or setup - ensuring that my testing is true to a real Blender environment.

Once I got this working in Light Painter, I replaced nView’s testing environment as well. Testing gives real peace of mind to developers, and hence for users too.

Gobos (light shadows or textures)

Gobos is something I wanted for Light Painter for a little while. Think of them as textures for lights in your scene. It allows you to have shadows of trees or buildings that aren’t actually there - saving render time.

But I knew this feature could become a rabbit hole of parameters and settings. I wanted it to be simple. Like the rest of the add-on, I wanted it to only give a great starting point. Then users can tweak and adjust from there.

So, I added a parameter for the texture node type, and two operators to add and remove. Two buttons and one dropdown in the lamp properties.

While the texture type would ideally be an operator property, unfortunately operators run from the property panel don’t reveal a redo panel after running.

And that’s it for the week. Check out the code for these features and the latest releases on the Light Painter repository. Happy Blend-ing!