made editmode only force smooth shading when vcols are present (as joe suggested)
pythons api's image.unpack() was broken
This commit is contained in:
@@ -757,12 +757,16 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
|
||||
flag= 1;
|
||||
|
||||
if(flag != 0) { /* flag 0 == the face is hidden or invisible */
|
||||
if (flag==1 && mcol)
|
||||
cp= (unsigned char*)mcol;
|
||||
|
||||
|
||||
/* we always want smooth here since otherwise vertex colors dont interpolate */
|
||||
/* glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); */
|
||||
|
||||
if (mcol) {
|
||||
if (flag==1) {
|
||||
cp= (unsigned char*)mcol;
|
||||
}
|
||||
} else {
|
||||
glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
|
||||
}
|
||||
|
||||
glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
|
||||
if (!drawSmooth) {
|
||||
glNormal3fv(emdm->faceNos[i]);
|
||||
@@ -826,11 +830,14 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
|
||||
flag= 1;
|
||||
|
||||
if(flag != 0) { /* flag 0 == the face is hidden or invisible */
|
||||
if (flag==1 && mcol)
|
||||
cp= (unsigned char*)mcol;
|
||||
|
||||
/* we always want smooth here since otherwise vertex colors dont interpolate */
|
||||
/*glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);*/
|
||||
if (mcol) {
|
||||
if (flag==1) {
|
||||
cp= (unsigned char*)mcol;
|
||||
}
|
||||
} else {
|
||||
glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
|
||||
}
|
||||
|
||||
glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
|
||||
if (!drawSmooth) {
|
||||
|
||||
@@ -191,7 +191,7 @@ static PyMethodDef BPy_Image_methods[] = {
|
||||
"(int) - Change Image object animation speed (fps)"},
|
||||
{"save", ( PyCFunction ) Image_save, METH_NOARGS,
|
||||
"() - Write image buffer to file"},
|
||||
{"unpack", ( PyCFunction ) Image_unpack, METH_VARARGS,
|
||||
{"unpack", ( PyCFunction ) Image_unpack, METH_O,
|
||||
"(int) - Unpack image. Uses the values defined in Blender.UnpackModes."},
|
||||
{"pack", ( PyCFunction ) Image_pack, METH_NOARGS,
|
||||
"() - Pack the image"},
|
||||
|
||||
Reference in New Issue
Block a user