From 294f4e42284f327dbc11ebc8759d9afbc23cd41e Mon Sep 17 00:00:00 2001 From: p2or <512368+p2or@users.noreply.github.com> Date: Sat, 16 Dec 2023 23:33:47 +0100 Subject: [PATCH] 4.0 API change - shader names https://docs.blender.org/api/current/gpu.shader.html#built-in-shaders --- dof-utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dof-utils.py b/dof-utils.py index 16b1053..1e87a01 100644 --- a/dof-utils.py +++ b/dof-utils.py @@ -239,7 +239,7 @@ def draw_callback_3d(operator, context): def line(color, start, end): vertices = [start,end] - shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR') + shader = gpu.shader.from_builtin('UNIFORM_COLOR') batch = batch_for_shader(shader,'LINE_STRIP', {"pos": vertices}) shader.bind() shader.uniform_float("color", color) @@ -305,7 +305,7 @@ def draw_callback_2d(operator, context): def draw_poly(coords, color, width): # Get shader - shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR') + shader = gpu.shader.from_builtin('UNIFORM_COLOR') # Create batch process batch = batch_for_shader(shader,'LINE_STRIP', {"pos": coords}) # Set the line width