diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-06-04 00:24:09 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-06-04 00:24:09 +0400 |
commit | 4287796f61e1b741d4205d5970d56997742032a6 (patch) | |
tree | c2bb6e87c0cf7d1f8c87eb1804193096deda01f0 /source/blender/src/editkey.c | |
parent | 0016aa9e71fb371b6f0f50f4e8fa118f8179e19e (diff) |
== 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
Diffstat (limited to 'source/blender/src/editkey.c')
-rw-r--r-- | source/blender/src/editkey.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c index 85dac9ee3c5..975f792d2b9 100644 --- a/source/blender/src/editkey.c +++ b/source/blender/src/editkey.c @@ -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_curvekey(Curve *cu, short rel) 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) |