diff options
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 42 | ||||
-rw-r--r-- | source/blender/editors/armature/poselib.c | 16 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 13 |
3 files changed, 10 insertions, 61 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index f5396b7b173..ead5d44d393 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -4948,18 +4948,8 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op) /* perform autokeying on the bones if needed */ if (autokey) { - KeyingSet *ks; - - /* 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)) - ks = ANIM_scene_get_active_keyingset(scene); - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) - ks = ANIM_builtin_keyingset_get_named(NULL, "Available"); - else - ks = ANIM_builtin_keyingset_get_named(NULL, "Scaling"); + /* get KeyingSet to use */ + KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "Scaling"); /* insert keyframes */ ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); @@ -5027,18 +5017,8 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op) /* perform autokeying on the bones if needed */ if (autokey) { - KeyingSet *ks; - - /* 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)) - ks = ANIM_scene_get_active_keyingset(scene); - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) - ks = ANIM_builtin_keyingset_get_named(NULL, "Available"); - else - ks = ANIM_builtin_keyingset_get_named(NULL, "Location"); + /* get KeyingSet to use */ + KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "Location"); /* insert keyframes */ ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); @@ -5190,18 +5170,8 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) /* perform autokeying on the bones if needed */ if (autokey) { - KeyingSet *ks; - - /* 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)) - ks = ANIM_scene_get_active_keyingset(scene); - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) - ks = ANIM_builtin_keyingset_get_named(NULL, "Available"); - else - ks = ANIM_builtin_keyingset_get_named(NULL, "Rotation"); + /* get KeyingSet to use */ + KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "Rotation"); /* insert keyframes */ ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 5ead0d42cd2..6083616044e 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -773,21 +773,9 @@ static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData if (pchan) { if (autokeyframe_cfra_can_key(scene, &pld->ob->id)) { ListBase dsources = {NULL, NULL}; - KeyingSet *ks = NULL; - /* 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 (poselib_ks_locrotscale == NULL) - poselib_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - - if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (scene->active_keyingset)) - ks = ANIM_scene_get_active_keyingset(scene); - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) - ks = ANIM_builtin_keyingset_get_named(NULL, "Available"); - else - ks = ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); + /* get KeyingSet to use */ + KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "LocRotScale"); /* now insert the keyframe(s) using the Keying Set * 1) add datasource override for the PoseChannel diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index e2cf5876b51..b94b3e68318 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1012,18 +1012,9 @@ static int pose_paste_exec (bContext *C, wmOperator *op) /* keyframing tagging */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { ListBase dsources = {NULL, NULL}; - KeyingSet *ks = NULL; - /* 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)) - ks = ANIM_scene_get_active_keyingset(scene); - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) - ks = ANIM_builtin_keyingset_get_named(NULL, "Available"); - else - ks = ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); + /* get KeyingSet to use */ + KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "LocRotScale"); /* now insert the keyframe(s) using the Keying Set * 1) add datasource override for the PoseChannel |