[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45718] branches/soc-2011-tomato: Merging r45708 through r45717 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Tue Apr 17 18:42:12 CEST 2012


Revision: 45718
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45718
Author:   nazgul
Date:     2012-04-17 16:42:12 +0000 (Tue, 17 Apr 2012)
Log Message:
-----------
Merging r45708 through r45717 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45708
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45717

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/templates/operator_file_import.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/editderivedmesh.c
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c
    branches/soc-2011-tomato/source/blender/editors/mesh/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_knife.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_fly.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform_ops.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_windowmanager_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_wm.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_wm_api.c
    branches/soc-2011-tomato/source/blender/windowmanager/WM_keymap.h
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_keymap.c
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_operators.c

Added Paths:
-----------
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_rip.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-45707
   + /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-45717

Modified: branches/soc-2011-tomato/release/scripts/templates/operator_file_import.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/templates/operator_file_import.py	2012-04-17 16:21:13 UTC (rev 45717)
+++ branches/soc-2011-tomato/release/scripts/templates/operator_file_import.py	2012-04-17 16:42:12 UTC (rev 45718)
@@ -7,7 +7,7 @@
     data = f.read()
     f.close()
 
-    # would normally load the data hare
+    # would normally load the data here
     print(data)
 
     return {'FINISHED'}

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c	2012-04-17 16:21:13 UTC (rev 45717)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c	2012-04-17 16:42:12 UTC (rev 45718)
@@ -2757,7 +2757,7 @@
 	fdata = tfdata = dm->getTessFaceDataLayout(dm);
 	
 	/* calc auto bump scale if necessary */
-	if (dm->auto_bump_scale<=0.0f)
+	if (dm->auto_bump_scale <= 0.0f)
 		DM_calc_auto_bump_scale(dm);
 
 	/* add a tangent layer if necessary */
@@ -2769,59 +2769,77 @@
 	for (b = 0; b < gattribs->totlayer; b++) {
 		if (gattribs->layer[b].type == CD_MTFACE) {
 			/* uv coordinates */
-			if (gattribs->layer[b].name[0])
-				layer = CustomData_get_named_layer_index(tfdata, CD_MTFACE,
-					gattribs->layer[b].name);
-			else
-				layer = CustomData_get_active_layer_index(tfdata, CD_MTFACE);
+			if(dm->type == DM_TYPE_EDITBMESH) {
+				/* exception .. */
+				CustomData *ldata = dm->getLoopDataLayout(dm);
 
-			if (layer != -1) {
-				a = attribs->tottface++;
+				if (gattribs->layer[b].name[0])
+					layer = CustomData_get_named_layer_index(ldata, CD_MLOOPUV,
+						gattribs->layer[b].name);
+				else
+					layer = CustomData_get_active_layer_index(ldata, CD_MLOOPUV);
 
-				attribs->tface[a].array = tfdata->layers[layer].data;
-				attribs->tface[a].emOffset = tfdata->layers[layer].offset;
-				attribs->tface[a].glIndex = gattribs->layer[b].glindex;
-				attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
+				if (layer != -1) {
+					a = attribs->tottface++;
+
+					attribs->tface[a].array = tfdata->layers[layer].data;
+					attribs->tface[a].emOffset = tfdata->layers[layer].offset;
+					attribs->tface[a].glIndex = gattribs->layer[b].glindex;
+					attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
+				}
 			}
-			/* BMESH_TODO - BMESH ONLY, may need to get this working?, otherwise remove */
-#if 0
 			else {
-				int player;
-				CustomData *pdata = dm->getPolyDataLayout(dm);
-				
 				if (gattribs->layer[b].name[0])
-					player = CustomData_get_named_layer_index(pdata, CD_MTEXPOLY,
+					layer = CustomData_get_named_layer_index(tfdata, CD_MTFACE,
 						gattribs->layer[b].name);
 				else
-					player = CustomData_get_active_layer_index(pdata, CD_MTEXPOLY);
-				
-				if (player != -1) {
+					layer = CustomData_get_active_layer_index(tfdata, CD_MTFACE);
+
+				if (layer != -1) {
 					a = attribs->tottface++;
-	
-					attribs->tface[a].array = NULL;
-					attribs->tface[a].emOffset = pdata->layers[layer].offset;
+
+					attribs->tface[a].array = tfdata->layers[layer].data;
+					attribs->tface[a].emOffset = tfdata->layers[layer].offset;
 					attribs->tface[a].glIndex = gattribs->layer[b].glindex;
 					attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
-					
 				}
 			}
-#endif
 		}
 		else if (gattribs->layer[b].type == CD_MCOL) {
-			/* vertex colors */
-			if (gattribs->layer[b].name[0])
-				layer = CustomData_get_named_layer_index(tfdata, CD_MCOL,
-					gattribs->layer[b].name);
-			else
-				layer = CustomData_get_active_layer_index(tfdata, CD_MCOL);
+			if(dm->type == DM_TYPE_EDITBMESH) {
+				/* exception .. */
+				CustomData *ldata = dm->getLoopDataLayout(dm);
 
-			if (layer != -1) {
-				a = attribs->totmcol++;
+				if (gattribs->layer[b].name[0])
+					layer = CustomData_get_named_layer_index(ldata, CD_MLOOPCOL,
+						gattribs->layer[b].name);
+				else
+					layer = CustomData_get_active_layer_index(ldata, CD_MLOOPCOL);
 
-				attribs->mcol[a].array = tfdata->layers[layer].data;
-				attribs->mcol[a].emOffset = tfdata->layers[layer].offset;
-				attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
+				if (layer != -1) {
+					a = attribs->totmcol++;
+
+					attribs->mcol[a].array = tfdata->layers[layer].data;
+					attribs->mcol[a].emOffset = tfdata->layers[layer].offset;
+					attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
+				}
 			}
+			else {
+				/* vertex colors */
+				if (gattribs->layer[b].name[0])
+					layer = CustomData_get_named_layer_index(tfdata, CD_MCOL,
+						gattribs->layer[b].name);
+				else
+					layer = CustomData_get_active_layer_index(tfdata, CD_MCOL);
+
+				if (layer != -1) {
+					a = attribs->totmcol++;
+
+					attribs->mcol[a].array = tfdata->layers[layer].data;
+					attribs->mcol[a].emOffset = tfdata->layers[layer].offset;
+					attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
+				}
+			}
 		}
 		else if (gattribs->layer[b].type == CD_TANGENT) {
 			/* tangents */

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/editderivedmesh.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/editderivedmesh.c	2012-04-17 16:21:13 UTC (rev 45717)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/editderivedmesh.c	2012-04-17 16:42:12 UTC (rev 45718)
@@ -1320,6 +1320,8 @@
 	ev = BM_vert_at_index(bmdm->tc->bm, index); /* warning, does list loop, _not_ ideal */
 
 	bmvert_to_mvert(bmdm->tc->bm, ev, vert_r);
+	if(bmdm->vertexCos)
+		copy_v3_v3(vert_r->co, bmdm->vertexCos[index]);
 }
 
 static void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r)
@@ -1378,13 +1380,18 @@
 
 static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r)
 {
-	BMesh *bm = ((EditDerivedBMesh *)dm)->tc->bm;
+	EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm;
+	BMesh *bm = bmdm->tc->bm;
 	BMVert *ev;
 	BMIter iter;
+	int i;
 
 	ev = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
-	for ( ; ev; ev = BM_iter_step(&iter), ++vert_r) {
-		copy_v3_v3(vert_r->co, ev->co);
+	for (i = 0 ; ev; ev = BM_iter_step(&iter), ++vert_r, ++i) {
+		if (bmdm->vertexCos)
+			copy_v3_v3(vert_r->co, bmdm->vertexCos[i]);
+		else
+			copy_v3_v3(vert_r->co, ev->co);
 
 		normal_float_to_short_v3(vert_r->no, ev->no);
 
@@ -1628,8 +1635,6 @@
 	DM_init((DerivedMesh*)bmdm, DM_TYPE_EDITBMESH, em->bm->totvert,
 		 em->bm->totedge, em->tottri, em->bm->totloop, em->bm->totface);
 
-	CustomData_from_bmeshpoly(&bmdm->dm.faceData, &em->bm->pdata, &em->bm->ldata, 0);
-
 	bmdm->dm.getVertCos = emDM_getVertCos;
 	bmdm->dm.getMinMax = emDM_getMinMax;
 

Modified: branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c
===================================================================
--- branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c	2012-04-17 16:21:13 UTC (rev 45717)
+++ branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_core.c	2012-04-17 16:42:12 UTC (rev 45718)
@@ -1864,13 +1864,14 @@
 	 * if you are tidying up code - campbell */
 	BLI_array_empty(stack);
 	BM_ITER(l, &liter, bm, BM_LOOPS_OF_VERT, v) {
-		if ((l->v == v) && (i = GET_INT_FROM_POINTER(BLI_ghash_lookup(visithash, l->e)))) {
-			BM_elem_index_set(l, i); /* would be nice to assign vert here but cant, so assign the vert index */
+		if (l->v == v) {
 			BLI_array_append(stack, (BMEdge *)l);
 		}
 	}
 	while ((l = (BMLoop *)(BLI_array_pop(stack)))) {
-		l->v = verts[BM_elem_index_get(l)];
+		if ((i = GET_INT_FROM_POINTER(BLI_ghash_lookup(visithash, l->e)))) {
+			l->v = verts[i];
+		}
 	}
 #endif
 

Modified: branches/soc-2011-tomato/source/blender/editors/mesh/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mesh/CMakeLists.txt	2012-04-17 16:21:13 UTC (rev 45717)
+++ branches/soc-2011-tomato/source/blender/editors/mesh/CMakeLists.txt	2012-04-17 16:42:12 UTC (rev 45718)
@@ -43,6 +43,7 @@
 	editmesh_bvh.c
 	editmesh_knife.c
 	editmesh_loopcut.c
+	editmesh_rip.c
 	editmesh_select.c
 	editmesh_tools.c
 	editmesh_utils.c

Modified: branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_knife.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_knife.c	2012-04-17 16:21:13 UTC (rev 45717)
+++ branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_knife.c	2012-04-17 16:42:12 UTC (rev 45718)
@@ -2817,7 +2817,7 @@
 	wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Knife Tool Modal Map");
 
 	/* this function is called for each spacetype, only needs to add map once */
-	if (keymap)
+	if (keymap && keymap->modal_items)
 		return NULL;
 
 	keymap = WM_modalkeymap_add(keyconf, "Knife Tool Modal Map", modal_items);

Copied: branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_rip.c (from rev 45717, trunk/blender/source/blender/editors/mesh/editmesh_rip.c)
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_rip.c	                        (rev 0)
+++ branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_rip.c	2012-04-17 16:42:12 UTC (rev 45718)
@@ -0,0 +1,408 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list