diff --git a/scripts/modules/_bpy_types.py b/scripts/modules/_bpy_types.py index ece8633b27f..83ccdab1ce9 100644 --- a/scripts/modules/_bpy_types.py +++ b/scripts/modules/_bpy_types.py @@ -970,7 +970,7 @@ class Gizmo(_StructRNA): with gpu.matrix.push_pop(): gpu.matrix.multiply_matrix(matrix) - batch.draw() + batch.draw(shader) if use_blend: gpu.state.blend_set('NONE') @@ -1002,7 +1002,6 @@ class Gizmo(_StructRNA): vbo.attr_fill(id=pos_id, data=verts) batch = GPUBatch(type=type, buf=vbo) shader = gpu.shader.from_builtin('UNIFORM_COLOR') - batch.program_set(shader) return (batch, shader) diff --git a/scripts/modules/gpu_extras/presets.py b/scripts/modules/gpu_extras/presets.py index b4d3a0375bb..0e880c8208a 100644 --- a/scripts/modules/gpu_extras/presets.py +++ b/scripts/modules/gpu_extras/presets.py @@ -51,10 +51,11 @@ def draw_circle_2d(position, color, radius, *, segments=None): vbo = GPUVertBuf(len=len(verts), format=fmt) vbo.attr_fill(id=pos_id, data=verts) batch = GPUBatch(type='LINE_STRIP', buf=vbo) - shader = gpu.shader.from_builtin('UNIFORM_COLOR') - batch.program_set(shader) + shader = gpu.shader.from_builtin('POLYLINE_UNIFORM_COLOR') + shader.uniform_float("viewportSize", gpu.state.viewport_get()[2:]) + shader.uniform_float("lineWidth", gpu.state.line_width_get()) shader.uniform_float("color", color) - batch.draw() + batch.draw(shader) def draw_texture_2d(texture, position, width, height):