Bug fix #1678
Deformed meshes (by armature for example) didn't get drawn correctly for vertex paint, weightpaint, UV faceselect. Was OK in 2.34 :) Additional to that I found out vertex paint doesn't correctly use the 'Area' option, when a mesh was deformed. That was an oldie. Plus; made tooltips for 'Area' and 'Normals' in Paint Panel clear.
This commit is contained in:
@@ -2405,9 +2405,9 @@ static void editing_panel_mesh_paint(void)
|
||||
uiDefButS(block, ROW, B_DIFF, "Filter", 1212, 80,63,19, &Gvp.mode, 1.0, 4.0, 0, 0, "Mix the colours with an alpha factor");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButS(block, TOG|BIT|1, 0, "Area", 979,50,81,19, &Gvp.flag, 0, 0, 0, 0, "Set the area the brush covers");
|
||||
uiDefButS(block, TOG|BIT|1, 0, "Area", 979,50,81,19, &Gvp.flag, 0, 0, 0, 0, "Vertex paint evaluates the area of the face the brush covers (otherwise vertices only)");
|
||||
uiDefButS(block, TOG|BIT|2, 0, "Soft", 1061,50,112,19, &Gvp.flag, 0, 0, 0, 0, "Use a soft brush");
|
||||
uiDefButS(block, TOG|BIT|3, 0, "Normals", 1174,50,102,19, &Gvp.flag, 0, 0, 0, 0, "Use vertex normal for painting");
|
||||
uiDefButS(block, TOG|BIT|3, 0, "Normals", 1174,50,102,19, &Gvp.flag, 0, 0, 0, 0, "Vertex paint applies the vertex normal before painting");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefBut(block, BUT, B_VPGAMMA, "Set", 979,30,81,19, 0, 0, 0, 0, 0, "Apply Mul and Gamma to vertex colours");
|
||||
|
@@ -4600,6 +4600,8 @@ static int bbs_mesh_solid(Object *ob, int facecol)
|
||||
MVert *mvert;
|
||||
MFace *mface;
|
||||
TFace *tface;
|
||||
DispList *dl;
|
||||
float *extverts=NULL;
|
||||
int a, totface, hastface, i;
|
||||
|
||||
mvert= me->mvert;
|
||||
@@ -4607,6 +4609,9 @@ static int bbs_mesh_solid(Object *ob, int facecol)
|
||||
tface= me->tface;
|
||||
hastface = (me->tface != NULL);
|
||||
totface= me->totface;
|
||||
|
||||
dl= find_displist(&ob->disp, DL_VERTS);
|
||||
if(dl) extverts= dl->verts;
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glmode= GL_QUADS;
|
||||
@@ -4622,10 +4627,18 @@ static int bbs_mesh_solid(Object *ob, int facecol)
|
||||
if(mface->v4) {if(glmode==GL_TRIANGLES) {glmode= GL_QUADS; glEnd(); glBegin(GL_QUADS);}}
|
||||
else {if(glmode==GL_QUADS) {glmode= GL_TRIANGLES; glEnd(); glBegin(GL_TRIANGLES);}}
|
||||
|
||||
glVertex3fv( (mvert+mface->v1)->co );
|
||||
glVertex3fv( (mvert+mface->v2)->co );
|
||||
glVertex3fv( (mvert+mface->v3)->co );
|
||||
if(mface->v4) glVertex3fv( (mvert+mface->v4)->co );
|
||||
if(extverts) {
|
||||
glVertex3fv( extverts+3*mface->v1 );
|
||||
glVertex3fv( extverts+3*mface->v2 );
|
||||
glVertex3fv( extverts+3*mface->v3 );
|
||||
if(mface->v4) glVertex3fv( extverts+3*mface->v4 );
|
||||
}
|
||||
else {
|
||||
glVertex3fv( (mvert+mface->v1)->co );
|
||||
glVertex3fv( (mvert+mface->v2)->co );
|
||||
glVertex3fv( (mvert+mface->v3)->co );
|
||||
if(mface->v4) glVertex3fv( (mvert+mface->v4)->co );
|
||||
}
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
@@ -110,9 +110,6 @@ int *indexar= NULL;
|
||||
int totwpaintundo;
|
||||
MDeformVert *wpaintundobuf=NULL;
|
||||
|
||||
/* Function prototypes */
|
||||
int calc_vp_alpha_dl(DispList *disp, MVert *mvert, int vert, short *mval);
|
||||
|
||||
/* in contradiction to cpack drawing colors, the MCOL colors (vpaint colors) are per byte!
|
||||
so not endian sensitive. Mcol = ABGR!!! so be cautious with cpack calls */
|
||||
|
||||
@@ -690,7 +687,7 @@ static int calc_vp_alpha(MVert *mvert, short *mval)
|
||||
|
||||
}
|
||||
|
||||
int calc_vp_alpha_dl(DispList *disp, MVert *mvert, int vert, short *mval)
|
||||
static int calc_vp_alpha_dl(DispList *disp, MVert *mvert, int vert, short *mval)
|
||||
/* Lets us do soft vertex painting onto a deformed mesh */
|
||||
{
|
||||
float fac, dx, dy, nor[3];
|
||||
@@ -943,6 +940,7 @@ void vertex_paint()
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
TFace *tface;
|
||||
DispList *dl;
|
||||
float mat[4][4], imat[4][4];
|
||||
unsigned int paintcol=0, *mcol, fcol1, fcol2;
|
||||
int index, alpha, totindex, total;
|
||||
@@ -1031,6 +1029,8 @@ void vertex_paint()
|
||||
}
|
||||
}
|
||||
|
||||
dl= find_displist(&ob->disp, DL_VERTS);
|
||||
|
||||
for(index=0; index<totindex; index++) {
|
||||
|
||||
if(indexar[index] && indexar[index]<=me->totface) {
|
||||
@@ -1052,17 +1052,17 @@ void vertex_paint()
|
||||
|
||||
total= 0;
|
||||
|
||||
total+= alpha= calc_vp_alpha(me->mvert+mface->v1, mval);
|
||||
total+= alpha= calc_vp_alpha_dl(dl, me->mvert, mface->v1, mval);
|
||||
if(alpha) vpaint_blend( mcol, paintcol, alpha);
|
||||
|
||||
total+= alpha= calc_vp_alpha(me->mvert+mface->v2, mval);
|
||||
total+= alpha= calc_vp_alpha_dl(dl, me->mvert, mface->v2, mval);
|
||||
if(alpha) vpaint_blend( mcol+1, paintcol, alpha);
|
||||
|
||||
total+= alpha= calc_vp_alpha(me->mvert+mface->v3, mval);
|
||||
total+= alpha= calc_vp_alpha_dl(dl, me->mvert, mface->v3, mval);
|
||||
if(alpha) vpaint_blend( mcol+2, paintcol, alpha);
|
||||
|
||||
if(mface->v4) {
|
||||
total+= alpha= calc_vp_alpha(me->mvert+mface->v4, mval);
|
||||
total+= alpha= calc_vp_alpha_dl(dl, me->mvert, mface->v4, mval);
|
||||
if(alpha) vpaint_blend( mcol+3, paintcol, alpha);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user