[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42933] trunk/blender/source/blender: more changes from bmesh into trunk (mesh mpoly strict member)

Campbell Barton ideasman42 at gmail.com
Wed Dec 28 15:21:56 CET 2011


Revision: 42933
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42933
Author:   campbellbarton
Date:     2011-12-28 14:21:51 +0000 (Wed, 28 Dec 2011)
Log Message:
-----------
more changes from bmesh into trunk (mesh mpoly strict member)

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/intern/gpu_buffers.c
    trunk/blender/source/blender/makesdna/DNA_mesh_types.h
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/source/blender/gpu/intern/gpu_buffers.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_buffers.c	2011-12-28 14:05:02 UTC (rev 42932)
+++ trunk/blender/source/blender/gpu/intern/gpu_buffers.c	2011-12-28 14:21:51 UTC (rev 42933)
@@ -701,8 +701,8 @@
 static void GPU_buffer_copy_color3(DerivedMesh *dm, float *varray_, int *index, int *mat_orig_to_new, void *user)
 {
 	int i, totface;
-	unsigned char *varray = (unsigned char *)varray_;
-	unsigned char *mcol = (unsigned char *)user;
+	char *varray = (char *)varray_;
+	char *mcol = (char *)user;
 	MFace *f = dm->getFaceArray(dm);
 
 	totface= dm->getNumFaces(dm);
@@ -710,16 +710,16 @@
 		int start = index[mat_orig_to_new[f->mat_nr]];
 
 		/* v1 v2 v3 */
-		VECCOPY(&varray[start], &mcol[i*12]);
-		VECCOPY(&varray[start+3], &mcol[i*12+3]);
-		VECCOPY(&varray[start+6], &mcol[i*12+6]);
+		copy_v3_v3_char(&varray[start], &mcol[i*12]);
+		copy_v3_v3_char(&varray[start+3], &mcol[i*12+3]);
+		copy_v3_v3_char(&varray[start+6], &mcol[i*12+6]);
 		index[mat_orig_to_new[f->mat_nr]] += 9;
 
 		if(f->v4) {
 			/* v3 v4 v1 */
-			VECCOPY(&varray[start+9], &mcol[i*12+6]);
-			VECCOPY(&varray[start+12], &mcol[i*12+9]);
-			VECCOPY(&varray[start+15], &mcol[i*12]);
+			copy_v3_v3_char(&varray[start+9], &mcol[i*12+6]);
+			copy_v3_v3_char(&varray[start+12], &mcol[i*12+9]);
+			copy_v3_v3_char(&varray[start+15], &mcol[i*12]);
 			index[mat_orig_to_new[f->mat_nr]] += 9;
 		}
 	}

Modified: trunk/blender/source/blender/makesdna/DNA_mesh_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_mesh_types.h	2011-12-28 14:05:02 UTC (rev 42932)
+++ trunk/blender/source/blender/makesdna/DNA_mesh_types.h	2011-12-28 14:21:51 UTC (rev 42933)
@@ -49,6 +49,11 @@
 struct MSticky;
 struct Mesh;
 struct OcInfo;
+struct MPoly;
+struct MTexPoly;
+struct MLoop;
+struct MLoopUV;
+struct MLoopCol;
 struct Multires;
 struct EditMesh;
 struct AnimData;
@@ -63,6 +68,17 @@
 	struct Key *key;
 	struct Material **mat;
 
+#ifdef USE_BMESH_FORWARD_COMPAT
+/* BMESH ONLY */
+	/*new face structures*/
+	struct MPoly *mpoly;
+	struct MTexPoly *mtpoly;
+	struct MLoop *mloop;
+	struct MLoopUV *mloopuv;
+	struct MLoopCol *mloopcol;
+/* END BMESH ONLY */
+#endif
+
 	struct MFace *mface;	/* array of mesh object mode faces */
 	struct MTFace *mtface;	/* store face UV's and texture here */
 	struct TFace *tface;	/* depecrated, use mtface */
@@ -78,8 +94,20 @@
 
 	struct CustomData vdata, edata, fdata;
 
+#ifdef USE_BMESH_FORWARD_COMPAT
+/* BMESH ONLY */
+	struct CustomData pdata, ldata;
+/* END BMESH ONLY */
+#endif
+
 	int totvert, totedge, totface, totselect;
-	
+
+#ifdef USE_BMESH_FORWARD_COMPAT
+/* BMESH ONLY */
+	int totpoly, totloop;
+/* END BMESH ONLY */
+#endif
+
 	/* the last selected vertex/edge/face are used for the active face however
 	 * this means the active face must always be selected, this is to keep track
 	 * of the last selected face and is similar to the old active face flag where

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2011-12-28 14:05:02 UTC (rev 42932)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2011-12-28 14:21:51 UTC (rev 42933)
@@ -1973,6 +1973,10 @@
 	else											fileflags &= ~G_FILE_COMPRESS;
 	if(RNA_boolean_get(op->ptr, "relative_remap"))	fileflags |=  G_FILE_RELATIVE_REMAP;
 	else											fileflags &= ~G_FILE_RELATIVE_REMAP;
+#ifdef USE_BMESH_SAVE_AS_COMPAT
+	if(RNA_boolean_get(op->ptr, "use_mesh_compat"))	fileflags |=  G_FILE_MESH_COMPAT;
+	else											fileflags &= ~G_FILE_MESH_COMPAT;
+#endif
 
 	if ( WM_write_file(C, path, fileflags, op->reports, copy) != 0)
 		return OPERATOR_CANCELLED;



More information about the Bf-blender-cvs mailing list