diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-09-21 18:46:54 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-09-21 18:46:54 +0300 |
commit | ddc05b91404192a420f8b9ea96e4ec2f00fd5ffa (patch) | |
tree | 2bfb9854df0844a0cec3e134fa25d513db8ee424 /io_mesh_uv_layout | |
parent | e87ab444db76f41693d4eeaa5edc4ada7bb32d38 (diff) |
UV Layout: revert all changes to 'draw_image'
The UV color changed after these changes.
Diffstat (limited to 'io_mesh_uv_layout')
-rw-r--r-- | io_mesh_uv_layout/export_uv_png.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/io_mesh_uv_layout/export_uv_png.py b/io_mesh_uv_layout/export_uv_png.py index 7da068ac..2c40abdf 100644 --- a/io_mesh_uv_layout/export_uv_png.py +++ b/io_mesh_uv_layout/export_uv_png.py @@ -26,7 +26,10 @@ def export(filepath, face_data, colors, width, height, opacity): def draw_image(face_data, opacity): - gpu.state.blend_set('ALPHA_PREMULT') + bgl.glLineWidth(1) + bgl.glEnable(bgl.GL_BLEND) + bgl.glEnable(bgl.GL_LINE_SMOOTH) + bgl.glHint(bgl.GL_LINE_SMOOTH_HINT, bgl.GL_NICEST) with gpu.matrix.push_pop(): gpu.matrix.load_matrix(get_normalize_uvs_matrix()) @@ -35,7 +38,8 @@ def draw_image(face_data, opacity): draw_background_colors(face_data, opacity) draw_lines(face_data) - gpu.state.blend_set('NONE') + bgl.glDisable(bgl.GL_BLEND) + bgl.glDisable(bgl.GL_LINE_SMOOTH) def get_normalize_uvs_matrix(): @@ -86,9 +90,7 @@ def draw_lines(face_data): shader.uniform_float("color", (0, 0, 0, 1)) batch = batch_for_shader(shader, 'LINES', {"pos": coords}) - bgl.glEnable(bgl.GL_LINE_SMOOTH) batch.draw(shader) - bgl.glDisable(bgl.GL_LINE_SMOOTH) def save_pixels(filepath, pixel_data, width, height): |