Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyingsets.c
| Show First 20 Lines • Show All 1,024 Lines • ▼ Show 20 Lines | |||||
| * Given a KeyingSet and context info (if required), | * Given a KeyingSet and context info (if required), | ||||
| * modify keyframes for the channels specified by the KeyingSet. | * modify keyframes for the channels specified by the KeyingSet. | ||||
| * This takes into account many of the different combinations of using KeyingSets. | * This takes into account many of the different combinations of using KeyingSets. | ||||
| * Returns the number of channels that keyframes were added to | * Returns the number of channels that keyframes were added to | ||||
| */ | */ | ||||
| int ANIM_apply_keyingset( | int ANIM_apply_keyingset( | ||||
| bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra) | bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | |||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ReportList *reports = CTX_wm_reports(C); | ReportList *reports = CTX_wm_reports(C); | ||||
| KS_Path *ksp; | KS_Path *ksp; | ||||
| ListBase nla_cache = {NULL, NULL}; | ListBase nla_cache = {NULL, NULL}; | ||||
| const short base_kflags = ANIM_get_keyframing_flags(scene, 1); | const short base_kflags = ANIM_get_keyframing_flags(scene, 1); | ||||
| const char *groupname = NULL; | const char *groupname = NULL; | ||||
| short kflag = 0, success = 0; | short kflag = 0, success = 0; | ||||
| ▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | for (ksp = ks->paths.first; ksp; ksp = ksp->next) { | ||||
| /* for each possible index, perform operation | /* for each possible index, perform operation | ||||
| * - assume that arraylen is greater than index | * - assume that arraylen is greater than index | ||||
| */ | */ | ||||
| for (; i < arraylen; i++) { | for (; i < arraylen; i++) { | ||||
| /* action to take depends on mode */ | /* action to take depends on mode */ | ||||
| if (mode == MODIFYKEY_MODE_INSERT) { | if (mode == MODIFYKEY_MODE_INSERT) { | ||||
| success += insert_keyframe(bmain, | success += insert_keyframe(bmain, | ||||
| depsgraph, | |||||
| reports, | reports, | ||||
| ksp->id, | ksp->id, | ||||
| act, | act, | ||||
| groupname, | groupname, | ||||
| ksp->rna_path, | ksp->rna_path, | ||||
| i, | i, | ||||
| cfra, | cfra, | ||||
| keytype, | keytype, | ||||
| Show All 35 Lines | |||||