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