Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | const float *SCULPT_active_vertex_co_get(SculptSession *ss) | ||||
| return SCULPT_vertex_co_get(ss, SCULPT_active_vertex_get(ss)); | return SCULPT_vertex_co_get(ss, SCULPT_active_vertex_get(ss)); | ||||
| } | } | ||||
| void SCULPT_active_vertex_normal_get(SculptSession *ss, float normal[3]) | void SCULPT_active_vertex_normal_get(SculptSession *ss, float normal[3]) | ||||
| { | { | ||||
| SCULPT_vertex_normal_get(ss, SCULPT_active_vertex_get(ss), normal); | SCULPT_vertex_normal_get(ss, SCULPT_active_vertex_get(ss), normal); | ||||
| } | } | ||||
| bool SCULPT_vertex_is_duplicate(SculptSession *ss, const int index) | |||||
| { | |||||
| switch (BKE_pbvh_type(ss->pbvh)) { | |||||
| case PBVH_FACES: | |||||
| case PBVH_BMESH: | |||||
| return false; | |||||
| case PBVH_GRIDS: { | |||||
| const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh); | |||||
| const int grid_index = index / key->grid_area; | |||||
| const int vertex_index = index - grid_index * key->grid_area; | |||||
| SubdivCCGCoord coord = {.grid_index = grid_index, | |||||
| .x = vertex_index % key->grid_size, | |||||
| .y = vertex_index / key->grid_size}; | |||||
| return BKE_subdiv_ccg_is_duplicate(ss->subdiv_ccg, &coord); | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| /* Sculpt Face Sets and Visibility. */ | /* Sculpt Face Sets and Visibility. */ | ||||
| int SCULPT_active_face_set_get(SculptSession *ss) | int SCULPT_active_face_set_get(SculptSession *ss) | ||||
| { | { | ||||
| switch (BKE_pbvh_type(ss->pbvh)) { | switch (BKE_pbvh_type(ss->pbvh)) { | ||||
| case PBVH_FACES: | case PBVH_FACES: | ||||
| return ss->face_sets[ss->active_face_index]; | return ss->face_sets[ss->active_face_index]; | ||||
| case PBVH_GRIDS: { | case PBVH_GRIDS: { | ||||
| ▲ Show 20 Lines • Show All 7,608 Lines • Show Last 20 Lines | |||||