[Bf-blender-cvs] [b2fc0678542] master: Image Editor: Smooth Wire User Preferences

Jeroen Bakker noreply at git.blender.org
Fri Sep 11 09:13:37 CEST 2020


Commit: b2fc0678542a2496e834b68f10519310cd79e851
Author: Jeroen Bakker
Date:   Fri Sep 11 09:08:11 2020 +0200
Branches: master
https://developer.blender.org/rBb2fc0678542a2496e834b68f10519310cd79e851

Image Editor: Smooth Wire User Preferences

The old image editor has an option to enable the smooth wire drawing.
This option was stored per editor and disabled by default. This patch
connects the smooth wires in the UV/Image editor to `User Prefereces ->
Viewport -> Quality -> Smooth Wire [] Overlay`.

The old option is left in place and will be removed when the old image
editor drawing code will be removed before BCon 3.

===================================================================

M	release/scripts/startup/bl_ui/space_image.py
M	source/blender/draw/engines/overlay/overlay_edit_uv.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index a490208fd5e..0fde128a906 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -1019,7 +1019,8 @@ class IMAGE_PT_view_display_uv_edit_overlays(Panel):
         col.prop(uvedit, "show_faces", text="Faces")
 
         col = layout.column()
-        col.prop(uvedit, "show_smooth_edges", text="Smooth")
+        if context.preferences.experimental.use_image_editor_legacy_drawing:
+          col.prop(uvedit, "show_smooth_edges", text="Smooth")
         col.prop(uvedit, "show_modified_edges", text="Modified")
         col.prop(uvedit, "uv_opacity")
 
diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c
index 1a95bd04c69..109db6433e0 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_uv.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c
@@ -112,7 +112,7 @@ void OVERLAY_edit_uv_init(OVERLAY_Data *vedata)
 
   pd->edit_uv.dash_length = 4.0f * UI_DPI_FAC;
   pd->edit_uv.line_style = edit_uv_line_style_from_space_image(sima);
-  pd->edit_uv.do_smooth_wire = (sima->flag & SI_SMOOTH_UV) != 0;
+  pd->edit_uv.do_smooth_wire = ((U.gpu_flag & USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE) > 0);
 
   pd->edit_uv.draw_type = sima->dt_uvstretch;
   BLI_listbase_clear(&pd->edit_uv.totals);
@@ -144,7 +144,8 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
             pd->edit_uv_shadow_edges_grp, "alpha", pd->edit_uv.uv_opacity);
         DRW_shgroup_uniform_float(
             pd->edit_uv_shadow_edges_grp, "dashLength", &pd->edit_uv.dash_length, 1);
-        DRW_shgroup_uniform_bool_copy(pd->edit_uv_shadow_edges_grp, "doSmoothWire", true);
+        DRW_shgroup_uniform_bool(
+            pd->edit_uv_shadow_edges_grp, "doSmoothWire", &pd->edit_uv.do_smooth_wire, 1);
       }
 
       if (pd->edit_uv.do_uv_overlay) {



More information about the Bf-blender-cvs mailing list