diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-28 03:32:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-28 03:32:11 +0400 |
commit | 75383a79f6364391f476976caa3fd0e1e84d6d99 (patch) | |
tree | 843c48a856ba8833ff116842736d84a5f6380d2e /source | |
parent | 377475f979f730278e23eea138fbcc530df63a91 (diff) |
array modifier was adding vertices to the 'targetmap' multiple times.
this is supported by weldop but would prefer not to allow multiple keys in the map.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/operators/bmo_removedoubles.c | 5 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_array.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index dfc42d67f7d..5ab909ffb0c 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -71,6 +71,11 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot #define EDGE_COL 2 #define FACE_MARK 2 +/** + * \note with 'targetmap', multiple 'keys' are currently supported, though no callers should be using. + * (because slot maps currently use GHash without the GHASH_FLAG_ALLOW_DUPES flag set) + * + */ void bmo_weld_verts_exec(BMesh *bm, BMOperator *op) { BMIter iter, liter; diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 3478ec6e3b4..7280503bafb 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -319,8 +319,10 @@ static void merge_first_last(BMesh *bm, /* add new merge targets to weld operator */ slot_targetmap = BMO_slot_get(weld_op->slots_in, "targetmap"); BMO_ITER (v, &oiter, find_op.slots_out, "targetmap.out", 0) { - v2 = BMO_iter_map_value_p(&oiter); - BMO_slot_map_elem_insert(weld_op, slot_targetmap, v, v2); + if (!BMO_slot_map_contains(slot_targetmap, v)) { + v2 = BMO_iter_map_value_p(&oiter); + BMO_slot_map_elem_insert(weld_op, slot_targetmap, v, v2); + } } BMO_op_finish(bm, &find_op); @@ -344,7 +346,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, int *indexMap = NULL; DerivedMesh *start_cap = NULL, *end_cap = NULL; MVert *src_mvert; - BMOpSlot *slot_targetmap = NULL; /* for weldop */ + BMOpSlot *slot_targetmap = NULL; /* for weld_op */ /* need to avoid infinite recursion here */ if (amd->start_cap && amd->start_cap != ob && amd->start_cap->type == OB_MESH) |