Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-10-08 10:39:45 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-08 10:39:45 +0400
commitda698657cee0500f1f0cff6d4340e016dd34a94e (patch)
tree4266237eafed85cdc122da80696bc577642c8f2e /source/blender/editors/animation/keyingsets.c
parent6e43a69a8d3dc88594df6f0d15686cad8e7e6646 (diff)
Keying Sets - Bugfixes + Auto-Keyframing
* Added a new option for Auto-Keyframing which makes it only insert keyframes for the items included in the active Keying Set. This only works for Transform Auto-Keyframing so far (other tools will get it added later). The option is disabled by default. * Fixed bug where adding an 'entire' array to some KeyingSet would only start from the index of the button that the mouse was over at the time * Made some UI tweaks for Keying Sets buttons (still heaps of missing options there).
Diffstat (limited to 'source/blender/editors/animation/keyingsets.c')
-rw-r--r--source/blender/editors/animation/keyingsets.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index a9a3612b79b..afaa9e3f400 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -337,9 +337,16 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op)
if (path) {
/* set flags */
- if (all)
+ if (all) {
pflag |= KSP_FLAG_WHOLE_ARRAY;
+ /* we need to set the index for this to 0, even though it may break in some cases, this is
+ * necessary if we want the entire array for most cases to get included without the user
+ * having to worry about where they clicked
+ */
+ index= 0;
+ }
+
/* add path to this setting */
BKE_keyingset_add_destination(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME);
success= 1;
@@ -1109,6 +1116,24 @@ KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, char name[])
return NULL;
}
+
+/* Get the active Keying Set for the Scene provided */
+KeyingSet *ANIM_scene_get_active_keyingset (Scene *scene)
+{
+ if (ELEM(NULL, scene, scene->keyingsets.first))
+ return NULL;
+
+ /* currently, there are several possibilities here:
+ * - 0: no active keying set
+ * - > 0: one of the user-defined Keying Sets, but indices start from 0 (hence the -1)
+ * - < 0: a builtin keying set (XXX this isn't enabled yet so that we don't get errors on reading back files)
+ */
+ if (scene->active_keyingset > 0)
+ return BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
+ else // for now...
+ return NULL;
+}
+
/* ******************************************* */
/* KEYFRAME MODIFICATION */