diff options
author | Chris Want <cwant@ualberta.ca> | 2004-06-05 18:59:30 +0400 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2004-06-05 18:59:30 +0400 |
commit | 37ac6859516026d5f986360812bf79347bc85181 (patch) | |
tree | b968e836447c0b8b9ff18c850ef87c85b8af137c /source/blender/src/header_action.c | |
parent | 7d6f4cd67f4414fa7a6ba0293623a7569ed6a4ac (diff) |
Fixing something else broken broke: The fix for "no action == crash"
prevented rvk editing to work in the action window.
Please not that "if (act) {" (Does the object have an action? Currently
only true for some armatures) and "if (key) {" (does the object have
rvk's keys? Currently only true for meshes) are never both true at the
same time so in the following snippet, the function foo_key() never gets
executed:
if (act) {
if (key) {
foo_key();
else
foo_bar();
}
}
Better is this:
if (key) {
foo_key();
else if (act) {
foo_bar();
}
Diffstat (limited to 'source/blender/src/header_action.c')
-rw-r--r-- | source/blender/src/header_action.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index b355efc26eb..c75c737c5c1 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -395,21 +395,19 @@ static void do_action_keymenu_transformmenu(void *arg, int event) switch(event) { case ACTMENU_KEY_TRANSFORM_MOVE: - if (act) { - if (key) { - transform_meshchannel_keys('g', key); - } else { - transform_actionchannel_keys ('g'); - } + if (key) { + transform_meshchannel_keys('g', key); + } + else if (act) { + transform_actionchannel_keys ('g'); } break; case ACTMENU_KEY_TRANSFORM_SCALE: - if (act) { - if (key) { - transform_meshchannel_keys('s', key); - } else { - transform_actionchannel_keys ('s'); - } + if (key) { + transform_meshchannel_keys('s', key); + } + else if (act) { + transform_actionchannel_keys ('s'); } break; } @@ -590,14 +588,12 @@ static void do_action_keymenu(void *arg, int event) switch(event) { case ACTMENU_KEY_DUPLICATE: - if (act) { - if (key) { - duplicate_meshchannel_keys(key); - } - else { - duplicate_actionchannel_keys(); - remake_action_ipos(act); - } + if (key) { + duplicate_meshchannel_keys(key); + } + else if (act) { + duplicate_actionchannel_keys(); + remake_action_ipos(act); } break; @@ -605,7 +601,7 @@ static void do_action_keymenu(void *arg, int event) if (key) { delete_meshchannel_keys(key); } - else { + else if (act) { delete_actionchannel_keys (); } break; |