diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 42 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 2 |
3 files changed, 4 insertions, 42 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 669a9c6fdcb..92bc60e8b77 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -102,33 +102,6 @@ void ED_sculpt_force_update(bContext *C) multires_force_update(ob); } -void ED_sculpt_modifiers_changed(Object *ob) -{ - SculptSession *ss= ob->sculpt; - - if(!ss->cache) { - /* we free pbvh on changes, except during sculpt since it can't deal with - changing PVBH node organization, we hope topology does not change in - the meantime .. weak */ - if(ss->pbvh) { - BLI_pbvh_free(ss->pbvh); - ss->pbvh= NULL; - } - - sculpt_free_deformMats(ob->sculpt); - } else { - PBVHNode **nodes; - int n, totnode; - - BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); - - for(n = 0; n < totnode; n++) - BLI_pbvh_node_mark_update(nodes[n]); - - MEM_freeN(nodes); - } -} - /* Sculpt mode handles multires differently from regular meshes, but only if it's the last modifier on the stack and it is not on the first level */ struct MultiresModifierData *sculpt_multires_active(Scene *scene, Object *ob) @@ -2694,17 +2667,6 @@ static void sculpt_update_tex(Sculpt *sd, SculptSession *ss) } } -void sculpt_free_deformMats(SculptSession *ss) -{ - if(ss->orig_cos) MEM_freeN(ss->orig_cos); - if(ss->deform_cos) MEM_freeN(ss->deform_cos); - if(ss->deform_imats) MEM_freeN(ss->deform_imats); - - ss->orig_cos = NULL; - ss->deform_cos = NULL; - ss->deform_imats = NULL; -} - void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_fmap) { DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); @@ -2741,7 +2703,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_ if(!ss->orig_cos) { int a; - sculpt_free_deformMats(ss); + free_sculptsession_deformMats(ss); if(ss->kb) ss->orig_cos = key_to_vertcos(ob, ss->kb); else ss->orig_cos = mesh_getVertexCos(ob->data, NULL); @@ -2752,7 +2714,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_ for(a = 0; a < ((Mesh*)ob->data)->totvert; ++a) invert_m3(ss->deform_imats[a]); } - } else sculpt_free_deformMats(ss); + } else free_sculptsession_deformMats(ss); /* if pbvh is deformed, key block is already applied to it */ if (ss->kb && !BLI_pbvh_isDeformed(ss->pbvh)) { diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 33970ea0179..c1da29aeb27 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -67,7 +67,7 @@ int sculpt_poll(struct bContext *C); void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_fmap); /* Deformed mesh sculpt */ -void sculpt_free_deformMats(struct SculptSession *ss); +void free_sculptsession_deformMats(struct SculptSession *ss); /* Stroke */ struct SculptStroke *sculpt_stroke_new(const int max); diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index a13b874e504..13b6fef3004 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -199,7 +199,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) Mesh *me= ob->data; mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); - sculpt_free_deformMats(ss); + free_sculptsession_deformMats(ss); tag_update|= 1; } |