From df5e551535d3954e6e46a9367f8c9b77e29946f4 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 27 Mar 2012 13:08:40 +0000 Subject: Fix bug 30697, strange shading on array modifier with offset object. * An offset object can rotate output, so need to update normals to reflect that. Fix by adding a normals recalc, but only if there's an offset object. * Added BMESH_TODO comment to check whether there are other cases were normals need to be updated. --- source/blender/modifiers/intern/MOD_array.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/modifiers/intern') diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 4304b617d77..4bfe63dcaac 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -409,6 +409,15 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, BLI_assert(em->looptris == NULL); result = CDDM_from_BMEditMesh(em, NULL, FALSE, FALSE); + if ((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)) { + /* Update normals in case offset object has rotation. */ + + /* BMESH_TODO: check if normal recalc needed under any other + conditions? */ + + CDDM_calc_normals(result); + } + BMEdit_Free(em); MEM_freeN(em); if (indexMap) -- cgit v1.2.3