Skip to content

Commit

Permalink
4.0 API change - shader names
Browse files Browse the repository at this point in the history
  • Loading branch information
p2or committed Dec 16, 2023
1 parent c53670f commit 294f4e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dof-utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 294f4e4

Please # to comment.