fix in DM_to_mesh() for bmesh - would crash rendering NGons with cycles
authorCampbell Barton <ideasman42@gmail.com>
Fri, 25 Nov 2011 22:32:58 +0000 (22:32 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 25 Nov 2011 22:32:58 +0000 (22:32 +0000)
source/blender/blenkernel/intern/DerivedMesh.c

index 995d755187f8d7c53b5c3f85267dbff6c70d3399..175e74cdd3ecf6062ba470789816a604d155bab1 100644 (file)
@@ -423,9 +423,14 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
                }
        }
 
+       /* yes, must be before _and_ after tesselate */
+       mesh_update_customdata_pointers(&tmp);
+
        tmp.totface = mesh_recalcTesselation(&tmp.fdata, &tmp.ldata, &tmp.pdata, tmp.mvert, tmp.totface, tmp.totloop, tmp.totpoly);
+
        mesh_update_customdata_pointers(&tmp);
 
+
        CustomData_free(&me->vdata, me->totvert);
        CustomData_free(&me->edata, me->totedge);
        CustomData_free(&me->fdata, me->totface);