Blender V4.3
ED_keyframing.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "BLI_vector.hh"
12#include "DNA_anim_types.h"
13#include "RNA_types.hh"
14
15struct ID;
16struct Main;
17struct Scene;
18
19struct KeyingSet;
20
22struct FCurve;
23
24struct ReportList;
25struct bContext;
26
27struct EnumPropertyItem;
28struct PointerRNA;
29struct PropertyRNA;
30
31namespace blender::animrig {
32enum class ModifyKeyReturn;
33enum class ModifyKeyMode;
34} // namespace blender::animrig
35
36/* -------------------------------------------------------------------- */
47
48/* -------- */
49
59void ED_keyframes_add(FCurve *fcu, int num_keys_to_add);
60
63/* -------------------------------------------------------------------- */
67/* Forward declaration. For this struct which is declared a bit later. */
68struct ExtensionRNA;
69struct KeyingSetInfo;
70
72using cbKeyingSet_Poll = bool (*)(KeyingSetInfo *ksi, bContext *C);
76using cbKeyingSet_Generate = void (*)(KeyingSetInfo *ksi,
77 bContext *C,
78 KeyingSet *ks,
80
84
85 /* info */
87 char idname[64];
89 char name[64];
91 char description[1024]; /* #RNA_DYN_DESCR_MAX */
94
95 /* polling callbacks */
98
99 /* generate callbacks */
108
111};
112
113/* -------- */
114
119 ID *id,
120 StructRNA *srna,
121 void *data);
123
136 KeyingSet *keyingset);
137
150 KeyingSet *keyingset,
152 float cfra);
153
154/* -------- */
155
162
167
171bool ANIM_keyingset_find_id(KeyingSet *keyingset, ID *id);
172
177void ANIM_keyingset_info_register(KeyingSetInfo *keyingset_info);
182void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *keyingset_info);
183
184/* cleanup on exit */
185/* --------------- */
186
188
189/* -------- */
190
195
199int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset);
200
204KeyingSet *ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName);
205
207 const bContext *C,
209 PropertyRNA *prop,
210 const char *edit_text,
212
214 const bContext *C,
216 PropertyRNA *prop,
217 const char *edit_text,
224 PropertyRNA *prop,
225 bool *r_free);
226
237KeyingSet *ANIM_keyingset_get_from_idname(Scene *scene, const char *idname);
238
243
246/* -------------------------------------------------------------------- */
257
274
280
281/* -------- */
282
293
302 const char rna_path[],
303 int array_index,
304 eDriverFCurveCreationMode creation_mode);
305
306FCurve *alloc_driver_fcurve(const char rna_path[],
307 int array_index,
308 eDriverFCurveCreationMode creation_mode);
309
310/* -------- */
311
326 ID *dst_id,
327 const char dst_path[],
328 int dst_index,
329 ID *src_id,
330 const char src_path[],
331 int src_index,
332 short flag,
333 int driver_type,
334 short mapping_type);
335
336/* -------- */
337
344 ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type);
345
353bool ANIM_remove_driver(ID *id, const char rna_path[], int array_index);
354
355/* -------- */
356
362
368
369/* -------- */
370
375
382 ReportList *reports, ID *id, const char rna_path[], int array_index, short flag);
383
391 ReportList *reports, ID *id, const char rna_path[], int array_index, short flag);
392
393/* -------- */
394
399
403bool ANIM_driver_vars_copy(ReportList *reports, FCurve *fcu);
404
408bool ANIM_driver_vars_paste(ReportList *reports, FCurve *fcu, bool replace);
409
410/* -------- */
411
416void ANIM_copy_as_driver(ID *target_id, const char *target_path, const char *var_name);
417
420/* -------------------------------------------------------------------- */
430bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame);
431
439 PropertyRNA *prop,
440 FCurve *fcu,
441 const AnimationEvalContext *anim_eval_context);
442
451bool id_frame_has_keyframe(ID *id, float frame);
452
453/* Names for builtin keying sets so we don't confuse these with labels/text,
454 * defined in python script: `keyingsets_builtins.py`. */
455
456#define ANIM_KS_LOCATION_ID "Location"
457#define ANIM_KS_ROTATION_ID "Rotation"
458#define ANIM_KS_SCALING_ID "Scaling"
459#define ANIM_KS_LOC_ROT_SCALE_ID "LocRotScale"
460#define ANIM_KS_LOC_ROT_SCALE_CPROP_ID "LocRotScaleCProp"
461#define ANIM_KS_AVAILABLE_ID "Available"
462#define ANIM_KS_WHOLE_CHARACTER_ID "WholeCharacter"
463#define ANIM_KS_WHOLE_CHARACTER_SELECTED_ID "WholeCharacterSelected"
464
bool ANIM_driver_vars_can_paste()
Definition drivers.cc:701
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset)
KeyingSetInfo * ANIM_keyingset_info_find_name(const char name[])
void ANIM_copy_as_driver(ID *target_id, const char *target_path, const char *var_name)
Definition drivers.cc:785
bool fcurve_is_changed(PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
Lesser Keyframe Checking API call.
bool ANIM_paste_driver(ReportList *reports, ID *id, const char rna_path[], int array_index, short flag)
Main Driver Management API calls.
Definition drivers.cc:628
void ANIM_relative_keyingset_add_source(blender::Vector< PointerRNA > &sources, ID *id, StructRNA *srna, void *data)
void ANIM_keyingset_infos_exit()
bool ANIM_keyingset_find_id(KeyingSet *keyingset, ID *id)
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
bool ANIM_driver_can_paste()
Definition drivers.cc:573
KeyingSet * ANIM_keyingset_get_from_idname(Scene *scene, const char *idname)
FCurve * verify_driver_fcurve(ID *id, const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode)
Definition drivers.cc:50
bool ANIM_copy_driver(ReportList *reports, ID *id, const char rna_path[], int array_index, short flag)
Main Driver Management API calls.
Definition drivers.cc:580
bool ANIM_driver_vars_copy(ReportList *reports, FCurve *fcu)
Definition drivers.cc:708
bool ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *keyingset)
void(*)(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, PointerRNA *ptr) cbKeyingSet_Generate
void ED_keyframes_add(FCurve *fcu, int num_keys_to_add)
FCurve * alloc_driver_fcurve(const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode)
Definition drivers.cc:91
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *keyingset_info)
int ANIM_add_driver(ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type)
Main Driver Management API calls.
Definition drivers.cc:399
int ANIM_add_driver_with_target(ReportList *reports, ID *dst_id, const char dst_path[], int dst_index, ID *src_id, const char src_path[], int src_index, short flag, int driver_type, short mapping_type)
Main Driver Management API calls.
Definition drivers.cc:285
bool ANIM_driver_vars_paste(ReportList *reports, FCurve *fcu, bool replace)
Definition drivers.cc:730
void ANIM_keyingset_visit_for_search_no_poll(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame)
Lesser Keyframe Checking API call.
bool(*)(KeyingSetInfo *ksi, bContext *C) cbKeyingSet_Poll
void ANIM_drivers_copybuf_free()
Definition drivers.cc:564
eCreateDriverFlags
@ CREATEDRIVER_WITH_FMODIFIER
@ CREATEDRIVER_WITH_DEFAULT_DVAR
eCreateDriver_MappingTypes
@ CREATEDRIVER_MAPPING_NONE_ALL
@ CREATEDRIVER_MAPPING_1_N
@ CREATEDRIVER_MAPPING_NONE
@ CREATEDRIVER_MAPPING_N_N
@ CREATEDRIVER_MAPPING_1_1
void ANIM_keyingset_info_register(KeyingSetInfo *keyingset_info)
blender::animrig::ModifyKeyReturn ANIM_validate_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset)
const EnumPropertyItem prop_driver_create_mapping_types[]
Definition drivers.cc:828
void update_autoflags_fcurve(FCurve *fcu, bContext *C, ReportList *reports, PointerRNA *ptr)
Lesser Key-framing API call.
void(*)(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks) cbKeyingSet_Iterator
const EnumPropertyItem * ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
void ANIM_driver_vars_copybuf_free()
Definition drivers.cc:685
KeyingSet * ANIM_keyingset_get_from_enum_type(Scene *scene, int type)
eDriverFCurveCreationMode
@ DRIVER_FCURVE_LOOKUP_ONLY
@ DRIVER_FCURVE_KEYFRAMES
@ DRIVER_FCURVE_EMPTY
@ DRIVER_FCURVE_GENERATOR
KeyingSet * ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
void ANIM_keyingset_visit_for_search(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
KeyingSet * ANIM_builtin_keyingset_get_named(const char name[])
bool id_frame_has_keyframe(ID *id, float frame)
Main Keyframe Checking API call.
bool ANIM_remove_driver(ID *id, const char rna_path[], int array_index)
Main Driver Management API calls.
Definition drivers.cc:523
int ANIM_apply_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset, blender::animrig::ModifyKeyMode mode, float cfra)
#define C
Definition RandGen.cpp:29
Definition DNA_ID.h:413
KeyingSetInfo * prev
KeyingSetInfo * next
cbKeyingSet_Generate generate
char description[1024]
ExtensionRNA rna_ext
cbKeyingSet_Iterator iter
cbKeyingSet_Poll poll
PointerRNA * ptr
Definition wm_files.cc:4126
uint8_t flag
Definition wm_window.cc:138