[Bf-blender-cvs] [4c75cc488a4] blender2.8: Correction for Gizmo.draw_custom_shape utility API

Campbell Barton noreply at git.blender.org
Fri Oct 26 03:44:18 CEST 2018


Commit: 4c75cc488a49ff9dedf9b0aa520f8688d753b987
Author: Campbell Barton
Date:   Fri Oct 26 12:43:40 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB4c75cc488a49ff9dedf9b0aa520f8688d753b987

Correction for Gizmo.draw_custom_shape utility API

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

M	release/scripts/modules/bpy_types.py

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

diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index f8eabdde8ef..0ef1f4504e1 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -595,6 +595,7 @@ class Gizmo(StructRNA):
             matrix = self.matrix_world
 
         batch, shader = shape
+        shader.bind()
 
         if select_id is not None:
             gpu.select.load_id(select_id)
@@ -603,7 +604,6 @@ class Gizmo(StructRNA):
                 color = (*self.color_highlight, self.alpha_highlight)
             else:
                 color = (*self.color, self.alpha)
-            batch.program_set(shader)
             shader.uniform_float("color", color)
 
         with gpu.matrix.push_pop():
@@ -639,6 +639,7 @@ class Gizmo(StructRNA):
         vbo.attr_fill(id=pos_id, data=verts)
         batch = GPUBatch(type=type, buf=vbo)
         shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR' if dims == 3 else '2D_UNIFORM_COLOR')
+        batch.program_set(shader)
         return (batch, shader)



More information about the Bf-blender-cvs mailing list