[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10867] trunk/blender/source/blender/src: == Multires ==

Nicholas Bishop nicholasbishop at gmail.com
Sun Jun 3 22:24:09 CEST 2007


Revision: 10867
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10867
Author:   nicholasbishop
Date:     2007-06-03 22:24:09 +0200 (Sun, 03 Jun 2007)

Log Message:
-----------
== Multires ==

Fixed bug [#6798] Multires eventually destroys Meshes with Shapekys

* Moved the check for multires on adding shapekeys into insert_shapekeys rather than on the "Add Shape" button click

Modified Paths:
--------------
    trunk/blender/source/blender/src/buttons_editing.c
    trunk/blender/source/blender/src/editkey.c

Modified: trunk/blender/source/blender/src/buttons_editing.c
===================================================================
--- trunk/blender/source/blender/src/buttons_editing.c	2007-06-03 14:44:06 UTC (rev 10866)
+++ trunk/blender/source/blender/src/buttons_editing.c	2007-06-03 20:24:09 UTC (rev 10867)
@@ -602,11 +602,7 @@
 		break;
 	
 	case B_ADDKEY:
-		if(get_mesh(ob) && get_mesh(ob)->mr) {
-			error("Cannot create shape keys on a multires mesh.");
-		} else {
-			insert_shapekey(ob);
-		}
+		insert_shapekey(ob);
 		break;
 	case B_SETKEY:
 		ob->shapeflag |= OB_SHAPE_TEMPLOCK;

Modified: trunk/blender/source/blender/src/editkey.c
===================================================================
--- trunk/blender/source/blender/src/editkey.c	2007-06-03 14:44:06 UTC (rev 10866)
+++ trunk/blender/source/blender/src/editkey.c	2007-06-03 20:24:09 UTC (rev 10867)
@@ -67,6 +67,7 @@
 #include "BKE_key.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
+#include "BKE_mesh.h"
 #include "BKE_object.h"
 #include "BKE_utildefines.h"
 
@@ -599,21 +600,26 @@
 
 void insert_shapekey(Object *ob)
 {
-	Key *key;
+	if(get_mesh(ob) && get_mesh(ob)->mr) {
+		error("Cannot create shape keys on a multires mesh.");
+	}
+	else {
+		Key *key;
 	
-	if(ob->type==OB_MESH) insert_meshkey(ob->data, 1);
-	else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(ob->data, 1);
-	else if(ob->type==OB_LATTICE) insert_lattkey(ob->data, 1);
+		if(ob->type==OB_MESH) insert_meshkey(ob->data, 1);
+		else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(ob->data, 1);
+		else if(ob->type==OB_LATTICE) insert_lattkey(ob->data, 1);
 	
-	key= ob_get_key(ob);
-	ob->shapenr= BLI_countlist(&key->block);
+		key= ob_get_key(ob);
+		ob->shapenr= BLI_countlist(&key->block);
 	
-	allspace(REMAKEIPO, 0);
-	allqueue(REDRAWIPO, 0);
-	allqueue(REDRAWACTION, 0);
-	allqueue(REDRAWNLA, 0);
-	allqueue(REDRAWBUTSOBJECT, 0);
-	allqueue(REDRAWBUTSEDIT, 0);
+		allspace(REMAKEIPO, 0);
+		allqueue(REDRAWIPO, 0);
+		allqueue(REDRAWACTION, 0);
+		allqueue(REDRAWNLA, 0);
+		allqueue(REDRAWBUTSOBJECT, 0);
+		allqueue(REDRAWBUTSEDIT, 0);
+	}
 }
 
 void delete_key(Object *ob)





More information about the Bf-blender-cvs mailing list