Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-06-18 10:36:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-18 11:00:47 +0300
commit6c1fdd52c12d0d8bc1e58873286c22d3693a042f (patch)
tree3ea474cd5d07f7ca33fda82339a57f9426620f20 /source/blender/render/intern/bake.c
parent3caafd24a902eb44ca4175d882899de575c3822e (diff)
Fix invalid polygon normal array access building bake data
Pre computed normals index wasn't properly aligned. Regression from 2ec00ea0c1be1ace7cd0c7b68e43cc8e87dd07c7.
Diffstat (limited to 'source/blender/render/intern/bake.c')
-rw-r--r--source/blender/render/intern/bake.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/render/intern/bake.c b/source/blender/render/intern/bake.c
index 7af6d3e234f..416d85ce1a3 100644
--- a/source/blender/render/intern/bake.c
+++ b/source/blender/render/intern/bake.c
@@ -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]);
}
}