[Bf-extensions-cvs] [ce8c5f8d] master: Power Sequencer: replace deprecated bgl module

Germano Cavalcante noreply at git.blender.org
Thu Jul 28 17:34:44 CEST 2022


Commit: ce8c5f8d1b180051d540fb162872300bd4598e31
Author: Germano Cavalcante
Date:   Thu Jul 28 12:17:26 2022 -0300
Branches: master
https://developer.blender.org/rBAce8c5f8d1b180051d540fb162872300bd4598e31

Power Sequencer: replace deprecated bgl module

Part of T80730

===================================================================

M	power_sequencer/__init__.py
M	power_sequencer/operators/mouse_trim_modal.py

===================================================================

diff --git a/power_sequencer/__init__.py b/power_sequencer/__init__.py
index e8f920f7..877de302 100755
--- a/power_sequencer/__init__.py
+++ b/power_sequencer/__init__.py
@@ -24,7 +24,7 @@ bl_info = {
     "name": "Power Sequencer",
     "description": "Video editing tools for content creators",
     "author": "Nathan Lovato",
-    "version": (2, 0, 1),
+    "version": (2, 0, 2),
     "blender": (2, 93, 3),
     "location": "Sequencer",
     "tracker_url": "https://github.com/GDquest/Blender-power-sequencer/issues",
diff --git a/power_sequencer/operators/mouse_trim_modal.py b/power_sequencer/operators/mouse_trim_modal.py
index 93ca1346..e8f751c9 100644
--- a/power_sequencer/operators/mouse_trim_modal.py
+++ b/power_sequencer/operators/mouse_trim_modal.py
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 # Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
 import bpy
-import bgl
 import gpu
 import math
 from mathutils import Vector
@@ -358,8 +357,8 @@ def draw(self, context, frame_start=-1, frame_end=-1, target_strips=[], draw_arr
     rect_origin = Vector((start_x, start_y))
     rect_size = Vector((end_x - start_x, abs(start_y - end_y)))
 
-    bgl.glEnable(bgl.GL_BLEND)
-    bgl.glLineWidth(3)
+    gpu.state.blend_set('ALPHA')
+    gpu.state.line_width_set(3.0)
     draw_rectangle(SHADER, rect_origin, rect_size, color_fill)
     # Vertical lines
     draw_line(SHADER, Vector((start_x, start_y)), Vector((start_x, end_y)), color_line)
@@ -374,8 +373,8 @@ def draw(self, context, frame_start=-1, frame_end=-1, target_strips=[], draw_arr
         draw_triangle_equilateral(SHADER, center_1, radius, color=color_line)
         draw_triangle_equilateral(SHADER, center_2, radius, math.pi, color=color_line)
 
-    bgl.glLineWidth(1)
-    bgl.glDisable(bgl.GL_BLEND)
+    gpu.state.line_width_set(1)
+    gpu.state.blend_set('NONE')
 
 
 def get_frame_and_channel(event):



More information about the Bf-extensions-cvs mailing list