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>2013-03-16 05:19:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-16 05:19:03 +0400
commita0351fd97e7f0f2bea153199d4cd004d6f76f034 (patch)
tree2d4a1940836b1cc253784740b0d5106d308d1085 /source/blender/blenkernel/intern/mesh_validate.c
parentdb77fdc6ff99e25c00d73d5978f64daca5ce2b30 (diff)
object converting curve/mball to a mesh would give invalid selection state (edges selected but nothing else).
add arg to BKE_mesh_calc_edges() so selecting newly created edges is optional.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_validate.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 74d3645ea66..9d16d38220a 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -774,7 +774,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
if (do_edge_recalc) {
- BKE_mesh_calc_edges(mesh, TRUE);
+ BKE_mesh_calc_edges(mesh, true, false);
}
}
@@ -914,7 +914,7 @@ int BKE_mesh_validate_dm(DerivedMesh *dm)
* \param mesh The mesh to add edges into
* \param update When true create new edges co-exist
*/
-void BKE_mesh_calc_edges(Mesh *mesh, int update)
+void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
{
CustomData edata;
EdgeHashIterator *ehi;
@@ -923,9 +923,11 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
EdgeHash *eh = BLI_edgehash_new();
int i, totedge, totpoly = mesh->totpoly;
int med_index;
+ /* select for newly created meshes which are selected [#25595] */
+ const short ed_flag = (ME_EDGEDRAW | ME_EDGERENDER) | (select ? SELECT : 0);
if (mesh->totedge == 0)
- update = FALSE;
+ update = false;
if (update) {
/* assume existing edges are valid
@@ -963,7 +965,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
}
else {
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
- med->flag = ME_EDGEDRAW | ME_EDGERENDER | SELECT; /* select for newly created meshes which are selected [#25595] */
+ med->flag = ed_flag;
}
/* store the new edge index in the hash value */