diff --git a/source/blender/animrig/ANIM_keyframing.hh b/source/blender/animrig/ANIM_keyframing.hh index 77cc98aaeda..7a92252c3c8 100644 --- a/source/blender/animrig/ANIM_keyframing.hh +++ b/source/blender/animrig/ANIM_keyframing.hh @@ -132,7 +132,7 @@ bool is_autokey_on(const Scene *scene); bool is_autokey_mode(const Scene *scene, eAutokey_Mode mode); /** Check if a flag is set for auto-key-framing (per scene takes precedence). */ -bool is_autokey_flag(const Scene *scene, eAutokey_Flag flag); +bool is_autokey_flag(const Scene *scene, eKeyInsert_Flag flag); /** * Auto-keyframing feature - checks for whether anything should be done for the current frame. diff --git a/source/blender/animrig/intern/keyframing_auto.cc b/source/blender/animrig/intern/keyframing_auto.cc index da9db082a7e..41ff1b4296a 100644 --- a/source/blender/animrig/intern/keyframing_auto.cc +++ b/source/blender/animrig/intern/keyframing_auto.cc @@ -48,7 +48,7 @@ bool is_autokey_mode(const Scene *scene, const eAutokey_Mode mode) return U.autokey_mode == mode; } -bool is_autokey_flag(const Scene *scene, const eAutokey_Flag flag) +bool is_autokey_flag(const Scene *scene, const eKeyInsert_Flag flag) { if (scene) { return (scene->toolsettings->autokey_flag & flag) || (U.autokey_flag & flag); @@ -114,7 +114,7 @@ void autokeyframe_object( C, &sources, active_ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time); } - else if (is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAIL)) { + else if (is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAILABLE)) { /* Only key on available channels. */ AnimData *adt = ob->adt; ToolSettings *ts = scene->toolsettings; @@ -280,7 +280,7 @@ void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short t C, &sources, active_ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time); } /* only insert into available channels? */ - else if (blender::animrig::is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAIL)) { + else if (blender::animrig::is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAILABLE)) { if (act) { LISTBASE_FOREACH (FCurve *, fcu, &act->curves) { /* only insert keyframes for this F-Curve if it affects the current bone */ diff --git a/source/blender/editors/animation/keyframing.cc b/source/blender/editors/animation/keyframing.cc index 5e9aa0575e8..7189abf2562 100644 --- a/source/blender/editors/animation/keyframing.cc +++ b/source/blender/editors/animation/keyframing.cc @@ -83,7 +83,7 @@ eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, const bool use_autokey_m /* standard flags */ { /* visual keying */ - if (is_autokey_flag(scene, AUTOKEY_FLAG_AUTOMATKEY)) { + if (is_autokey_flag(scene, AUTOKEY_FLAG_VISUALKEY)) { flag |= INSERTKEY_MATRIX; } diff --git a/source/blender/editors/animation/keyingsets.cc b/source/blender/editors/animation/keyingsets.cc index df9dc20411a..9ae16a191e6 100644 --- a/source/blender/editors/animation/keyingsets.cc +++ b/source/blender/editors/animation/keyingsets.cc @@ -699,7 +699,7 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *tra return ANIM_scene_get_active_keyingset(scene); } - if (blender::animrig::is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAIL)) { + if (blender::animrig::is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAILABLE)) { return ANIM_builtin_keyingset_get_named(ANIM_KS_AVAILABLE_ID); } diff --git a/source/blender/editors/transform/transform_convert.cc b/source/blender/editors/transform/transform_convert.cc index 30e70c5e431..c4e1d47c606 100644 --- a/source/blender/editors/transform/transform_convert.cc +++ b/source/blender/editors/transform/transform_convert.cc @@ -1201,8 +1201,8 @@ void animrecord_check_state(TransInfo *t, ID *id) * - we're not only keying for available channels * - the option to add new actions for each round is not enabled */ - if (blender::animrig::is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAIL) == 0 && - (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) + if (blender::animrig::is_autokey_flag(scene, AUTOKEY_FLAG_INSERTAVAILABLE) == 0 && + (scene->toolsettings->autokey_flag & AUTOKEY_FLAG_LAYERED_RECORD)) { /* if playback has just looped around, * we need to add a new NLA track+strip to allow a clean pass to occur */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b53dcd8cc03..90f53d4a652 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1281,22 +1281,21 @@ typedef enum eZoomFrame_Mode { } eZoomFrame_Mode; /** - * Auto-Keying flag - * #UserDef.autokey_flag (not strictly used when autokeying only - - * is also used when keyframing these days). + * Defines how keyframes are inserted. + * Used for regular keying and auto-keying. */ -typedef enum eAutokey_Flag { - AUTOKEY_FLAG_INSERTAVAIL = (1 << 0), +typedef enum eKeyInsert_Flag { + AUTOKEY_FLAG_INSERTAVAILABLE = (1 << 0), AUTOKEY_FLAG_INSERTNEEDED = (1 << 1), - AUTOKEY_FLAG_AUTOMATKEY = (1 << 2), + AUTOKEY_FLAG_VISUALKEY = (1 << 2), AUTOKEY_FLAG_XYZ2RGB = (1 << 3), /* toolsettings->autokey_flag */ AUTOKEY_FLAG_ONLYKEYINGSET = (1 << 6), AUTOKEY_FLAG_NOWARNING = (1 << 7), AUTOKEY_FLAG_CYCLEAWARE = (1 << 8), - ANIMRECORD_FLAG_WITHNLA = (1 << 10), -} eAutokey_Flag; + AUTOKEY_FLAG_LAYERED_RECORD = (1 << 10), +} eKeyInsert_Flag; typedef enum eKeyInsertChannels { USER_ANIM_KEY_CHANNEL_LOCATION = (1 << 0), @@ -1309,7 +1308,7 @@ typedef enum eKeyInsertChannels { /** * Animation flags * #UserDef.animation_flag, used for animation flags that aren't covered by more specific flags - * (like eAutokey_Flag). + * (like eKeyInsert_Flag). */ typedef enum eUserpref_Anim_Flags { USER_ANIM_SHOW_CHANNEL_GROUP_COLORS = (1 << 0), diff --git a/source/blender/makesrna/intern/rna_scene.cc b/source/blender/makesrna/intern/rna_scene.cc index 365472fca92..6aa9d1f1bdd 100644 --- a/source/blender/makesrna/intern/rna_scene.cc +++ b/source/blender/makesrna/intern/rna_scene.cc @@ -3799,7 +3799,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) "Mode of automatic keyframe insertion for Objects, Bones and Masks"); prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, nullptr, "autokey_flag", ANIMRECORD_FLAG_WITHNLA); + RNA_def_property_boolean_sdna(prop, nullptr, "autokey_flag", AUTOKEY_FLAG_LAYERED_RECORD); RNA_def_property_ui_text( prop, "Layered", diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index c41f7fc0c22..5200b227dfe 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -5422,7 +5422,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "(default setting used for new Scenes)"); prop = RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, nullptr, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL); + RNA_def_property_boolean_sdna(prop, nullptr, "autokey_flag", AUTOKEY_FLAG_INSERTAVAILABLE); RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available F-Curves"); @@ -5449,7 +5449,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed"); prop = RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, nullptr, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY); + RNA_def_property_boolean_sdna(prop, nullptr, "autokey_flag", AUTOKEY_FLAG_VISUALKEY); RNA_def_property_ui_text( prop, "Visual Keying", "Use Visual keying automatically for constrained objects");