Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
| const float *SCULPT_vertex_persistent_co_get(SculptSession *ss, int index) | const float *SCULPT_vertex_persistent_co_get(SculptSession *ss, int index) | ||||
| { | { | ||||
| if (ss->persistent_base) { | if (ss->persistent_base) { | ||||
| return ss->persistent_base[index].co; | return ss->persistent_base[index].co; | ||||
| } | } | ||||
| return SCULPT_vertex_co_get(ss, index); | return SCULPT_vertex_co_get(ss, index); | ||||
| } | } | ||||
| const float *SCULPT_vertex_co_for_grab_active_get(SculptSession *ss, int index) | |||||
| { | |||||
| if (ss->mvert) { | |||||
| return ss->mvert[index].co; | |||||
| } | |||||
| return SCULPT_vertex_co_get(ss, index); | |||||
| } | |||||
| void SCULPT_vertex_limit_surface_get(SculptSession *ss, int index, float r_co[3]) | void SCULPT_vertex_limit_surface_get(SculptSession *ss, int index, float r_co[3]) | ||||
| { | { | ||||
| switch (BKE_pbvh_type(ss->pbvh)) { | switch (BKE_pbvh_type(ss->pbvh)) { | ||||
| case PBVH_FACES: | case PBVH_FACES: | ||||
| case PBVH_BMESH: | case PBVH_BMESH: | ||||
| copy_v3_v3(r_co, SCULPT_vertex_co_get(ss, index)); | copy_v3_v3(r_co, SCULPT_vertex_co_get(ss, index)); | ||||
| break; | break; | ||||
| case PBVH_GRIDS: { | case PBVH_GRIDS: { | ||||
| ▲ Show 20 Lines • Show All 6,474 Lines • ▼ Show 20 Lines | if (ELEM(tool, | ||||
| SCULPT_TOOL_POSE, | SCULPT_TOOL_POSE, | ||||
| SCULPT_TOOL_BOUNDARY, | SCULPT_TOOL_BOUNDARY, | ||||
| SCULPT_TOOL_THUMB) || | SCULPT_TOOL_THUMB) || | ||||
| sculpt_brush_use_topology_rake(ss, brush)) { | sculpt_brush_use_topology_rake(ss, brush)) { | ||||
| float grab_location[3], imat[4][4], delta[3], loc[3]; | float grab_location[3], imat[4][4], delta[3], loc[3]; | ||||
| if (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache)) { | if (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache)) { | ||||
| if (tool == SCULPT_TOOL_GRAB && brush->flag & BRUSH_GRAB_ACTIVE_VERTEX) { | if (tool == SCULPT_TOOL_GRAB && brush->flag & BRUSH_GRAB_ACTIVE_VERTEX) { | ||||
| copy_v3_v3(cache->orig_grab_location, SCULPT_active_vertex_co_get(ss)); | copy_v3_v3(cache->orig_grab_location, | ||||
| SCULPT_vertex_co_for_grab_active_get(ss, SCULPT_active_vertex_get(ss))); | |||||
| } | } | ||||
| else { | else { | ||||
| copy_v3_v3(cache->orig_grab_location, cache->true_location); | copy_v3_v3(cache->orig_grab_location, cache->true_location); | ||||
| } | } | ||||
| } | } | ||||
| else if (tool == SCULPT_TOOL_SNAKE_HOOK || | else if (tool == SCULPT_TOOL_SNAKE_HOOK || | ||||
| (tool == SCULPT_TOOL_CLOTH && | (tool == SCULPT_TOOL_CLOTH && | ||||
| brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK)) { | brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK)) { | ||||
| ▲ Show 20 Lines • Show All 1,655 Lines • ▼ Show 20 Lines | SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, from_v, ni) { | ||||
| if (totpoints + (ni.size * 2) < max_preview_vertices) { | if (totpoints + (ni.size * 2) < max_preview_vertices) { | ||||
| int to_v = ni.index; | int to_v = ni.index; | ||||
| ss->preview_vert_index_list[totpoints] = from_v; | ss->preview_vert_index_list[totpoints] = from_v; | ||||
| totpoints++; | totpoints++; | ||||
| ss->preview_vert_index_list[totpoints] = to_v; | ss->preview_vert_index_list[totpoints] = to_v; | ||||
| totpoints++; | totpoints++; | ||||
| if (!BLI_BITMAP_TEST(visited_vertices, to_v)) { | if (!BLI_BITMAP_TEST(visited_vertices, to_v)) { | ||||
| BLI_BITMAP_ENABLE(visited_vertices, to_v); | BLI_BITMAP_ENABLE(visited_vertices, to_v); | ||||
| const float *co = SCULPT_vertex_co_get(ss, to_v); | const float *co = SCULPT_vertex_co_for_grab_active_get(ss, to_v); | ||||
| if (len_squared_v3v3(brush_co, co) < radius * radius) { | if (len_squared_v3v3(brush_co, co) < radius * radius) { | ||||
| BLI_gsqueue_push(not_visited_vertices, &to_v); | BLI_gsqueue_push(not_visited_vertices, &to_v); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); | SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 772 Lines • ▼ Show 20 Lines | void ED_operatortypes_sculpt(void) | ||||
| WM_operatortype_append(SCULPT_OT_face_sets_create); | WM_operatortype_append(SCULPT_OT_face_sets_create); | ||||
| WM_operatortype_append(SCULPT_OT_face_sets_change_visibility); | WM_operatortype_append(SCULPT_OT_face_sets_change_visibility); | ||||
| WM_operatortype_append(SCULPT_OT_face_sets_randomize_colors); | WM_operatortype_append(SCULPT_OT_face_sets_randomize_colors); | ||||
| WM_operatortype_append(SCULPT_OT_face_sets_init); | WM_operatortype_append(SCULPT_OT_face_sets_init); | ||||
| WM_operatortype_append(SCULPT_OT_cloth_filter); | WM_operatortype_append(SCULPT_OT_cloth_filter); | ||||
| WM_operatortype_append(SCULPT_OT_face_sets_edit); | WM_operatortype_append(SCULPT_OT_face_sets_edit); | ||||
| WM_operatortype_append(SCULPT_OT_face_set_lasso_gesture); | WM_operatortype_append(SCULPT_OT_face_set_lasso_gesture); | ||||
| WM_operatortype_append(SCULPT_OT_face_set_box_gesture); | WM_operatortype_append(SCULPT_OT_face_set_box_gesture); | ||||
| WM_operatortype_append(SCULPT_OT_trim_box_gesture); | |||||
| WM_operatortype_append(SCULPT_OT_trim_lasso_gesture); | |||||
| WM_operatortype_append(SCULPT_OT_sample_color); | WM_operatortype_append(SCULPT_OT_sample_color); | ||||
| WM_operatortype_append(SCULPT_OT_loop_to_vertex_colors); | WM_operatortype_append(SCULPT_OT_loop_to_vertex_colors); | ||||
| WM_operatortype_append(SCULPT_OT_vertex_to_loop_colors); | WM_operatortype_append(SCULPT_OT_vertex_to_loop_colors); | ||||
| WM_operatortype_append(SCULPT_OT_color_filter); | WM_operatortype_append(SCULPT_OT_color_filter); | ||||
| WM_operatortype_append(SCULPT_OT_mask_by_color); | WM_operatortype_append(SCULPT_OT_mask_by_color); | ||||
| } | } | ||||