[Bf-extensions-cvs] [768a8cfc] master: BlenderKit: fix alpha drawing

Vilém Duha noreply at git.blender.org
Wed Sep 30 14:47:51 CEST 2020


Commit: 768a8cfc35204b10b554abaf0809c59a16515330
Author: Vilém Duha
Date:   Tue Sep 29 13:06:26 2020 +0200
Branches: master
https://developer.blender.org/rBA768a8cfc35204b10b554abaf0809c59a16515330

BlenderKit: fix alpha drawing

there is some mistery as to why either the first image or first rect drawn with the bgl code are drawn with wrong alpha.
This draws a tiny invisible image as first step to fix it. Need to find the real cause.

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

M	blenderkit/ui.py

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

diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index 1bfd708f..75313c3b 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -738,6 +738,14 @@ def draw_callback_2d_search(self, context):
     highlight = (1, 1, 1, .2)
     # highlight = (1, 1, 1, 0.8)
     # background of asset bar
+    if ui_props.hcount>0:
+        #this fixes a draw issue introduced in blender 2.91. draws a very small version of the image to avoid problems
+        # with alpha. Not sure why this works.
+        img = utils.get_thumbnail('arrow_left.png')
+        ui_bgl.draw_image(0, 0, 1,
+                          1,
+                          img,
+                          1)
     if not ui_props.dragging and ui_props.hcount>0:
         search_results = s.get('search results')
         search_results_orig = s.get('search results orig')



More information about the Bf-extensions-cvs mailing list