Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_edit_uv.cc
| Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | void OVERLAY_edit_uv_init(OVERLAY_Data *vedata) | ||||
| const bool is_paint_mode = sima->mode == SI_MODE_PAINT; | const bool is_paint_mode = sima->mode == SI_MODE_PAINT; | ||||
| const bool is_view_mode = sima->mode == SI_MODE_VIEW; | const bool is_view_mode = sima->mode == SI_MODE_VIEW; | ||||
| const bool is_mask_mode = sima->mode == SI_MODE_MASK; | const bool is_mask_mode = sima->mode == SI_MODE_MASK; | ||||
| const bool is_edit_mode = draw_ctx->object_mode == OB_MODE_EDIT; | const bool is_edit_mode = draw_ctx->object_mode == OB_MODE_EDIT; | ||||
| const bool do_uv_overlay = is_image_type && is_uv_editor && has_edit_object; | const bool do_uv_overlay = is_image_type && is_uv_editor && has_edit_object; | ||||
| const bool show_modified_uvs = sima->flag & SI_DRAWSHADOW; | const bool show_modified_uvs = sima->flag & SI_DRAWSHADOW; | ||||
| const bool is_tiled_image = image && (image->source == IMA_SRC_TILED); | const bool is_tiled_image = image && (image->source == IMA_SRC_TILED); | ||||
| const bool do_edges_only = (ts->uv_flag & UV_SYNC_SELECTION) ? | const bool do_edges_only = (ts->uv_flag & UV_SYNC_SELECTION) ? | ||||
| /* NOTE: Ignore #SCE_SELECT_EDGE because a single selected edge | /* NOTE: Ignore #SCE_SELECT_EDGE because a single selected edge | ||||
| * on the mesh may cause single UV vertices to be selected. */ | * on the mesh may cause single UV vertices to be selected. */ | ||||
| false : | false : | ||||
| (ts->uv_selectmode == UV_SELECT_EDGE); | (ts->uv_selectmode == UV_SELECT_EDGE); | ||||
| const bool do_faces = ((sima->flag & SI_NO_DRAWFACES) == 0); | const bool do_faces = ((sima->flag & SI_NO_DRAWFACES) == 0); | ||||
| const bool do_face_dots = (ts->uv_flag & UV_SYNC_SELECTION) ? | const bool do_face_dots = (ts->uv_flag & UV_SYNC_SELECTION) ? | ||||
| (ts->selectmode & SCE_SELECT_FACE) != 0 : | (ts->selectmode & SCE_SELECT_FACE) != 0 : | ||||
| (ts->uv_selectmode == UV_SELECT_FACE); | (ts->uv_selectmode == UV_SELECT_FACE); | ||||
| const bool do_uvstretching_overlay = is_image_type && is_uv_editor && is_edit_mode && | const bool do_uvstretching_overlay = is_image_type && is_uv_editor && is_edit_mode && | ||||
| ((sima->flag & SI_DRAW_STRETCH) != 0); | ((sima->flag & SI_DRAW_STRETCH) != 0); | ||||
| const bool do_tex_paint_shadows = (sima->flag & SI_NO_DRAW_TEXPAINT) == 0; | const bool do_tex_paint_shadows = (sima->flag & SI_NO_DRAW_TEXPAINT) == 0; | ||||
| const bool do_stencil_overlay = is_paint_mode && is_image_type && brush && | const bool do_stencil_overlay = is_paint_mode && is_image_type && brush && | ||||
| ▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | if (pd->edit_uv.do_tiled_image_border_overlay) { | ||||
| float theme_color[4], selected_color[4]; | float theme_color[4], selected_color[4]; | ||||
| UI_GetThemeColorShade4fv(TH_BACK, 60, theme_color); | UI_GetThemeColorShade4fv(TH_BACK, 60, theme_color); | ||||
| UI_GetThemeColor4fv(TH_FACE_SELECT, selected_color); | UI_GetThemeColor4fv(TH_FACE_SELECT, selected_color); | ||||
| srgb_to_linearrgb_v4(theme_color, theme_color); | srgb_to_linearrgb_v4(theme_color, theme_color); | ||||
| srgb_to_linearrgb_v4(selected_color, selected_color); | srgb_to_linearrgb_v4(selected_color, selected_color); | ||||
| DRWShadingGroup *grp = DRW_shgroup_create(sh, psl->edit_uv_tiled_image_borders_ps); | DRWShadingGroup *grp = DRW_shgroup_create(sh, psl->edit_uv_tiled_image_borders_ps); | ||||
| DRW_shgroup_uniform_vec4_copy(grp, "color", theme_color); | DRW_shgroup_uniform_vec4_copy(grp, "ucolor", theme_color); | ||||
| const float3 offset = {0.0f, 0.0f, 0.0f}; | const float3 offset = {0.0f, 0.0f, 0.0f}; | ||||
| DRW_shgroup_uniform_vec3_copy(grp, "offset", offset); | DRW_shgroup_uniform_vec3_copy(grp, "offset", offset); | ||||
| LISTBASE_FOREACH (ImageTile *, tile, &image->tiles) { | LISTBASE_FOREACH (ImageTile *, tile, &image->tiles) { | ||||
| const int tile_x = ((tile->tile_number - 1001) % 10); | const int tile_x = ((tile->tile_number - 1001) % 10); | ||||
| const int tile_y = ((tile->tile_number - 1001) / 10); | const int tile_y = ((tile->tile_number - 1001) / 10); | ||||
| obmat[3][1] = (float)tile_y; | obmat[3][1] = (float)tile_y; | ||||
| obmat[3][0] = (float)tile_x; | obmat[3][0] = (float)tile_x; | ||||
| ▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines | |||||