PyAPI: remove deprecated 2D_/3D_ prefix for built-in shader names
Names passed to gpu.shader.from_builtin() no longer skip the 2D_/3D_ prefix.
This commit is contained in:
@@ -129,7 +129,7 @@ import gpu
|
||||
from gpu_extras.batch import batch_for_shader
|
||||
|
||||
coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)]
|
||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||
shader = gpu.shader.from_builtin('UNIFORM_COLOR')
|
||||
batch = batch_for_shader(shader, 'LINES', {"pos": coords})
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ indices = (
|
||||
(4, 5), (4, 6), (5, 7), (6, 7),
|
||||
(0, 4), (1, 5), (2, 6), (3, 7))
|
||||
|
||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||
shader = gpu.shader.from_builtin('UNIFORM_COLOR')
|
||||
batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ mesh.loop_triangles.foreach_get(
|
||||
|
||||
vertex_colors = [(random(), random(), random(), 1) for _ in range(len(mesh.vertices))]
|
||||
|
||||
shader = gpu.shader.from_builtin('3D_SMOOTH_COLOR')
|
||||
shader = gpu.shader.from_builtin('SMOOTH_COLOR')
|
||||
batch = batch_for_shader(
|
||||
shader, 'TRIS',
|
||||
{"pos": vertices, "color": vertex_colors},
|
||||
|
||||
@@ -13,7 +13,7 @@ vertices = (
|
||||
indices = (
|
||||
(0, 1, 2), (2, 1, 3))
|
||||
|
||||
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
|
||||
shader = gpu.shader.from_builtin('UNIFORM_COLOR')
|
||||
batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ IMAGE_NAME = "Untitled"
|
||||
image = bpy.data.images[IMAGE_NAME]
|
||||
texture = gpu.texture.from_image(image)
|
||||
|
||||
shader = gpu.shader.from_builtin('2D_IMAGE')
|
||||
shader = gpu.shader.from_builtin('IMAGE')
|
||||
batch = batch_for_shader(
|
||||
shader, 'TRI_FAN',
|
||||
{
|
||||
@@ -45,7 +45,7 @@ IMAGE_NAME = "Untitled"
|
||||
image = bpy.data.images[IMAGE_NAME]
|
||||
texture = gpu.texture.from_image(image)
|
||||
|
||||
shader = gpu.shader.from_builtin('3D_IMAGE')
|
||||
shader = gpu.shader.from_builtin('IMAGE')
|
||||
batch = batch_for_shader(
|
||||
shader, 'TRIS',
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user