[Bf-extensions-cvs] [0d3cc9a0] master: new: MathVis: Added option to display points and lines in front

Gaia Clary noreply at git.blender.org
Mon Apr 1 12:00:53 CEST 2019


Commit: 0d3cc9a06dfd3f77fa9bd20c5013ae9b050b4fae
Author: Gaia Clary
Date:   Mon Apr 1 12:00:36 2019 +0200
Branches: master
https://developer.blender.org/rBA0d3cc9a06dfd3f77fa9bd20c5013ae9b050b4fae

new: MathVis: Added option to display points and lines in front

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

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 f64de364..94d871d3 100644
--- a/space_view3d_math_vis/__init__.py
+++ b/space_view3d_math_vis/__init__.py
@@ -88,6 +88,7 @@ class PanelConsoleVars(Panel):
         col = layout.column()
         col.prop(bpy.context.window_manager.MathVisProp, "name_hide")
         col.prop(bpy.context.window_manager.MathVisProp, "bbox_hide")
+        col.prop(bpy.context.window_manager.MathVisProp, "in_front")
         col.prop(bpy.context.window_manager.MathVisProp, "bbox_scale")
         col.operator("mathvis.cleanup_console")
 
@@ -242,6 +243,12 @@ class MathVis(PropertyGroup):
         "lines for the display of Matrix items"
     )
 
+    in_front: BoolProperty(
+        name="Always In Front",
+        default=True,
+        description="Draw Points and lines alwasy in front",
+        update=call_console_hook
+    )
 
 classes = (
     PanelConsoleVars,
diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py
index a9c38fbe..a31d284b 100644
--- a/space_view3d_math_vis/draw.py
+++ b/space_view3d_math_vis/draw.py
@@ -21,6 +21,7 @@
 import bpy
 import blf
 import gpu
+import bgl
 from gpu_extras.batch import batch_for_shader
 
 from . import utils
@@ -132,6 +133,11 @@ def draw_callback_view():
     scale = settings.bbox_scale
     with_bounding_box = not settings.bbox_hide
 
+    if settings.in_front:
+        bgl.glDepthFunc(bgl.GL_ALWAYS)
+    else:
+        bgl.glDepthFunc(bgl.GL_LESS)
+
     data_matrix, data_quat, data_euler, data_vector, data_vector_array = utils.console_math_data()
 
     if data_vector:



More information about the Bf-extensions-cvs mailing list