Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-02 18:46:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-02 18:46:14 +0400
commit63f5b96fe33eaa438969c59508b5fc47b40d3402 (patch)
tree2b3b066afd8d75a3dc3de0ea5e539b317c7c8f6b /source/blender/editors
parent8856a9cbcd78387d6f9e30ede2cf4868f63d2634 (diff)
mesh.update() now has option to calculate tessellation faces.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/ED_mesh.h2
-rw-r--r--source/blender/editors/mesh/mesh_data.c13
2 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 4b43233fe40..986c2abad69 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -292,7 +292,7 @@ void ED_mesh_vertices_remove(struct Mesh *mesh, struct ReportList *reports, int
void ED_mesh_transform(struct Mesh *me, float *mat);
void ED_mesh_calc_normals(struct Mesh *me);
void ED_mesh_material_link(struct Mesh *me, struct Material *ma);
-void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges);
+void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges, int calc_tessface);
int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name, int active_set);
int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
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