diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-09-30 15:56:39 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-09-30 15:56:39 +0400 |
commit | d6ee8a0e4d10f3a5479ce2c94b403b2f59e5c523 (patch) | |
tree | bd4e5243141f2c7c335a97aee1b23b7e1329f14d /source/blender/editors/animation/keyingsets.c | |
parent | e8465555cb18aa2d337accf5eb13e1d270af3424 (diff) |
Cleanup of Auto-Keyframing code:
Moved duplicated code out to a special new function so that this doesn't need to be copied all over for each transform op that needs this.
Diffstat (limited to 'source/blender/editors/animation/keyingsets.c')
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index d80ccf2cd29..77e0c84d2f3 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -676,6 +676,21 @@ int ANIM_scene_get_keyingset_index (Scene *scene, KeyingSet *ks) return 0; } +/* Get Keying Set to use for Auto-Keyframing some transforms */ +KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformKSName) +{ + /* get KeyingSet to use + * - use the active KeyingSet if defined (and user wants to use it for all autokeying), + * or otherwise key transforms only + */ + if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (scene->active_keyingset)) + return ANIM_scene_get_active_keyingset(scene); + else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) + return ANIM_builtin_keyingset_get_named(NULL, "Available"); + else + return ANIM_builtin_keyingset_get_named(NULL, tranformKSName); +} + /* Menu of All Keying Sets ----------------------------- */ /* Create (and show) a menu containing all the Keying Sets which can be used in the current context */ |