diff options
-rw-r--r-- | release/scripts/ui/space_time.py | 1 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 6 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 5 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 12 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 4 |
10 files changed, 33 insertions, 22 deletions
diff --git a/release/scripts/ui/space_time.py b/release/scripts/ui/space_time.py index 8d2eb811fe8..c1293e87c85 100644 --- a/release/scripts/ui/space_time.py +++ b/release/scripts/ui/space_time.py @@ -80,6 +80,7 @@ class TIME_HT_header(bpy.types.Header): row = layout.row(align=True) row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True) + row.prop(tools, "use_keyframe_insert_keyingset", text="", toggle=True) if screen.is_animation_playing and tools.use_keyframe_insert_auto: subsub = row.row() subsub.prop(tools, "use_record_with_nla", toggle=True) diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index b779250995e..d535481d154 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -88,15 +88,15 @@ short ANIM_get_keyframing_flags (Scene *scene, short incl_mode) /* standard flags */ { /* visual keying */ - if (IS_AUTOKEY_FLAG(AUTOMATKEY)) + if (IS_AUTOKEY_FLAG(scene, AUTOMATKEY)) flag |= INSERTKEY_MATRIX; /* only needed */ - if (IS_AUTOKEY_FLAG(INSERTNEEDED)) + if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) flag |= INSERTKEY_NEEDED; /* default F-Curve color mode - RGB from XYZ indices */ - if (IS_AUTOKEY_FLAG(XYZ2RGB)) + if (IS_AUTOKEY_FLAG(scene, XYZ2RGB)) flag |= INSERTKEY_XYZ2RGB; } diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 24bd5b3ec5e..2df7d21e907 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -308,7 +308,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op) keyingflag |= ANIM_get_keyframing_flags(scene, 0); - if (IS_AUTOKEY_FLAG(XYZ2RGB)) + if (IS_AUTOKEY_FLAG(scene, XYZ2RGB)) keyingflag |= INSERTKEY_XYZ2RGB; /* call the API func, and set the active keyingset index */ @@ -680,9 +680,9 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformK * - 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)) + if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (scene->active_keyingset)) return ANIM_scene_get_active_keyingset(scene); - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) + else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) return ANIM_builtin_keyingset_get_named(NULL, "Available"); else return ANIM_builtin_keyingset_get_named(NULL, tranformKSName); diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 72e87e2c9bc..3fea3fa03a5 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -259,8 +259,12 @@ short ANIM_paste_driver(struct ReportList *reports, struct ID *id, const char rn #define IS_AUTOKEY_ON(scene) ((scene) ? (scene->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON)) /* check the mode for auto-keyframing (per scene takes presidence) */ #define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->toolsettings->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode)) - /* check if a flag is set for auto-keyframing (as userprefs only!) */ -#define IS_AUTOKEY_FLAG(flag) (U.autokey_flag & AUTOKEY_FLAG_##flag) + /* check if a flag is set for auto-keyframing (per scene takes presidence) */ +#define IS_AUTOKEY_FLAG(scene, flag) \ + ((scene)? \ + ((scene->toolsettings->autokey_flag & AUTOKEY_FLAG_##flag) || (U.autokey_flag & AUTOKEY_FLAG_##flag)) \ + : \ + (U.autokey_flag & AUTOKEY_FLAG_##flag)) /* auto-keyframing feature - checks for whether anything should be done for the current frame */ int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 3a29419074b..52e9a395c4e 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1511,6 +1511,11 @@ void init_userdef_do_versions(void) } } + if (bmain->versionfile < 257) { + /* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */ + U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET; + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ac876a23ade..86da5e0a4b5 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4586,13 +4586,13 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, /* add datasource override for the camera object */ ANIM_relative_keyingset_add_source(&dsources, id, NULL, NULL); - if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (active_ks)) { + if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) { /* only insert into active keyingset * NOTE: we assume here that the active Keying Set does not need to have its iterator overridden spe */ ANIM_apply_keyingset(C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); } - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { + else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) { AnimData *adt= ob->adt; /* only key on available channels */ @@ -4603,7 +4603,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, } } } - else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) { + else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { short doLoc=0, doRot=0, doScale=0; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ @@ -4700,12 +4700,12 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o ANIM_relative_keyingset_add_source(&dsources, id, &RNA_PoseBone, pchan); /* only insert into active keyingset? */ - if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (active_ks)) { + if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) { /* run the active Keying Set on the current datasource */ ANIM_apply_keyingset(C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); } /* only insert into available channels? */ - else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { + else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) { if (act) { for (fcu= act->curves.first; fcu; fcu= fcu->next) { /* only insert keyframes for this F-Curve if it affects the current bone */ @@ -4724,7 +4724,7 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o } } /* only insert keyframe if needed? */ - else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) { + else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { short doLoc=0, doRot=0, doScale=0; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 839e813f1ae..85a7526b7b4 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -269,7 +269,7 @@ static void animrecord_check_state (Scene *scene, ID *id, wmTimer *animtimer) * - we're not only keying for available channels * - the option to add new actions for each round is not enabled */ - if (IS_AUTOKEY_FLAG(INSERTAVAIL)==0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) { + if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)==0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) { /* if playback has just looped around, we need to add a new NLA track+strip to allow a clean pass to occur */ if ((sad) && (sad->flag & ANIMPLAY_FLAG_JUMPED)) { AnimData *adt= BKE_animdata_from_id(id); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 6840da9638d..d8ab447b93a 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -492,9 +492,9 @@ extern UserDef U; /* from blenkernel blender.c */ #define AUTOKEY_FLAG_INSERTNEEDED (1<<1) #define AUTOKEY_FLAG_AUTOMATKEY (1<<2) #define AUTOKEY_FLAG_XYZ2RGB (1<<3) - /* U.autokey_flag (strictly autokeying only) */ + +/* toolsettings->autokey_flag */ #define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6) - /* toolsettings->autokey_flag */ #define ANIMRECORD_FLAG_WITHNLA (1<<10) /* transopts */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index d0c7bc3ca2b..21c125c8fcc 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1159,7 +1159,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA); RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking"); - + + prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET); + RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only"); + RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon + /* UV */ prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 90124e5f376..e080b735048 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2185,10 +2185,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL); RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves"); - prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET); - RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set"); - /* keyframing settings */ prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED); |