[Bf-extensions-cvs] [f3e1e980] master: Math Vis: replace deprecated bgl module

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


Commit: f3e1e980b6199e4733a8f255f49e6b94151f5e25
Author: Germano Cavalcante
Date:   Thu Jul 28 12:23:35 2022 -0300
Branches: master
https://developer.blender.org/rBAf3e1e980b6199e4733a8f255f49e6b94151f5e25

Math Vis: replace deprecated bgl module

Part of T80730

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

M	space_view3d_math_vis/__init__.py
M	space_view3d_math_vis/draw.py

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

diff --git a/space_view3d_math_vis/__init__.py b/space_view3d_math_vis/__init__.py
index b6aac3cd..ac05ffc6 100644
--- a/space_view3d_math_vis/__init__.py
+++ b/space_view3d_math_vis/__init__.py
@@ -3,8 +3,8 @@
 bl_info = {
     "name": "Math Vis (Console)",
     "author": "Campbell Barton",
-    "version": (0, 2, 1),
-    "blender": (2, 80, 0),
+    "version": (0, 2, 2),
+    "blender": (3, 0, 0),
     "location": "Properties: Scene > Math Vis Console and Python Console: Menu",
     "description": "Display console defined mathutils variables in the 3D view",
     "doc_url": "{BLENDER_MANUAL_URL}/addons/3d_view/math_vis_console.html",
diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py
index de7ad946..0b7084eb 100644
--- a/space_view3d_math_vis/draw.py
+++ b/space_view3d_math_vis/draw.py
@@ -3,7 +3,6 @@
 import bpy
 import blf
 import gpu
-import bgl
 from gpu_extras.batch import batch_for_shader
 
 from . import utils
@@ -126,9 +125,9 @@ def draw_callback_view():
     with_bounding_box = not settings.bbox_hide
 
     if settings.in_front:
-        bgl.glDepthFunc(bgl.GL_ALWAYS)
+        gpu.state.depth_test_set('ALWAYS')
     else:
-        bgl.glDepthFunc(bgl.GL_LESS)
+        gpu.state.depth_test_set('LESS')
 
     data_matrix, data_quat, data_euler, data_vector, data_vector_array = utils.console_math_data()
     if settings.index in range(0,len(prop_states)):



More information about the Bf-extensions-cvs mailing list