From 4ecc9de5a6adc9977bc6bee8eb5ca9826b55d4bc Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Wed, 31 May 2023 13:13:45 -0400 Subject: [PATCH] Blender_Kitsu: Make PyGPU Key backwards compatible --- scripts-blender/addons/blender_kitsu/sqe/draw.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/draw.py b/scripts-blender/addons/blender_kitsu/sqe/draw.py index 3314b3a3..77da1573 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/draw.py +++ b/scripts-blender/addons/blender_kitsu/sqe/draw.py @@ -36,8 +36,12 @@ rect_coords = ((0, 0), (1, 0), (1, 1), (0, 1)) # If running in the background, no handles are registered, as drawing extra UI # elements does not make sense. # See register() and unregister(). +if bpy.app.version_string.split('.')[0] == '3': + color_key = "2D_UNIFORM_COLOR" +else: + color_key = "UNIFORM_COLOR" if not bpy.app.background: - ucolor_2d_shader = gpu.shader.from_builtin("UNIFORM_COLOR") # TEST THIS HOTFX + ucolor_2d_shader = gpu.shader.from_builtin(color_key) ucolor_2d_rect_batch = batch_for_shader( ucolor_2d_shader, "TRI_FAN", {"pos": rect_coords} ) -- 2.30.2