Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-10-15 11:21:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-15 11:24:40 +0300
commit171a47421d09e3c08c3ea68538a98a9f72827cfc (patch)
tree89fe1efe7d2e2c072581e169ba2ce8e8176cd0ba
parentb77da65e8c4d8deb5a27e29f5ba518f02fc1c35d (diff)
Fix T70590: Python Gizmo API misses opacity & anti-aliasing
Thanks to @mano-wii for finding root cause.
-rw-r--r--release/scripts/modules/bpy_types.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 6cb9600b9b4..43ee785438b 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -639,17 +639,27 @@ class Gizmo(StructRNA):
if select_id is not None:
gpu.select.load_id(select_id)
+ use_blend = False
else:
if self.is_highlight:
color = (*self.color_highlight, self.alpha_highlight)
else:
color = (*self.color, self.alpha)
shader.uniform_float("color", color)
+ 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)
with gpu.matrix.push_pop():
gpu.matrix.multiply_matrix(matrix)
batch.draw()
+ if use_blend:
+ glDisable(GL_BLEND)
+
@staticmethod
def new_custom_shape(type, verts):
"""