From ec558f2a91577304a84fa378eba23ed206450bff Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Thu, 28 Jul 2022 12:26:48 -0300 Subject: VR Scene Inspection: replace deprecated bgl module Part of T80730 --- viewport_vr_preview/operators.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'viewport_vr_preview/operators.py') diff --git a/viewport_vr_preview/operators.py b/viewport_vr_preview/operators.py index 3c92a44f..7981511e 100644 --- a/viewport_vr_preview/operators.py +++ b/viewport_vr_preview/operators.py @@ -12,7 +12,6 @@ from bpy.types import ( GizmoGroup, Operator, ) -import bgl import math from math import radians from mathutils import Euler, Matrix, Quaternion, Vector @@ -305,8 +304,8 @@ class VIEW3D_GT_vr_camera_cone(Gizmo): 'LINES', lines_shape_verts) # Ensure correct GL state (otherwise other gizmos might mess that up) - bgl.glLineWidth(1) - bgl.glEnable(bgl.GL_BLEND) + gpu.state.line_width_set(1.0) + gpu.state.blend_set('ALPHA') self.draw_custom_shape(self.frame_shape) self.draw_custom_shape(self.lines_shape) @@ -316,8 +315,8 @@ class VIEW3D_GT_vr_controller_grip(Gizmo): bl_idname = "VIEW_3D_GT_vr_controller_grip" def draw(self, context): - bgl.glLineWidth(1) - bgl.glEnable(bgl.GL_BLEND) + gpu.state.line_width_set(1.0) + gpu.state.blend_set('ALPHA') self.color = 0.422, 0.438, 0.446 self.draw_preset_circle(self.matrix_basis, axis='POS_X') @@ -329,8 +328,8 @@ class VIEW3D_GT_vr_controller_aim(Gizmo): bl_idname = "VIEW_3D_GT_vr_controller_aim" def draw(self, context): - bgl.glLineWidth(1) - bgl.glEnable(bgl.GL_BLEND) + gpu.state.line_width_set(1.0) + gpu.state.blend_set('ALPHA') self.color = 1.0, 0.2, 0.322 self.draw_preset_arrow(self.matrix_basis, axis='POS_X') -- cgit v1.2.3