63 if (!
STREQ(keyingset->typeinfo, keyingset_info->
idname)) {
87 if (keyingset_info->rna_ext.free) {
88 keyingset_info->rna_ext.free(keyingset_info->rna_ext.data);
98 if (
ELEM(
nullptr, keyingset,
id)) {
107 if ((
name ==
nullptr) || (
name[0] == 0)) {
131 printf(
"%s: '%s' not found\n", __func__,
name);
157 if (scene ==
nullptr) {
178 if (
ELEM(
nullptr, srna,
data,
id)) {
205 keyingset_info->
generate(keyingset_info,
C, keyingset, &
ptr);
213 if (keyingset ==
nullptr) {
231 if (keyingset_info ==
nullptr) {
237 if (!keyingset_info->
poll(keyingset_info,
C)) {
246 if (sources !=
nullptr) {
250 keyingset_info->
iter(keyingset_info,
C, keyingset);
277#define APPLY_KEYINGFLAG_OVERRIDE(kflag) \
278 if (overrides & kflag) { \
280 result |= (own_flags & kflag); \
289#undef APPLY_KEYINGFLAG_OVERRIDE
308 const char *groupname =
nullptr;
314 groupname = keyingset->
name;
317 groupname = keyingset_path->
group;
324 int array_length = array_index;
340 if (array_length == array_index) {
354 int keyed_channels = 0;
357 for (; array_index < array_length; array_index++) {
359 const std::optional<blender::StringRefNull> group = groupname ? std::optional(groupname) :
361 const std::optional<int> index = array_index >= 0 ? std::optional(array_index) :
367 {{keyingset_path->
rna_path, {}, index}},
371 path_insert_key_flags);
376 RNAPath rna_path = {keyingset_path->
rna_path, std::nullopt, array_index};
377 if (array_index < 0) {
378 rna_path.
index = std::nullopt;
380 keyed_channels +=
delete_keyframe(bmain, reports, keyingset_path->
id, rna_path, frame);
388 switch (
GS(keyingset_path->
id->
name)) {
404 return keyed_channels;
413 if (keyingset ==
nullptr) {
440 int keyed_channels = 0;
445 if (keyingset_path->id ==
nullptr) {
448 "Skipping path in keying set, as it has no ID (KS = '%s', path = '%s[%d]')",
450 keyingset_path->rna_path,
451 keyingset_path->array_index);
456 C, keyingset_path, keyingset, kflag, mode, cfra);
461 return keyed_channels;
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
static constexpr const char * ANIM_KS_AVAILABLE_ID
void BKE_keyingsets_free(struct ListBase *list)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
void BKE_keyingset_free_paths(struct KeyingSet *ks)
struct KeyingSet * BKE_keyingset_add(struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
ReportList * CTX_wm_reports(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
char * STRNCPY(char(&dst)[N], const char *src)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_ANIMATION_NO_FLUSH
@ AUTOKEY_FLAG_ONLYKEYINGSET
@ AUTOKEY_FLAG_INSERTAVAILABLE
static ListBase keyingset_type_infos
ListBase builtin_keyingsets
#define APPLY_KEYINGFLAG_OVERRIDE(kflag)
BMesh const char void * data
BPy_StructRNA * depsgraph
void append(const T &value)
void merge(const CombinedKeyingResult &other)
int get_count(const SingleKeyingResult result) const
void generate_reports(ReportList *reports, eReportType report_level=RPT_ERROR)
void MEM_freeN(void *vmemh)
static void error(const char *str)
static int insert_key_to_keying_set_path(bContext *C, KS_Path *keyingset_path, KeyingSet *keyingset, const eInsertKeyFlags insert_key_flags, const ModifyKeyMode mode, const float frame)
static void RKS_ITER_overrides_list(KeyingSetInfo *keyingset_info, bContext *C, KeyingSet *keyingset, blender::Vector< PointerRNA > &sources)
KeyingSet * builtin_keyingset_get_named(const char name[])
void relative_keyingset_add_source(blender::Vector< PointerRNA > &sources, ID *id, StructRNA *srna, void *data)
KeyingSet * scene_get_active_keyingset(const Scene *scene)
static eInsertKeyFlags keyingset_apply_keying_flags(const eInsertKeyFlags base_flags, const eInsertKeyFlags overrides, const eInsertKeyFlags own_flags)
KeyingSetInfo * keyingset_info_find_name(const char name[])
KeyingSet * get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
int delete_keyframe(Main *bmain, ReportList *reports, ID *id, const RNAPath &rna_path, float cfra)
Main Delete Key-Framing API call.
void keyingset_info_register(KeyingSetInfo *keyingset_info)
CombinedKeyingResult insert_keyframes(Main *bmain, PointerRNA *struct_pointer, std::optional< StringRefNull > channel_group, const blender::Span< RNAPath > rna_paths, std::optional< float > scene_frame, const AnimationEvalContext &anim_eval_context, eBezTriple_KeyframeType key_type, eInsertKeyFlags insert_key_flags)
Main key-frame insertion API.
void keyingset_info_unregister(Main *bmain, KeyingSetInfo *keyingset_info)
bool keyingset_find_id(KeyingSet *keyingset, ID *id)
bool is_keying_flag(const Scene *scene, eKeying_Flag flag)
int apply_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset, ModifyKeyMode mode, float cfra)
ModifyKeyReturn validate_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset)
eInsertKeyFlags get_keyframing_flags(Scene *scene)
void keyingset_infos_exit()
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
cbKeyingSet_Generate generate
cbKeyingSet_Iterator iter
std::optional< int > index
struct ToolSettings * toolsettings
void WM_main_add_notifier(uint type, void *reference)