Refactor: Rename eAutokey_Flag enum #115295

Merged
Christoph Lendenfeld merged 1 commits from ChrisLend/blender:refactor_rename_autokey_enum into main 2023-11-23 12:09:34 +01:00
8 changed files with 19 additions and 20 deletions

View File

@ -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.

View File

@ -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 */

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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 */

View File

@ -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),

View File

@ -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",

View File

@ -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");