From a1424dc87f2caea19d089c45b975f237e6746b22 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Thu, 28 Jul 2022 12:03:49 -0300 Subject: MeasureIt: replace deprecated bgl module Part of T80730 --- measureit/measureit_geometry.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'measureit/measureit_geometry.py') 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: -- cgit v1.2.3