Commit: 8ad37b0d224fcf3eb09dd2b7def8bdcc386af1a1
Author: Bastien Montagne
Date:   Mon Apr 13 15:41:57 2015 +0200
Branches: master
https://developer.blender.org/rB8ad37b0d224fcf3eb09dd2b7def8bdcc386af1a1

Fix T44359: `mesh_normals_loop_custom_set()` would not behave correctly with 
zero-normals.

Zero-normals here are used as a shortcut to say 'use auto-computed values'.
So we have to do so in pre-process steps!

===================================================================

M       source/blender/blenkernel/intern/mesh_evaluate.c

===================================================================

diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c 
b/source/blender/blenkernel/intern/mesh_evaluate.c
index ceb9b01..bbc175f 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -1349,6 +1349,10 @@ static void mesh_normals_loop_custom_set(
                                        const int nidx = lidx;
                                        float *nor = custom_loopnors[nidx];
 
+                                       if (is_zero_v3(nor)) {
+                                               nor = lnors[nidx];
+                                       }
+
                                        if (!org_nor) {
                                                org_nor = nor;
                                        }
@@ -1408,6 +1412,10 @@ static void mesh_normals_loop_custom_set(
                                        const int nidx = use_vertices ? 
(int)mloops[lidx].v : lidx;
                                        float *nor = custom_loopnors[nidx];
 
+                                       if (is_zero_v3(nor)) {
+                                               nor = lnors[nidx];
+                                       }
+
                                        nbr_nors++;
                                        add_v3_v3(avg_nor, nor);
                                        BLI_SMALLSTACK_PUSH(clnors_data, (short 
*)r_clnors_data[lidx]);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to