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 | |
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')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index e229de42006..a6981764afa 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -155,6 +155,7 @@ void ANIM_set_active_channel (bAnimContext *ac, void *data, short datatype, int case ANIMTYPE_DSMESH: { /* need to verify that this data is valid for now */ + // XXX: ale may be null! if (ale->adt) ale->adt->flag |= ADT_UI_ACTIVE; } @@ -462,7 +463,7 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA break; /* store this level as the 'old' level now */ - prevLevel= level; + prevLevel= level; // XXX: prevLevel is unused } } } @@ -1899,7 +1900,6 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * return OPERATOR_CANCELLED; /* get useful pointers from animation context data */ - scene= ac.scene; ar= ac.ar; v2d= &ar->v2d; 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 */ |