diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-22 21:12:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-22 21:12:28 +0400 |
commit | e2b74dc7364a11b5328954b6a49a46cd44dfbd2e (patch) | |
tree | 34f7618f3c40f391afe28a2c88ee8a76a1c446bd /source/blender/editors | |
parent | 3ffb695b10bd85f7cd431f6144dbc2c427a365ee (diff) |
Shape Keys
Active shape key can now be changed while in edit mode. This is based
on exit/enter editmode again in the background, which is not ideal,
as that loses the undo history. But that already happened anyway when
you did exit/change-active/enter manually.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 17 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 1 |
3 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 75ae475435a..06735badebf 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1960,7 +1960,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe Object *ob; uiBlock *block= uiLayoutGetBlock(layout); uiBut *but; - uiLayout *split, *overlap, *sub; + uiLayout *split, *overlap, *sub, *row; char *name, *namebuf; int icon; @@ -1971,7 +1971,8 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe if(itemptr->type == &RNA_ShapeKey) { ob= (Object*)activeptr->data; - uiLayoutSetEnabled(sub, ob->mode != OB_MODE_EDIT); + if(ob->mode == OB_MODE_EDIT && !(ob->type == OB_MESH)) + uiLayoutSetEnabled(sub, 0); } but= uiDefButR(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activepropname, 0, 0, i, 0, 0, ""); @@ -2005,11 +2006,13 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe uiItemL(split, name, icon); - if(i == 0) uiItemL(split, "", 0); - else uiItemR(split, "", 0, itemptr, "value", 0); - if(ob->mode == OB_MODE_EDIT && !(ob->shapeflag & OB_SHAPE_EDIT_MODE)) - uiLayoutSetEnabled(split, 0); - //uiItemR(split, "", ICON_MUTE_IPO_OFF, itemptr, "mute", 0); + row= uiLayoutRow(split, 1); + if(i == 0) uiItemL(row, "", 0); + else uiItemR(row, "", 0, itemptr, "value", 0); + + if(ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH)) + uiLayoutSetActive(row, 0); + //uiItemR(row, "", ICON_MUTE_IPO_OFF, itemptr, "mute", 0); } else uiItemL(sub, name, icon); diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 408c793751b..8b9de0f6348 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -785,6 +785,7 @@ void make_editMesh(Scene *scene, Object *ob) /* undo-ing in past for previous editmode sessions gives corrupt 'keyindex' values */ undo_editmode_clear(); keyco= actkey->data; + em->shapenr= ob->shapenr; } /* make editverts */ @@ -1184,7 +1185,8 @@ void load_editMesh(Scene *scene, Object *ob) /* are there keys? */ if(me->key) { - KeyBlock *currkey, *actkey = ob_get_keyblock(ob); + KeyBlock *currkey; + KeyBlock *actkey= BLI_findlink(&me->key->block, em->shapenr-1); /* Lets reorder the key data so that things line up roughly * with the way things were before editmode */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index bd8b865a6c9..3c332fa3953 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -480,7 +480,6 @@ void ED_object_enter_editmode(bContext *C, int flag) static int editmode_toggle_exec(bContext *C, wmOperator *op) { - if(!CTX_data_edit_object(C)) ED_object_enter_editmode(C, EM_WAITCURSOR); else |