diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-19 23:32:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-19 23:38:20 +0300 |
commit | 3c8c9760865d14c8dffa3a4cd091e4027b1501e3 (patch) | |
tree | 50639787a78d9bc592d8235c14655bc535ca0349 /doc/python_api/examples/gpu.10.py | |
parent | 5f21030a81fa306f807be5bee8bb1df8dd93a98e (diff) |
Cleanup: gpu docs
Diffstat (limited to 'doc/python_api/examples/gpu.10.py')
-rw-r--r-- | doc/python_api/examples/gpu.10.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/python_api/examples/gpu.10.py b/doc/python_api/examples/gpu.10.py index aa5574c44bb..6e7a3f6db6f 100644 --- a/doc/python_api/examples/gpu.10.py +++ b/doc/python_api/examples/gpu.10.py @@ -3,7 +3,8 @@ Rendering the 3D View into a Texture ------------------------------------ The scene has to have a camera for this example to work. -You could also make this independent of a specific camera, but Blender does not expose good functions to create view and projection matrices yet. +You could also make this independent of a specific camera, +but Blender does not expose good functions to create view and projection matrices yet. """ import bpy import bgl @@ -15,6 +16,7 @@ HEIGHT = 256 offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT) + def draw(): context = bpy.context scene = context.scene @@ -35,4 +37,5 @@ def draw(): bgl.glDisable(bgl.GL_DEPTH_TEST) draw_texture_2d(offscreen.color_texture, (10, 10), WIDTH, HEIGHT) -bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
\ No newline at end of file + +bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL') |