From 6fff2427d623119a373e7991a319a75d65ed387e Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Sat, 1 May 2021 11:59:54 -0300 Subject: Python GPU: Replace a few calls of the bgl module with gpu Concludes these files: [x]bpy_types.py [x]operator_modal_draw.py Reviewed By: fclem Differential Revision: https://developer.blender.org/D11129 --- release/scripts/modules/bpy_types.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'release/scripts/modules') diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 4ea8c88e8d9..aa540eeb23b 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -657,16 +657,14 @@ class Gizmo(StructRNA): use_blend = color[3] < 1.0 if use_blend: - # TODO: wrap GPU_blend from GPU state. - from bgl import glEnable, glDisable, GL_BLEND - glEnable(GL_BLEND) + gpu.state.blend_set('ALPHA') with gpu.matrix.push_pop(): gpu.matrix.multiply_matrix(matrix) batch.draw() if use_blend: - glDisable(GL_BLEND) + gpu.state.blend_set('NONE') @staticmethod def new_custom_shape(type, verts): -- cgit v1.2.3