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
This commit is contained in:
mano-wii
2018-09-05 21:10:42 -03:00
parent b060248324
commit 6d04e48539
22 changed files with 1726 additions and 1000 deletions

View File

@@ -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