Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/paint.c
| Show First 20 Lines • Show All 1,728 Lines • ▼ Show 20 Lines | if (CustomData_has_layer(&orig_me->vdata, CD_PROP_COLOR)) { | ||||
| return; | return; | ||||
| } | } | ||||
| CustomData_add_layer(&orig_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert); | CustomData_add_layer(&orig_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert); | ||||
| BKE_mesh_update_customdata_pointers(orig_me, true); | BKE_mesh_update_customdata_pointers(orig_me, true); | ||||
| DEG_id_tag_update(&orig_me->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&orig_me->id, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| /** \warning Expects a fully evaluated depsgraph. */ | |||||
| void BKE_sculpt_update_object_for_edit( | void BKE_sculpt_update_object_for_edit( | ||||
| Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors) | Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors) | ||||
| { | { | ||||
| /* Update from sculpt operators and undo, to update sculpt session | |||||
| * and PBVH after edits. */ | |||||
| Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); | |||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_orig); | |||||
| Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, &CD_MASK_BAREMESH); | |||||
| BLI_assert(ob_orig == DEG_get_original_object(ob_orig)); | BLI_assert(ob_orig == DEG_get_original_object(ob_orig)); | ||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_orig); | |||||
| Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval); | |||||
| BLI_assert(me_eval != NULL); | |||||
| sculpt_update_object(depsgraph, ob_orig, me_eval, need_pmap, need_mask, need_colors); | sculpt_update_object(depsgraph, ob_orig, me_eval, need_pmap, need_mask, need_colors); | ||||
| } | } | ||||
| int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd) | int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd) | ||||
| { | { | ||||
| const float *paint_mask; | const float *paint_mask; | ||||
| Mesh *me = ob->data; | Mesh *me = ob->data; | ||||
| int ret = 0; | int ret = 0; | ||||
| ▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines | |||||