diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-09-06 03:10:42 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-09-06 03:15:44 +0300 |
commit | 6d04e48539ce50f0de9cc73a36e7733aee608773 (patch) | |
tree | ff2784a4b1e31773610fedc78a3efda625a23bc6 /doc/python_api | |
parent | b0602483249d1184f2672cd5d5578955560335b5 (diff) |
Join the python modules `gpu` and `_gpu` into one.
Maybe it's still early to set the new drawing api for python.
But joining these two modules is an initial step.
```
>>> gpu.
matrix
select
types
```
```
>>> gpu.types.GPU
Batch(
OffScreen(
VertBuf(
VertFormat(
```
The creation of a new offscreen object is now done by the `GPUOffscreen.__new__` method.
Reviewers: campbellbarton, dfelinto
Reviewed By: campbellbarton, dfelinto
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3667
Diffstat (limited to 'doc/python_api')
-rw-r--r-- | doc/python_api/examples/gpu.types.GPUOffScreen.py (renamed from doc/python_api/examples/gpu.offscreen.1.py) | 4 | ||||
-rw-r--r-- | doc/python_api/rst/gpu.rst | 20 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 10 |
3 files changed, 9 insertions, 25 deletions
diff --git a/doc/python_api/examples/gpu.offscreen.1.py b/doc/python_api/examples/gpu.types.GPUOffScreen.py index bb34603bd23..a1b38837278 100644 --- a/doc/python_api/examples/gpu.offscreen.1.py +++ b/doc/python_api/examples/gpu.types.GPUOffScreen.py @@ -42,7 +42,7 @@ class OffScreenDraw(bpy.types.Operator): aspect_ratio = scene.render.resolution_x / scene.render.resolution_y try: - offscreen = gpu.offscreen.new(512, int(512 / aspect_ratio)) + offscreen = gpu.types.GPUOffScreen(512, int(512 / aspect_ratio)) except Exception as e: print(e) offscreen = None @@ -52,7 +52,7 @@ class OffScreenDraw(bpy.types.Operator): @staticmethod def _update_offscreen(context, offscreen): scene = context.scene - render_layer = context.render_layer + view_layer = context.view_layer render = scene.render camera = scene.camera diff --git a/doc/python_api/rst/gpu.rst b/doc/python_api/rst/gpu.rst deleted file mode 100644 index d4860da4770..00000000000 --- a/doc/python_api/rst/gpu.rst +++ /dev/null @@ -1,20 +0,0 @@ -******************* -GPU functions (gpu) -******************* - -.. module:: gpu - -Functions for GPU offscreen rendering, matrix stacks and selection. - -Submodules: - -.. toctree:: - :maxdepth: 1 - - gpu.offscreen.rst - - -Intro -===== - -Module to provide functions concerning the GPU implementation in Blender. diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 9b58f7b3888..edfa2c4a95b 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -235,7 +235,9 @@ else: "bpy.utils.previews", "bpy_extras", "gpu", - "gpu.offscreen", + "gpu.types", + "gpu.matrix", + "gpu.select", "idprop.types", "mathutils", "mathutils.bvhtree", @@ -1822,7 +1824,10 @@ def write_rst_importable_modules(basepath): # C_modules "aud": "Audio System", "blf": "Font Drawing", - "gpu.offscreen": "GPU Off-Screen Buffer", + "gpu": "GPU Shader Module", + "gpu.types": "GPU Types", + "gpu.matrix": "GPU Matrix", + "gpu.select": "GPU Select", "bmesh": "BMesh Module", "bmesh.types": "BMesh Types", "bmesh.utils": "BMesh Utilities", @@ -1865,7 +1870,6 @@ def copy_handwritten_rsts(basepath): # TODO put this docs in Blender's code and use import as per modules above handwritten_modules = [ "bgl", # "Blender OpenGl wrapper" - "gpu", # "GPU Shader Module" "bmesh.ops", # generated by rst_from_bmesh_opdefines.py # includes... |