Fix invalid polygon normal array access building bake data
Pre computed normals index wasn't properly aligned.
Regression from 2ec00ea0c1
.
This commit is contained in:
parent
3caafd24a9
commit
6c1fdd52c1
Notes:
blender-bot
2023-02-14 03:21:27 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93 Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -479,7 +479,7 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
|
|||
loop_normals = CustomData_get_layer(&me_eval->ldata, CD_NORMAL);
|
||||
}
|
||||
|
||||
const float *precomputed_normals = CustomData_get_layer(&me->pdata, CD_NORMAL);
|
||||
const float(*precomputed_normals)[3] = CustomData_get_layer(&me->pdata, CD_NORMAL);
|
||||
const bool calculate_normal = precomputed_normals ? false : true;
|
||||
|
||||
for (i = 0; i < tottri; i++) {
|
||||
|
@ -511,7 +511,7 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
|
|||
copy_v3_v3(triangles[i].normal, no);
|
||||
}
|
||||
else {
|
||||
copy_v3_v3(triangles[i].normal, &precomputed_normals[lt->poly]);
|
||||
copy_v3_v3(triangles[i].normal, precomputed_normals[lt->poly]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue