Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
| Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | const float *SCULPT_vertex_color_get(SculptSession *ss, int index) | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| void SCULPT_vertex_normal_get(SculptSession *ss, int index, float no[3]) | void SCULPT_vertex_normal_get(SculptSession *ss, int index, float no[3]) | ||||
| { | { | ||||
| switch (BKE_pbvh_type(ss->pbvh)) { | switch (BKE_pbvh_type(ss->pbvh)) { | ||||
| case PBVH_FACES: { | case PBVH_FACES: { | ||||
| if (ss->shapekey_active || ss->deform_modifiers_active) { | |||||
HooglyBoogly: A great cleanup here. But might it make sense to commit this separately? I don't think the… | |||||
| const float(*vert_normals)[3] = BKE_pbvh_get_vert_normals(ss->pbvh); | const float(*vert_normals)[3] = BKE_pbvh_get_vert_normals(ss->pbvh); | ||||
| copy_v3_v3(no, vert_normals[index]); | copy_v3_v3(no, vert_normals[index]); | ||||
| } | |||||
| else { | |||||
| copy_v3_v3(no, ss->vert_normals[index]); | |||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case PBVH_BMESH: | case PBVH_BMESH: | ||||
| copy_v3_v3(no, BM_vert_at_index(BKE_pbvh_get_bmesh(ss->pbvh), index)->no); | copy_v3_v3(no, BM_vert_at_index(BKE_pbvh_get_bmesh(ss->pbvh), index)->no); | ||||
| break; | break; | ||||
| case PBVH_GRIDS: { | case PBVH_GRIDS: { | ||||
| const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh); | const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh); | ||||
| const int grid_index = index / key->grid_area; | const int grid_index = index / key->grid_area; | ||||
| ▲ Show 20 Lines • Show All 5,530 Lines • Show Last 20 Lines | |||||
A great cleanup here. But might it make sense to commit this separately? I don't think the changes depend on each other.