Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/paint.c
| Show First 20 Lines • Show All 460 Lines • ▼ Show 20 Lines | |||||
| /* are we in weight paint vertex select mode? */ | /* are we in weight paint vertex select mode? */ | ||||
| bool BKE_paint_select_vert_test(Object *ob) | bool BKE_paint_select_vert_test(Object *ob) | ||||
| { | { | ||||
| return ( (ob != NULL) && | return ( (ob != NULL) && | ||||
| (ob->type == OB_MESH) && | (ob->type == OB_MESH) && | ||||
| (ob->data != NULL) && | (ob->data != NULL) && | ||||
| (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_VERT_SEL) && | (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_VERT_SEL) && | ||||
| (ob->mode & OB_MODE_WEIGHT_PAINT) | (ob->mode & OB_MODE_WEIGHT_PAINT || ob->mode & OB_MODE_VERTEX_PAINT) | ||||
| ); | ); | ||||
| } | } | ||||
| /** | /** | ||||
| * used to check if selection is possible | * used to check if selection is possible | ||||
| * (when we don't care if its face or vert) | * (when we don't care if its face or vert) | ||||
| */ | */ | ||||
| bool BKE_paint_select_elem_test(Object *ob) | bool BKE_paint_select_elem_test(Object *ob) | ||||
| ▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | |||||
| void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss) | void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss) | ||||
| { | { | ||||
| struct SculptVertexPaintGeomMap *gmap = NULL; | struct SculptVertexPaintGeomMap *gmap = NULL; | ||||
| if (ss->mode_type == OB_MODE_VERTEX_PAINT) { | if (ss->mode_type == OB_MODE_VERTEX_PAINT) { | ||||
| gmap = &ss->mode.vpaint.gmap; | gmap = &ss->mode.vpaint.gmap; | ||||
| MEM_SAFE_FREE(ss->mode.vpaint.previous_color); | MEM_SAFE_FREE(ss->mode.vpaint.previous_color); | ||||
| MEM_SAFE_FREE(ss->mode.vpaint.previous_accum); | |||||
| } | } | ||||
| else if (ss->mode_type == OB_MODE_WEIGHT_PAINT) { | else if (ss->mode_type == OB_MODE_WEIGHT_PAINT) { | ||||
| gmap = &ss->mode.wpaint.gmap; | gmap = &ss->mode.wpaint.gmap; | ||||
| MEM_SAFE_FREE(ss->mode.wpaint.alpha_weight); | MEM_SAFE_FREE(ss->mode.wpaint.alpha_weight); | ||||
| MEM_SAFE_FREE(ss->mode.wpaint.previous_weight); | MEM_SAFE_FREE(ss->mode.wpaint.previous_weight); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (object->sculpt->bm) { | ||||
| /* Ensure no points to old arrays are stored in DM | /* Ensure no points to old arrays are stored in DM | ||||
| * | * | ||||
| * Apparently, we could not use DAG_id_tag_update | * Apparently, we could not use DAG_id_tag_update | ||||
| * here because this will lead to the while object | * here because this will lead to the while object | ||||
| * surface to disappear, so we'll release DM in place. | * surface to disappear, so we'll release DM in place. | ||||
| */ | */ | ||||
| BKE_object_free_derived_caches(object); | BKE_object_free_derived_caches(object); | ||||
| MEM_SAFE_FREE(object->sculpt->pbvh); | if (object->sculpt->pbvh) { | ||||
| BKE_pbvh_free(object->sculpt->pbvh); | |||||
| object->sculpt->pbvh = NULL; | |||||
| } | |||||
| sculptsession_bm_to_me_update_data_only(object, false); | sculptsession_bm_to_me_update_data_only(object, false); | ||||
| /* In contrast with sculptsession_bm_to_me no need in | /* In contrast with sculptsession_bm_to_me no need in | ||||
| * DAG tag update here - derived mesh was freed and | * DAG tag update here - derived mesh was freed and | ||||
| * old pointers are nowhere stored. | * old pointers are nowhere stored. | ||||
| */ | */ | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines | |||||