2.5/Sculpt:
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 24 May 2009 23:05:27 +0000 (23:05 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 24 May 2009 23:05:27 +0000 (23:05 +0000)
Bugfix for doing a multires subdivision while in sculptmode (forgot to resize projected vertices.)

source/blender/editors/sculpt_paint/sculpt.c

index 8f1e382631428b6b220f00cda0a095b7390c6f89..a106df7745ce83bf036e302655dc594e2fe5ba64 100644 (file)
@@ -1064,6 +1064,7 @@ static void sculpt_update_mesh_elements(bContext *C)
 {
        SculptSession *ss = CTX_data_tool_settings(C)->sculpt->session;
        Object *ob = CTX_data_active_object(C);
+       int oldtotvert = ss->totvert;
 
        if((ss->multires = sculpt_multires_active(ob))) {
                DerivedMesh *dm = mesh_get_derived_final(CTX_data_scene(C), ob, CD_MASK_BAREMESH);
@@ -1082,7 +1083,10 @@ static void sculpt_update_mesh_elements(bContext *C)
                ss->face_normals = NULL;
        }
 
-       if(ss->totvert != ss->fmap_size) {
+       if(ss->totvert != oldtotvert) {
+               if(ss->projverts) MEM_freeN(ss->projverts);
+               ss->projverts = NULL;
+
                if(ss->fmap) MEM_freeN(ss->fmap);
                if(ss->fmap_mem) MEM_freeN(ss->fmap_mem);
                create_vert_face_map(&ss->fmap, &ss->fmap_mem, ss->mface, ss->totvert, ss->totface);