Refactor: combine insert_keyframe() and insert_key_rna() into a single function #122053

Merged
Nathan Vegdahl merged 49 commits from nathanvegdahl/blender:combine_keying_functions into main 2024-06-11 16:43:08 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 843c499925 - Show all commits

View File

@ -329,10 +329,10 @@ bool autokeyframe_property(bContext *C,
BLI_assert((fcu->array_index == rnaindex) || (rnaindex == -1));
}
const std::string path = fcu ? fcu->rna_path :
RNA_path_from_ID_to_property(ptr, prop).value_or("");
const std::optional<std::string> group = (fcu && fcu->grp) ? std::optional(fcu->grp->name) :
std::nullopt;
const std::string path = fcu ? fcu->rna_path :
RNA_path_from_ID_to_property(ptr, prop).value_or("");
/* NOTE: `rnaindex == -1` is a magic number, meaning either "operate on
* all elements" or "not an array property". */
const std::optional<int> array_index = rnaindex < 0 ? std::nullopt : std::optional(rnaindex);

View File

@ -754,11 +754,11 @@ TEST_F(KeyframingTest, insert_keyframes__layered_action__only_needed)
}
/* ------------------------------------------------------------
* Tests for `insert_key_rna()` with legacy actions.
* Tests for `insert_keyframes()` with legacy actions.
*/
/* Keying a non-array property. */
TEST_F(KeyframingTest, insert_key_rna__legacy_action__non_array_property)
TEST_F(KeyframingTest, insert_keyframes__legacy_action__non_array_property)
{
AnimationEvalContext anim_eval_context = {nullptr, 1.0};