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
Showing only changes of commit 8e7bf81db7 - Show all commits

View File

@ -331,7 +331,8 @@ bool autokeyframe_property(bContext *C,
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) ? fcu->grp->name : nullptr;
const std::optional<std::string> group = (fcu && fcu->grp) ? std::optional(fcu->grp->name) :
std::nullopt;
/* 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);