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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-11-21 20:48:20 +0300
committerTon Roosendaal <ton@blender.org>2005-11-21 20:48:20 +0300
commit5fa3d74d3cc771b94289756ed95586f4ac8cb48d (patch)
tree89a27070bb1fa9c33df5a3c3445de27f1fbe42f4 /source
parent125eaed8082b2f167c15f561ab68f91748988f5c (diff)
Bugfix #3153
Subdivide didn't correctly calculate new UV or vertexcolor yet.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/editmesh_tools.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c
index a9fa2c50532..e38bb8998ff 100644
--- a/source/blender/src/editmesh_tools.c
+++ b/source/blender/src/editmesh_tools.c
@@ -1373,9 +1373,10 @@ static void set_uv_vcol(EditFace *efa, float *co, float *uv, char *col)
/* interpolate */
l= 1.0+u+v;
/* outside triangle? */
- // printf("l: %f\n",l);
- if(efa->v4 && l >= 0.5) {
- // printf("outside\n");
+ /* printf("l: %f u %f v %f\n",l,u,v); */
+
+ if(efa->v4 && (v>0.001f)) { /* only check for positive v is OK, that's the diagonal */
+ /* printf("outside\n"); */
/* do it all over, but now with vertex 2 replaced with 4 */
/* calculate u and v */
@@ -1404,10 +1405,9 @@ static void set_uv_vcol(EditFace *efa, float *co, float *uv, char *col)
cp1= (char*)&(efa->tf.col[3]);
cp2= (char*)&(efa->tf.col[2]);
-
for(i=0; i<4; i++) {
- fac= (int)(l*cp2[i] - u*cp0[i] - v*cp1[i]);
- col[i]= CLAMPIS(fac, 0, 255);
+ fac= (int)(l*cp2[i] - u*cp0[i] - v*cp1[i]);
+ col[i]= CLAMPIS(fac, 0, 255);
}
} else {
// printf("inside\n");
@@ -1420,8 +1420,8 @@ static void set_uv_vcol(EditFace *efa, float *co, float *uv, char *col)
cp2= (char*)&(efa->tf.col[2]);
for(i=0; i<4; i++) {
- fac= (int)(l*cp2[i] - u*cp0[i] - v*cp1[i]);
- col[i]= CLAMPIS(fac, 0, 255);
+ fac= (int)(l*cp2[i] - u*cp0[i] - v*cp1[i]);
+ col[i]= CLAMPIS(fac, 0, 255);
}
}
}