Fix T68413: gpu module example in docs produces unexpected results
This commit is contained in:
parent
5c82c9bae4
commit
2ab5ca81a5
|
@ -4,6 +4,7 @@ Mesh with Random Vertex Colors
|
|||
"""
|
||||
import bpy
|
||||
import gpu
|
||||
import bgl
|
||||
import numpy as np
|
||||
from random import random
|
||||
from gpu_extras.batch import batch_for_shader
|
||||
|
@ -30,7 +31,9 @@ batch = batch_for_shader(
|
|||
|
||||
|
||||
def draw():
|
||||
bgl.glEnable(bgl.GL_DEPTH_TEST)
|
||||
batch.draw(shader)
|
||||
bgl.glDisable(bgl.GL_DEPTH_TEST)
|
||||
|
||||
|
||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
||||
|
|
Loading…
Reference in New Issue