this patch adds another snap element type (GRID, which is actually already used in the node editor for snapping). Instead of snapping in increments relative to the current location, it will snap to increments based on the origin (0, 0, 0) (absolute).
This allows is for aligning objects on the grid more easily. This is especially useful for game development with modular designs.
I implemented the functionality in the applyGridIncrement function.
As to the problems of the current implementation:
I tried to respect the transform constrains but for now only constraining to the global transform orientation will make much sense since the goal of this snapping type is to absolutely snap to the global grid.
Another problem is the UI. Here is what it looks like right now:
As you can see GRID and INCREMENT share the same icon
Either a new icon needs be designed or my proposal would be to add a checkbox to toggle between absolute and relative/incremental grid snapping.
The other problem is as initially mentioned that I reused the grid snap element currently used by the node editor.