Page MenuHome

Fix T61286: Viewport grid units not visible
Needs ReviewPublic

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



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

rB Blender
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.Feb 11 2019, 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.Feb 11 2019, 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"
"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.