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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-04-16 18:51:49 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-04-16 18:54:23 +0400
commita7120b97307d60a2c8bc4cf00f62a960b633e86d (patch)
tree2e9f4ecaf362806795b1a3922db1a4cfe0db3924 /source/blender/blenkernel/intern/customdata.c
parenteecc426d863d4a744ec97e36caf358cc9bc65422 (diff)
Fix related to new split normals draw code.
Tessellated split normals CDlayer had no swap func, hence ugly little test_index_face() could not rotate its values correctly when rotating tessellated faces... Extra-reported in T39735.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 0309e7defbe..4a76abc0154 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1070,6 +1070,19 @@ static void layerInterp_mvert_skin(void **sources, const float *weights,
vs->flag &= ~MVERT_SKIN_ROOT;
}
+static void layerSwap_flnor(void *data, const int *corner_indices)
+{
+ short (*flnors)[4][3] = data;
+ short nors[4][3];
+ int i = 4;
+
+ while (i--) {
+ copy_v3_v3_short(nors[i], (*flnors)[corner_indices[i]]);
+ }
+
+ memcpy(flnors, nors, sizeof(nors));
+}
+
static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 0: CD_MVERT */
{sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL},
@@ -1182,7 +1195,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 39: CD_MLOOPTANGENT */
{sizeof(float[4]), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 40: CD_TESSLOOPNORMAL */
- {sizeof(short[4][3]), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
+ {sizeof(short[4][3]), "", 0, NULL, NULL, NULL, NULL, layerSwap_flnor, NULL},
/* 41: CD_DYNTOPO_NODE */
{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, layerDefault_dyntopo_node},
};