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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user