Fix for 2-sided faces in array modifier

This commit is contained in:
Campbell Barton 2014-10-03 13:59:06 +02:00 committed by Sergey Sharybin
parent 561b52b356
commit 886cdaddbe
2 changed files with 14 additions and 0 deletions

View File

@ -3014,10 +3014,17 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
if (UNLIKELY(c == 0)) {
continue;
}
else if (UNLIKELY(c < 3)) {
STACK_DISCARD(oldl, c);
STACK_DISCARD(mloop, c);
continue;
}
mp_new = STACK_PUSH_RET_PTR(mpoly);
*mp_new = *mp;
mp_new->totloop = c;
BLI_assert(mp_new->totloop >= 3);
mp_new->loopstart = STACK_SIZE(mloop) - c;
STACK_PUSH(oldp, i);

View File

@ -64,6 +64,13 @@
stack[_i] = stack[_##stack##_index]; \
} \
} (void)0
#define STACK_DISCARD(stack, n) \
{ \
const unsigned int _n = n; \
BLI_assert(_##stack##_index >= _n); \
(void)stack; \
_##stack##_index -= _n; \
} (void)0
#ifdef __GNUC__
#define STACK_SWAP(stack_a, stack_b) { \
SWAP(typeof(stack_a), stack_a, stack_b); \