diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-02 18:46:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-02 18:46:14 +0400 |
commit | 63f5b96fe33eaa438969c59508b5fc47b40d3402 (patch) | |
tree | 2b3b066afd8d75a3dc3de0ea5e539b317c7c8f6b /source/blender/editors/mesh/mesh_data.c | |
parent | 8856a9cbcd78387d6f9e30ede2cf4868f63d2634 (diff) |
mesh.update() now has option to calculate tessellation faces.
Diffstat (limited to 'source/blender/editors/mesh/mesh_data.c')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 526672b8b4b..4259f7fc558 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -751,19 +751,24 @@ void MESH_OT_sticky_remove(wmOperatorType *ot) /************************** Add Geometry Layers *************************/ -void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges) +void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface) { int *polyindex = NULL; float (*face_nors)[3]; - if(mesh->totface > 0 && mesh->totpoly == 0) + if(mesh->totface > 0 && mesh->totpoly == 0) { convert_mfaces_to_mpolys(mesh); + /* would only be converting back again, dont bother */ + calc_tessface = FALSE; + } + if(calc_edges || (mesh->totpoly && mesh->totedge == 0)) BKE_mesh_calc_edges(mesh, calc_edges); - /* TODO, make this optional, we dont always want this! */ - BKE_mesh_tessface_calc(mesh); + if (calc_tessface) { + BKE_mesh_tessface_calc(mesh); + } polyindex = CustomData_get_layer(&mesh->fdata, CD_POLYINDEX); /* add a normals layer for tesselated faces, a tessface normal will |