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>2016-02-21 08:19:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-02-21 08:20:36 +0300
commitf6c11062bc500df2b7d9ed9e83283ef5648716cb (patch)
tree6f734bbe640ac28ee48a9fedd6a86477b709eb62
parenta66bc6c0f0d477e5d67bb70d592aed94e6a748c6 (diff)
Fix uninitialized var use initializing bake data
-rw-r--r--source/blender/render/intern/source/bake_api.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c
index 63aa0d59bfa..69fd1e09a6f 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -399,8 +399,6 @@ static TriTessFace *mesh_calc_tri_tessface(
int i;
MVert *mvert;
TSpace *tspace;
- float *precomputed_normals = NULL;
- bool calculate_normal;
const int tottri = poly_to_tri_count(me->totpoly, me->totloop);
MLoopTri *looptri;
@@ -422,9 +420,6 @@ static TriTessFace *mesh_calc_tri_tessface(
DM_ensure_normals(dm);
DM_calc_loop_tangents(dm);
- precomputed_normals = dm->getPolyDataArray(dm, CD_NORMAL);
- calculate_normal = precomputed_normals ? false : true;
-
tspace = dm->getLoopDataArray(dm, CD_TANGENT);
BLI_assert(tspace);
}
@@ -435,6 +430,10 @@ static TriTessFace *mesh_calc_tri_tessface(
me->totloop, me->totpoly,
looptri);
+
+ const float *precomputed_normals = dm->getPolyDataArray(dm, CD_NORMAL);
+ const bool calculate_normal = precomputed_normals ? false : true;
+
for (i = 0; i < tottri; i++) {
const MLoopTri *lt = &looptri[i];
const MPoly *mp = &me->mpoly[lt->poly];