[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14262] trunk/blender/source/blender: made editmode only force smooth shading when vcols are present ( as joe suggested)

Campbell Barton ideasman42 at gmail.com
Thu Mar 27 12:52:59 CET 2008


Revision: 14262
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14262
Author:   campbellbarton
Date:     2008-03-27 12:52:58 +0100 (Thu, 27 Mar 2008)

Log Message:
-----------
made editmode only force smooth shading when vcols are present (as joe suggested)
pythons api's image.unpack() was broken

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/python/api2_2x/Image.c

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2008-03-27 11:44:36 UTC (rev 14261)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2008-03-27 11:52:58 UTC (rev 14262)
@@ -757,12 +757,16 @@
 				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 @@
 				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) {

Modified: trunk/blender/source/blender/python/api2_2x/Image.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Image.c	2008-03-27 11:44:36 UTC (rev 14261)
+++ trunk/blender/source/blender/python/api2_2x/Image.c	2008-03-27 11:52:58 UTC (rev 14262)
@@ -191,7 +191,7 @@
 	 "(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"},





More information about the Bf-blender-cvs mailing list