diff options
Diffstat (limited to 'object_scatter')
-rw-r--r-- | object_scatter/__init__.py | 4 | ||||
-rw-r--r-- | object_scatter/operator.py | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/object_scatter/__init__.py b/object_scatter/__init__.py index 12bc8ca0..8edeac71 100644 --- a/object_scatter/__init__.py +++ b/object_scatter/__init__.py @@ -3,8 +3,8 @@ bl_info = { "name": "Scatter Objects", "author": "Jacques Lucke", - "version": (0, 1), - "blender": (2, 80, 0), + "version": (0, 2), + "blender": (3, 0, 0), "location": "3D View", "description": "Distribute object instances on another object.", "warning": "", diff --git a/object_scatter/operator.py b/object_scatter/operator.py index 07bf3884..8be78672 100644 --- a/object_scatter/operator.py +++ b/object_scatter/operator.py @@ -2,7 +2,6 @@ import bpy import gpu -import bgl import blf import math import enum @@ -340,14 +339,14 @@ def draw_matrices_batches(batches): shader.bind() shader.uniform_float("color", (0.4, 0.4, 1.0, 0.3)) - bgl.glEnable(bgl.GL_BLEND) - bgl.glDepthMask(bgl.GL_FALSE) + gpu.state.blend_set('ALPHA') + gpu.state.depth_mask_set(False) for batch in batches: batch.draw(shader) - bgl.glDisable(bgl.GL_BLEND) - bgl.glDepthMask(bgl.GL_TRUE) + gpu.state.blend_set('NONE') + gpu.state.depth_mask_set(True) def create_batch_for_matrices(matrices, base_scale): coords = [] @@ -367,7 +366,7 @@ def create_batch_for_matrices(matrices, base_scale): def draw_line_strip_batch(batch, color, thickness=1): shader = get_uniform_color_shader() - bgl.glLineWidth(thickness) + gpu.state.line_width_set(thickness) shader.bind() shader.uniform_float("color", color) batch.draw(shader) |