Fix T96575: Can't set vertex theme color

UV editor used wire color for drawing unselected vertices.
Add color variable to shader, so theme color can be used.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D14373
This commit is contained in:
Richard Antalik 2022-04-04 14:27:47 +02:00
parent e49fef45ce
commit 068d2b0861
Notes: blender-bot 2023-02-14 03:34:17 +01:00
Referenced by issue #96575, Vertex Color in UV Editor
2 changed files with 6 additions and 1 deletions

View File

@ -238,6 +238,10 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
DRW_shgroup_uniform_float_copy(
pd->edit_uv_verts_grp, "pointSize", (point_size + 1.5f) * M_SQRT2);
DRW_shgroup_uniform_float_copy(pd->edit_uv_verts_grp, "outlineWidth", 0.75f);
float theme_color[4];
UI_GetThemeColor4fv(TH_VERTEX, theme_color);
srgb_to_linearrgb_v4(theme_color, theme_color);
DRW_shgroup_uniform_vec4_copy(pd->edit_uv_verts_grp, "color", theme_color);
}
/* uv faces */

View File

@ -3,6 +3,7 @@
uniform float pointSize;
uniform float outlineWidth;
uniform vec4 color;
in vec2 au;
in int flag;
@ -18,7 +19,7 @@ void main()
{
bool is_selected = (flag & (VERT_UV_SELECT | FACE_UV_SELECT)) != 0;
bool is_pinned = (flag & VERT_UV_PINNED) != 0;
vec4 deselect_col = (is_pinned) ? pinned_col : vec4(colorWire.rgb, 1.0);
vec4 deselect_col = (is_pinned) ? pinned_col : vec4(color.rgb, 1.0);
fillColor = (is_selected) ? colorVertexSelect : deselect_col;
outlineColor = (is_pinned) ? pinned_col : vec4(fillColor.rgb, 0.0);