[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11987] branches/2-44-stable/blender/ source/blender: branches/2-44-stable

Diego Borghetti (Plumiferos) bdiego at gmail.com
Sun Sep 9 21:37:43 CEST 2007


Revision: 11987
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11987
Author:   bdiego
Date:     2007-09-09 21:37:43 +0200 (Sun, 09 Sep 2007)

Log Message:
-----------
branches/2-44-stable

Merge from trunk:
	revision 11967
	revision 11982
	revision 11986

Revision Links:
--------------
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11967
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11982
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11986

Modified Paths:
--------------
    branches/2-44-stable/blender/source/blender/blenkernel/intern/action.c
    branches/2-44-stable/blender/source/blender/blenkernel/intern/modifier.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/doc/Key.py

Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/action.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/action.c	2007-09-09 18:03:58 UTC (rev 11986)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/action.c	2007-09-09 19:37:43 UTC (rev 11987)
@@ -1069,10 +1069,10 @@
 		}
 	}
 	if(strip==NULL) {	/* extend */
-		if(stripfirst)
+		if(striplast)
+			scene_cfra= striplast->end;
+		else if(stripfirst)
 			scene_cfra= stripfirst->start;
-		else if(striplast)
-			scene_cfra= striplast->end;
 	}
 	
 	/* and now go over all strips */

Modified: branches/2-44-stable/blender/source/blender/blenkernel/intern/modifier.c
===================================================================
--- branches/2-44-stable/blender/source/blender/blenkernel/intern/modifier.c	2007-09-09 18:03:58 UTC (rev 11986)
+++ branches/2-44-stable/blender/source/blender/blenkernel/intern/modifier.c	2007-09-09 19:37:43 UTC (rev 11987)
@@ -2453,8 +2453,43 @@
 
 }
 
-static void split_single_verts(SmoothMesh *mesh)
+static int count_bridge_verts(SmoothMesh *mesh)
 {
+	int i, j, count = 0;
+
+	for(i = 0; i < mesh->num_faces; i++) {
+		SmoothFace *face = &mesh->faces[i];
+
+		for(j = 0; j < SMOOTHFACE_MAX_EDGES && face->edges[j]; j++) {
+			SmoothEdge *edge = face->edges[j];
+			SmoothEdge *next_edge;
+			SmoothVert *vert = edge->verts[1 - face->flip[j]];
+			int next = (j + 1) % SMOOTHFACE_MAX_EDGES;
+
+			/* wrap next around if at last edge */
+			if(!face->edges[next]) next = 0;
+
+			next_edge = face->edges[next];
+
+			/* if there are other faces sharing this vertex but not
+			 * these edges, the vertex will be split, so count it
+			 */
+			/* vert has to have at least one face (this one), so faces != 0 */
+			if(!edge->faces->next && !next_edge->faces->next
+			    && vert->faces->next) {
+				count++;
+			}
+		}
+	}
+
+	/* each bridge vert will be counted once per face that uses it,
+	 * so count is too high, but it's ok for now
+	 */
+	return count;
+}
+
+static void split_bridge_verts(SmoothMesh *mesh)
+{
 	int i,j;
 
 	for(i = 0; i < mesh->num_faces; i++) {
@@ -2501,6 +2536,7 @@
 	/* 2. count max number of elements to add */
 	tag_and_count_extra_edges(mesh, emd->split_angle, emd->flags, &max_edges);
 	max_verts = max_edges * 2 + mesh->max_verts;
+	max_verts += count_bridge_verts(mesh);
 	max_edges += mesh->max_edges;
 
 	/* 3. reallocate smoothmesh arrays & copy elements across */
@@ -2518,10 +2554,9 @@
 	printf("********** Post-edge-split **********\n");
 	smoothmesh_print(mesh);
 #endif
-#if 1
-	split_single_verts(mesh);
-#endif
 
+	split_bridge_verts(mesh);
+
 #ifdef EDGESPLIT_DEBUG_1
 	printf("********** Post-vert-split **********\n");
 	smoothmesh_print(mesh);

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/doc/Key.py
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/doc/Key.py	2007-09-09 18:03:58 UTC (rev 11986)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/doc/Key.py	2007-09-09 19:37:43 UTC (rev 11987)
@@ -113,9 +113,12 @@
 			 
 		
 		A word on relative shape keys; relative shape keys are not actually
-		stored as offsets to the base shape key (like you'd expect).  Instead, 
-		the additive relative offset is calculated on the fly by comparing a 
-		shape key with its base key, which is always the very first shapekey 
-		in the keyblock list.
+		stored as offsets to the base shape key (like you'd expect).  Instead,
+		each shape key stores an entire model (actually the state of the mesh 
+		vertices after exiting editmode with any given key active).
+		 
+		The additive offset for a shape key is calculated (when needed) by 
+		comparing the shape key with its base key, which is always the very 
+		first in the keyblock list.
 		"""
 





More information about the Bf-blender-cvs mailing list