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!
This commit is contained in:
parent
17a9b05b9d
commit
8ad37b0d22
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user