Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-09-21 16:07:53 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-09-21 16:16:31 +0300
commite6dcc0b1cac287f8a47046a63448474f2da2d138 (patch)
tree595ca812cc78ff8b18a6115af524383c39a2463f /io_mesh_uv_layout
parent3e6a85eecab82328e801f02e76de8763ca952090 (diff)
Fix T101134: Regression: Export UV Layout is blurry
This partially reverts commits rBAfdebdd681f0b, rBA563ea27eb1a8 and rBAb56a6acb9f4f. And fixes T101134. We still need to find an appropriate way to replace `glEnable(GL_LINE_SMOOTH)`.
Diffstat (limited to 'io_mesh_uv_layout')
-rw-r--r--io_mesh_uv_layout/__init__.py2
-rw-r--r--io_mesh_uv_layout/export_uv_png.py13
2 files changed, 7 insertions, 8 deletions
diff --git a/io_mesh_uv_layout/__init__.py b/io_mesh_uv_layout/__init__.py
index 40d9b501..d99d2def 100644
--- a/io_mesh_uv_layout/__init__.py
+++ b/io_mesh_uv_layout/__init__.py
@@ -3,7 +3,7 @@
bl_info = {
"name": "UV Layout",
"author": "Campbell Barton, Matt Ebb",
- "version": (1, 1, 3),
+ "version": (1, 1, 4),
"blender": (3, 0, 0),
"location": "Image-Window > UVs > Export UV Layout",
"description": "Export the UV layout as a 2D graphic",
diff --git a/io_mesh_uv_layout/export_uv_png.py b/io_mesh_uv_layout/export_uv_png.py
index b051c980..7da068ac 100644
--- a/io_mesh_uv_layout/export_uv_png.py
+++ b/io_mesh_uv_layout/export_uv_png.py
@@ -2,6 +2,7 @@
import bpy
import gpu
+import bgl
from mathutils import Vector, Matrix
from mathutils.geometry import tessellate_polygon
from gpu_extras.batch import batch_for_shader
@@ -80,16 +81,14 @@ def draw_lines(face_data):
coords.append((start[0], start[1]))
coords.append((end[0], end[1]))
- # Use '2D_UNIFORM_COLOR' in the `batch_for_shader` so we don't need to
- # convert the coordinates to 3D as in the case of
- # '3D_POLYLINE_UNIFORM_COLOR'.
- batch = batch_for_shader(gpu.shader.from_builtin('2D_UNIFORM_COLOR'), 'LINES', {"pos": coords})
- shader = gpu.shader.from_builtin('3D_POLYLINE_UNIFORM_COLOR')
+ shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
shader.bind()
- shader.uniform_float("viewportSize", gpu.state.viewport_get()[2:])
- shader.uniform_float("lineWidth", 0.5)
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):