[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45564] trunk/blender/source/blender/bmesh /intern/bmesh_mesh_conv.c: bmesh shape key conversion.

Campbell Barton ideasman42 at gmail.com
Thu Apr 12 13:27:50 CEST 2012


Revision: 45564
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45564
Author:   campbellbarton
Date:     2012-04-12 11:27:50 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
bmesh shape key conversion.
- remove print for impossible error.
- add NULL check incase bmesh and mesh get out of sync (would crash if Basis key-block couldn't be found).

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c	2012-04-12 11:11:31 UTC (rev 45563)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c	2012-04-12 11:27:50 UTC (rev 45564)
@@ -198,9 +198,6 @@
 			bm->vdata.layers[j].uid = block->uid;
 		}
 	}
-	else if (actkey) {
-		printf("shapekey <-> mesh mismatch!\n");
-	}
 
 	CustomData_bmesh_init_pool(&bm->vdata, me->totvert, BM_VERT);
 	CustomData_bmesh_init_pool(&bm->edata, me->totedge, BM_EDGE);
@@ -764,7 +761,11 @@
 
 
 		/* editing the base key should update others */
-		if (me->key->type == KEY_RELATIVE && oldverts) {
+		if ((me->key->type == KEY_RELATIVE) && /* only need offsets for relative shape keys */
+		    (actkey   != NULL) &&              /* unlikely, but the active key may not be valid if the
+		                                        * bmesh and the mesh are out of sync */
+		    (oldverts != NULL))                /* not used here, but 'oldverts' is used later for applyig 'ofs' */
+		{
 			int act_is_basis = FALSE;
 
 			/* find if this key is a basis for any others */




More information about the Bf-blender-cvs mailing list