From 601ce6a89c4f7ecc974f40c85add491a7c295c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 28 Sep 2016 13:54:57 +0200 Subject: POSELIB_OT_pose_add: only create keyframes for selected bones. Previously the pose library used the WholeCharacter key set, which ignores selection and add keys for almost all bones in the rig. This is a very slow operation on complex rigs. With this patch, only selected bones are keyed, defaulting to keying all bones when none are selected. Note that this fixes the FIXME previously mentioned in the source. --- source/blender/editors/armature/pose_lib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 4af7f3f8727..9309592bb46 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -461,7 +461,7 @@ static int poselib_add_exec(bContext *C, wmOperator *op) bAction *act = poselib_validate(ob); bPose *pose = (ob) ? ob->pose : NULL; TimeMarker *marker; - KeyingSet *ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_WHOLE_CHARACTER_ID); /* this includes custom props :)*/ + KeyingSet *ks; int frame = RNA_int_get(op->ptr, "frame"); char name[64]; @@ -495,8 +495,7 @@ static int poselib_add_exec(bContext *C, wmOperator *op) BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name)); /* use Keying Set to determine what to store for the pose */ - /* FIXME: in the past, the Keying Set respected selections (LocRotScale), but the current one doesn't - * (WholeCharacter) so perhaps we need either a new Keying Set, or just to add overrides here... */ + ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_WHOLE_CHARACTER_SELECTED_ID); /* this includes custom props :)*/ ANIM_apply_keyingset(C, NULL, act, ks, MODIFYKEY_MODE_INSERT, (float)frame); /* store new 'active' pose number */ -- cgit v1.2.3