[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32476] trunk/blender/source/blender/ editors/object/object_shapekey.c: Fix #24257: Last shape key not applied as Basis shape.

Sergey Sharybin g.ulairi at gmail.com
Thu Oct 14 22:19:52 CEST 2010


Revision: 32476
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32476
Author:   nazgul
Date:     2010-10-14 22:19:52 +0200 (Thu, 14 Oct 2010)

Log Message:
-----------
Fix #24257: Last shape key not applied as Basis shape.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_shapekey.c

Modified: trunk/blender/source/blender/editors/object/object_shapekey.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_shapekey.c	2010-10-14 19:30:55 UTC (rev 32475)
+++ trunk/blender/source/blender/editors/object/object_shapekey.c	2010-10-14 20:19:52 UTC (rev 32476)
@@ -53,6 +53,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_object.h"
+#include "BKE_curve.h"
 
 #include "BLO_sys_types.h" // for intptr_t support
 
@@ -100,8 +101,25 @@
 
 		BLI_remlink(&key->block, kb);
 		key->totkey--;
-		if(key->refkey== kb)
+		if(key->refkey== kb) {
 			key->refkey= key->block.first;
+
+			if(key->refkey) {
+				/* apply new basis key on original data */
+				switch(ob->type) {
+					case OB_MESH:
+						key_to_mesh(key->refkey, ob->data);
+						break;
+					case OB_CURVE:
+					case OB_SURF:
+						key_to_curve(key->refkey, ob->data, BKE_curve_nurbs(ob->data));
+						break;
+					case OB_LATTICE:
+						key_to_latt(key->refkey, ob->data);
+						break;
+				}
+			}
+		}
 			
 		if(kb->data) MEM_freeN(kb->data);
 		MEM_freeN(kb);





More information about the Bf-blender-cvs mailing list