Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/paint.c
| Show First 20 Lines • Show All 990 Lines • ▼ Show 20 Lines | return ((ob != NULL) && (ob->type == OB_MESH) && (ob->data != NULL) && | ||||
| (ob->mode & OB_MODE_WEIGHT_PAINT || ob->mode & OB_MODE_VERTEX_PAINT)); | (ob->mode & OB_MODE_WEIGHT_PAINT || ob->mode & OB_MODE_VERTEX_PAINT)); | ||||
| } | } | ||||
| bool BKE_paint_select_elem_test(Object *ob) | bool BKE_paint_select_elem_test(Object *ob) | ||||
| { | { | ||||
| return (BKE_paint_select_vert_test(ob) || BKE_paint_select_face_test(ob)); | return (BKE_paint_select_vert_test(ob) || BKE_paint_select_face_test(ob)); | ||||
| } | } | ||||
| bool BKE_paint_always_hide_test(Object *ob) | |||||
| { | |||||
| return ((ob != NULL) && (ob->type == OB_MESH) && (ob->data != NULL) && | |||||
| (ob->mode & OB_MODE_WEIGHT_PAINT || ob->mode & OB_MODE_VERTEX_PAINT)); | |||||
| } | |||||
| void BKE_paint_cavity_curve_preset(Paint *p, int preset) | void BKE_paint_cavity_curve_preset(Paint *p, int preset) | ||||
| { | { | ||||
| CurveMapping *cumap = NULL; | CurveMapping *cumap = NULL; | ||||
| CurveMap *cuma = NULL; | CurveMap *cuma = NULL; | ||||
| if (!p->cavity_curve) { | if (!p->cavity_curve) { | ||||
| p->cavity_curve = BKE_curvemapping_add(1, 0, 0, 1, 1); | p->cavity_curve = BKE_curvemapping_add(1, 0, 0, 1, 1); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,243 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| PBVH *BKE_sculpt_object_pbvh_ensure(Depsgraph *depsgraph, Object *ob) | PBVH *BKE_sculpt_object_pbvh_ensure(Depsgraph *depsgraph, Object *ob) | ||||
| { | { | ||||
| if (ob == NULL || ob->sculpt == NULL) { | if (ob == NULL || ob->sculpt == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| bool respect_hide = true; | const bool respect_hide = true; | ||||
| if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) { | |||||
| if (!(BKE_paint_select_vert_test(ob) || BKE_paint_select_face_test(ob))) { | |||||
| respect_hide = false; | |||||
| } | |||||
| } | |||||
| PBVH *pbvh = ob->sculpt->pbvh; | PBVH *pbvh = ob->sculpt->pbvh; | ||||
| if (pbvh != NULL) { | if (pbvh != NULL) { | ||||
| /* NOTE: It is possible that grids were re-allocated due to modifier | /* NOTE: It is possible that grids were re-allocated due to modifier | ||||
| * stack. Need to update those pointers. */ | * stack. Need to update those pointers. */ | ||||
| if (BKE_pbvh_type(pbvh) == PBVH_GRIDS) { | if (BKE_pbvh_type(pbvh) == PBVH_GRIDS) { | ||||
| Object *object_eval = DEG_get_evaluated_object(depsgraph, ob); | Object *object_eval = DEG_get_evaluated_object(depsgraph, ob); | ||||
| Mesh *mesh_eval = object_eval->data; | Mesh *mesh_eval = object_eval->data; | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||