View3D Grid: fix imperial grid drawing

This is a step to finish the D4325 and fix the T61286.
Currently the grid is highlighted in steps of 10 out of 10, which is wrong for the imperial units as seen in `buImperialLenDef`.
The idea of the code is to pass the steps of the grid already dimensioned as a uniform.

Another important thing to note is that subdivisions now only affect the grid without unity.
This matches the 2.7x Blender versions.

No performance loss (almost no gain too).

Reviewers: fclem

Subscribers: zlsa, rl.amorato

Differential Revision: https://developer.blender.org/D4379
This commit is contained in:
mano-wii
2019-08-19 11:49:07 -03:00
parent 3cbf246239
commit 4bf37bafc2
8 changed files with 133 additions and 77 deletions

View File

@@ -5354,6 +5354,8 @@ class VIEW3D_PT_overlay_guides(Panel):
layout = self.layout
view = context.space_data
scene = context.scene
overlay = view.overlay
shading = view.shading
display_all = overlay.show_overlays
@@ -5381,6 +5383,8 @@ class VIEW3D_PT_overlay_guides(Panel):
(overlay.show_ortho_grid and grid_active)
)
sub.prop(overlay, "grid_scale", text="Scale")
sub = sub.row(align=True)
sub.active = scene.unit_settings.system == 'NONE'
sub.prop(overlay, "grid_subdivisions", text="Subdivisions")
sub = split.column()