Page MenuHome

Fix T61286: Viewport grid units not visible
Needs ReviewPublic

Authored by Germano Cavalcante (mano-wii) on Fri, Feb 8, 4:15 PM.

Details

Summary

The original code was commented on.
Unlike blender 2.79, the grid units are now displayed only when RV3D_VIEW_IS_AXIS.
The visible subdivisions in the grid are made by the GPU and depending on the pixel.
The code used here only mimics this behavior and adds a bit of overhead.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 2883
Build 2883: arc lint + arc unit

Event Timeline

Harbormaster completed remote builds in B2861: Diff 13560.
Campbell Barton (campbellbarton) requested changes to this revision.Mon, Feb 11, 6:26 AM

This ignores unit scale - which should be easy to fix.

However I'm not sure this is a good approach
it's not working well especially for Imperial.

See screenshot

This revision now requires changes to proceed.Mon, Feb 11, 6:26 AM

After analyzing I realized that the grid drawing and the unit levels in the imperial system (buImperialLenDef) doesn't match.
The drawing of the grid highlights 10 in 10. It's as if the units are:

"0.01 foot"
"0.1 foot"
"foot"
"10 feet"
...

I think it is important to resolve the drawing issue first :\

  • Use unit_scale to get a smooth transition between base_unit and drawing.

But this does not fix the problem of the units that are displayed.