diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-07-28 18:03:49 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-07-28 18:03:49 +0300 |
commit | a1424dc87f2caea19d089c45b975f237e6746b22 (patch) | |
tree | c3a05c86f561ea6c12e3592c8bad944ec87f71bc /measureit/measureit_geometry.py | |
parent | 547adaa4edf8a96e94613bb9345624a00c7f8632 (diff) |
MeasureIt: replace deprecated bgl module
Part of T80730
Diffstat (limited to 'measureit/measureit_geometry.py')
-rw-r--r-- | measureit/measureit_geometry.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/measureit/measureit_geometry.py b/measureit/measureit_geometry.py index a1e90b9e..56efad0e 100644 --- a/measureit/measureit_geometry.py +++ b/measureit/measureit_geometry.py @@ -17,7 +17,6 @@ from bpy_extras import view3d_utils, mesh_utils import bpy_extras.object_utils as object_utils from sys import exc_info # GPU -import bgl import gpu from gpu_extras.batch import batch_for_shader @@ -477,7 +476,7 @@ def draw_segments(context, myobj, op, region, rv3d): # ------------------------------------ # Draw lines # ------------------------------------ - bgl.glEnable(bgl.GL_BLEND) + gpu.state.blend_set('ALPHA') if ms.gltype == 1: # Segment draw_line(screen_point_ap1, screen_point_v11, rgba) @@ -1175,7 +1174,7 @@ def draw_faces(context, myobj, region, rv3d): a_p2 = (a_p1[0] + normal[0] * ln, a_p1[1] + normal[1] * ln, a_p1[2] + normal[2] * ln) # line setup - bgl.glEnable(bgl.GL_BLEND) + gpu.state.blend_set('ALPHA') imm_set_line_width(th) # converting to screen coordinates txtpoint2d = get_2d_point(region, rv3d, a_p1) @@ -1185,7 +1184,7 @@ def draw_faces(context, myobj, region, rv3d): draw_text(myobj, txtpoint2d, str(f.index), rgba, fsize) # Draw Normal if scene.measureit_debug_normals is True: - bgl.glEnable(bgl.GL_BLEND) + gpu.state.blend_set('ALPHA') draw_arrow(txtpoint2d, point2, rgba, 10, "99", "1") if len(obverts) > 2 and scene.measureit_debug_normal_details is True: |