diff options
author | Joshua Leung <aligorith@gmail.com> | 2006-11-09 11:43:27 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2006-11-09 11:43:27 +0300 |
commit | 7f0dc54f61cc5b443e2aba09d0d8c06b0c6a718c (patch) | |
tree | 4eb04a9694dd89a73f9ab4f011fb9cf20b7e4642 /source/blender/src/header_action.c | |
parent | bdadf4fc8321d6870ce1ba12b7ace13f41ddd7db (diff) |
This commit adds two of my recent animation editing related patches:
#5061 - Ipo/Action 'Cleaning'
#5071 - 'Only Needed' Keyframing Option
====================
* IPO/Action 'Cleaning':
It removes un-necessary keyframes from individual ipo curves.
- In both editors, the hotkey is currently the OKEY. Also accesable from menus of each editor.
- There is currently a 'threshold' popup. This sets the value that the cleaner uses to determine if two keys have same time/value
There are a few improvements that could still be made, such as:
- There are a few cases that it still doesn't handle yet, such as when un-needed keyframes lie on a linear line (and similiar cases). This shall be improved soon.
- Also, for some reason, after running cleaning while in ipo editor editmode, all but the active curve are hidden.
====================
* 'Only Needed' Keyframing Option:
This patch adds a new keyframing option for objects and bones. It only adds keyframes where they are needed, judging from the surrounding points on that curve.
Notes about this keyframing option:
- Works like the existing 'Avail' option, except it checks if the keyframe
is needed.
- Currently uses hardcoded threshold for determining if same value.
[quote]
/* Cases where keyframes should not be added:
* 1. Keyframe to be added bewteen two keyframes with similar values
* 2. Keyframe to be added between two keyframes with similar times
* 3. Keyframe lies at point that intersects the linear line between two
keyframes
*/
[/unquote]
Diffstat (limited to 'source/blender/src/header_action.c')
-rw-r--r-- | source/blender/src/header_action.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index 5ab3d4d3657..de4cafbe3ec 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -93,6 +93,7 @@ #define ACTMENU_KEY_DELETE 1 #define ACTMENU_KEY_BAKE 2 #define ACTMENU_KEY_SNAP 3 +#define ACTMENU_KEY_CLEAN 4 #define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP 0 #define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN 1 @@ -780,6 +781,12 @@ static void do_action_keymenu(void *arg, int event) case ACTMENU_KEY_SNAP: snap_keys_to_frame(); break; + case ACTMENU_KEY_CLEAN: + if (key) + clean_shapekeys(key); + else if (act) + clean_actionchannels(act); + break; } } @@ -816,6 +823,11 @@ static uiBlock *action_keymenu(void *arg_unused) menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, + "Clean Action|O", 0, yco-=20, + menuwidth, 19, NULL, 0.0, 0.0, 0, + ACTMENU_KEY_CLEAN, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bake Action to Ipo Keys", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_KEY_BAKE, ""); |