diff options
Diffstat (limited to 'doc/python_api/examples/gpu.4.py')
-rw-r--r-- | doc/python_api/examples/gpu.4.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/python_api/examples/gpu.4.py b/doc/python_api/examples/gpu.4.py index 392f010e7c2..0c86b52bcf5 100644 --- a/doc/python_api/examples/gpu.4.py +++ b/doc/python_api/examples/gpu.4.py @@ -7,10 +7,10 @@ import gpu from gpu_extras.batch import batch_for_shader coords = ( - (-1, -1, -1), ( 1, -1, -1), - (-1, 1, -1), ( 1, 1, -1), - (-1, -1, 1), ( 1, -1, 1), - (-1, 1, 1), ( 1, 1, 1)) + (-1, -1, -1), (+1, -1, -1), + (-1, +1, -1), (+1, +1, -1), + (-1, -1, +1), (+1, -1, +1), + (-1, +1, +1), (+1, +1, +1)) indices = ( (0, 1), (0, 2), (1, 3), (2, 3), @@ -18,11 +18,13 @@ indices = ( (0, 4), (1, 5), (2, 6), (3, 7)) shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR') -batch = batch_for_shader(shader, 'LINES', {"pos" : coords}, indices=indices) +batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices) + def draw(): shader.bind() shader.uniform_float("color", (1, 0, 0, 1)) batch.draw(shader) -bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
\ No newline at end of file + +bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW') |