Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_cursor.c
| Show First 20 Lines • Show All 1,148 Lines • ▼ Show 20 Lines | static void sculpt_geometry_preview_lines_draw(const uint gpuattr, | ||||
| if (!depth_test) { | if (!depth_test) { | ||||
| GPU_depth_test(GPU_DEPTH_LESS_EQUAL); | GPU_depth_test(GPU_DEPTH_LESS_EQUAL); | ||||
| } | } | ||||
| GPU_line_width(1.0f); | GPU_line_width(1.0f); | ||||
| if (ss->preview_vert_index_count > 0) { | if (ss->preview_vert_index_count > 0) { | ||||
| immBegin(GPU_PRIM_LINES, ss->preview_vert_index_count); | immBegin(GPU_PRIM_LINES, ss->preview_vert_index_count); | ||||
| for (int i = 0; i < ss->preview_vert_index_count; i++) { | for (int i = 0; i < ss->preview_vert_index_count; i++) { | ||||
| immVertex3fv(gpuattr, SCULPT_vertex_co_get(ss, ss->preview_vert_index_list[i])); | immVertex3fv(gpuattr, | ||||
| SCULPT_vertex_co_for_grab_active_get(ss, ss->preview_vert_index_list[i])); | |||||
| } | } | ||||
| immEnd(); | immEnd(); | ||||
| } | } | ||||
| /* Restore depth test value. */ | /* Restore depth test value. */ | ||||
| if (!depth_test) { | if (!depth_test) { | ||||
| GPU_depth_test(GPU_DEPTH_NONE); | GPU_depth_test(GPU_DEPTH_NONE); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 401 Lines • ▼ Show 20 Lines | static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *pcontext) | ||||
| /* Setup drawing. */ | /* Setup drawing. */ | ||||
| wmViewport(&pcontext->region->winrct); | wmViewport(&pcontext->region->winrct); | ||||
| /* Drawing of Cursor overlays in 2D screen space. */ | /* Drawing of Cursor overlays in 2D screen space. */ | ||||
| /* Cursor location symmetry points. */ | /* Cursor location symmetry points. */ | ||||
| const float *active_vertex_co = SCULPT_active_vertex_co_get(pcontext->ss); | const float *active_vertex_co; | ||||
| if (brush->sculpt_tool == SCULPT_TOOL_GRAB && brush->flag & BRUSH_GRAB_ACTIVE_VERTEX) { | |||||
| active_vertex_co = SCULPT_vertex_co_for_grab_active_get( | |||||
| pcontext->ss, SCULPT_active_vertex_get(pcontext->ss)); | |||||
| } | |||||
| else { | |||||
| active_vertex_co = SCULPT_active_vertex_co_get(pcontext->ss); | |||||
| } | |||||
| if (len_v3v3(active_vertex_co, pcontext->location) < pcontext->radius) { | if (len_v3v3(active_vertex_co, pcontext->location) < pcontext->radius) { | ||||
| immUniformColor3fvAlpha(pcontext->outline_col, pcontext->outline_alpha); | immUniformColor3fvAlpha(pcontext->outline_col, pcontext->outline_alpha); | ||||
| cursor_draw_point_with_symmetry(pcontext->pos, | cursor_draw_point_with_symmetry(pcontext->pos, | ||||
| pcontext->region, | pcontext->region, | ||||
| active_vertex_co, | active_vertex_co, | ||||
| pcontext->sd, | pcontext->sd, | ||||
| pcontext->vc.obact, | pcontext->vc.obact, | ||||
| pcontext->radius); | pcontext->radius); | ||||
| ▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines | |||||