Custom non-square viewport grids

I am making some equilateral triangle/hex grid tiles in this style:

In order to help with creating the girds, I had to make creative use of vertex snapping to assemble tessellated hexagon mesh, and write a script to bisect the faces to create an additional equilateral triangle grid.

This works well enough for the moment, but I would really like to make a plugin which replaces the normal 3D viewport grid with a dual hexagon/triangle grid, with snapping support.

I looked at this plugin:

But this plugin does not seem to implement a custom overlay.

I am new to blender’s plugin api, but comfortable with C++ and graphics programming.

Would someone be able to point me in the right direction for implementing a custom viewport grid?

Edit:

I have found the following documentation:

https://docs.blender.org/api/current/gpu.html

Which I think should get me most of the way there, which leaves the question of snapping, does the blender plugin API have any way to create custom snapping targets?

This isn’t really about contributing to Blender itself, so I’m not sure this is the best place to chat about it, but the quick answer is no - the API doesn’t allow you to create custom snapping targets that will work with all the built-in transforms. But, you can create a new transform operator or tool that snaps to your custom grid.

1 Like