Fix #146655: GPU: Call of deprecated function
There are deprecation usages in the gpu presets and custom shapes python module. This PR uses the correct calls to remove the deprecation warnings. Pull Request: https://projects.blender.org/blender/blender/pulls/146746
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user