Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-10-15 00:19:52 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2010-10-15 00:19:52 +0400
commit7eaf56a97bf56905e2613c883694f710c7b9e472 (patch)
tree36452d2229d3e855c5689ef60271e562e9b6f1ec /source/blender
parent8ce2c26da36608873f8d674024dfd40b3de19756 (diff)
Fix #24257: Last shape key not applied as Basis shape.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/object/object_shapekey.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 7b1ab933e28..0effa01553b 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -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 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob)
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);