diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-29 17:37:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-29 17:37:16 +0400 |
commit | 0297b6c8c6102a5ef5eca03dbedfd4ff5bc04fbe (patch) | |
tree | 072642be239c8e2daebfe81e949675e688174551 /source | |
parent | 4b96f15cb30fad958adced2cf73d7bd5b245af7e (diff) |
Fix #26637: another problem with recent normals change, objects with negative
scale did not get correct render normals.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index f51ed550813..73addfb77e4 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3195,12 +3195,14 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) int end, do_autosmooth=0, totvert = 0; int use_original_normals= 0; int recalc_normals = 0; // false by default + int negative_scale; me= ob->data; mul_m4_m4m4(mat, ob->obmat, re->viewmat); invert_m4_m4(ob->imat, mat); copy_m3_m4(imat, ob->imat); + negative_scale= is_negative_m4(mat); if(me->totvert==0) return; @@ -3282,13 +3284,13 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, mvert->co); if(do_autosmooth==0) { /* autosmooth on original unrotated data to prevent differences between frames */ - ver->n[0]=mvert->no[0]; - ver->n[1]=mvert->no[1]; - ver->n[2]=mvert->no[2]; + normal_short_to_float_v3(ver->n, mvert->no); mul_m4_v3(mat, ver->co); mul_transposed_m3_v3(imat, ver->n); normalize_v3(ver->n); - negate_v3(ver->n); + + if(!negative_scale) + negate_v3(ver->n); } if(orco) { |