Power Sequencer: replace deprecated bgl module

Part of T80730
This commit is contained in:
Germano Cavalcante 2022-07-28 12:17:26 -03:00
parent c8109966ce
commit ce8c5f8d1b
Notes: blender-bot 2024-02-26 14:24:26 +01:00
Referenced by issue #80730, BGL deprecation
2 changed files with 5 additions and 6 deletions

View File

@ -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",

View File

@ -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):