diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-04-01 12:59:15 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-04-01 12:59:15 +0300 |
commit | 3456a058ac4c3c366262b2c4a5da03c0bbb250f9 (patch) | |
tree | a1725c5a73a7db8966e96f77759da1c796f68d81 /space_view3d_math_vis | |
parent | 2896210678ce9f6fe7a8bd93457e38a2c1bfc17f (diff) |
refactor: MathVis: replaced color definitions by constants, changed point color to improve visibility
Diffstat (limited to 'space_view3d_math_vis')
-rw-r--r-- | space_view3d_math_vis/draw.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py index 0490a5ce..a9c38fbe 100644 --- a/space_view3d_math_vis/draw.py +++ b/space_view3d_math_vis/draw.py @@ -32,6 +32,10 @@ callback_handle = [] single_color_shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR') smooth_color_shader = gpu.shader.from_builtin('3D_SMOOTH_COLOR') +COLOR_POINT = (1.0, 0.0, 1.0, 1) +COLOR_LINE = (0.5, 0.5, 1, 1) +COLOR_BOUNDING_BOX = (1.0, 1.0, 1.0, 1.0) + def tag_redraw_areas(): context = bpy.context @@ -155,17 +159,16 @@ def draw_callback_view(): derived_matrices.append(matrix) draw_matrices(derived_matrices, scale, with_bounding_box) - def draw_points(points): batch = batch_from_points(points, "POINTS") single_color_shader.bind() - single_color_shader.uniform_float("color", (0.5, 0.5, 1, 1)) + single_color_shader.uniform_float("color", COLOR_POINT) batch.draw(single_color_shader) def draw_line(points): batch = batch_from_points(points, "LINE_STRIP") single_color_shader.bind() - single_color_shader.uniform_float("color", (0.5, 0.5, 1, 1)) + single_color_shader.uniform_float("color", COLOR_LINE) batch.draw(single_color_shader) def batch_from_points(points, type): @@ -206,7 +209,7 @@ def draw_matrices(matrices, scale, with_bounding_box): batch.draw(smooth_color_shader) if with_bounding_box: - draw_bounding_boxes(matrices, scale, (1.0, 1.0, 1.0, 1.0)) + draw_bounding_boxes(matrices, scale, COLOR_BOUNDING_BOX) def draw_bounding_boxes(matrices, scale, color): boundbox_points = [] |