mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix T68413: gpu module example in docs produces unexpected results
This commit is contained in:
parent
5c82c9bae4
commit
2ab5ca81a5
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue