Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_action/action_edit.c
| Show First 20 Lines • Show All 1,000 Lines • ▼ Show 20 Lines | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| changed = ED_masklayer_frames_delete((MaskLayer *)ale->data); | changed = ED_masklayer_frames_delete((MaskLayer *)ale->data); | ||||
| } | } | ||||
| else { | else { | ||||
| FCurve *fcu = (FCurve *)ale->key_data; | FCurve *fcu = (FCurve *)ale->key_data; | ||||
| AnimData *adt = ale->adt; | AnimData *adt = ale->adt; | ||||
| /* delete selected keyframes only */ | /* delete selected keyframes only */ | ||||
| changed = delete_fcurve_keys(fcu); | changed = BKE_fcurve_delete_keys_selected(fcu); | ||||
| /* Only delete curve too if it won't be doing anything anymore */ | /* Only delete curve too if it won't be doing anything anymore */ | ||||
| if (BKE_fcurve_is_empty(fcu)) { | if (BKE_fcurve_is_empty(fcu)) { | ||||
| ANIM_fcurve_delete_from_animdata(ac, adt, fcu); | ANIM_fcurve_delete_from_animdata(ac, adt, fcu); | ||||
| ale->key_data = NULL; | ale->key_data = NULL; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 450 Lines • ▼ Show 20 Lines | static void sethandles_action_keys(bAnimContext *ac, short mode) | ||||
| * Currently that's not necessary here. | * Currently that's not necessary here. | ||||
| */ | */ | ||||
| for (ale = anim_data.first; ale; ale = ale->next) { | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| FCurve *fcu = (FCurve *)ale->key_data; | FCurve *fcu = (FCurve *)ale->key_data; | ||||
| /* any selected keyframes for editing? */ | /* any selected keyframes for editing? */ | ||||
| if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) { | if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) { | ||||
| /* change type of selected handles */ | /* change type of selected handles */ | ||||
| ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, edit_cb, calchandles_fcurve); | ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, edit_cb, BKE_fcurve_handles_recalc); | ||||
| ale->update |= ANIM_UPDATE_DEFAULT; | ale->update |= ANIM_UPDATE_DEFAULT; | ||||
| } | } | ||||
| } | } | ||||
| ANIM_animdata_update(ac, &anim_data); | ANIM_animdata_update(ac, &anim_data); | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| if (ale->type == ANIMTYPE_GPLAYER) { | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_layer_snap_frames(ale->data, ac->scene, mode); | ED_gpencil_layer_snap_frames(ale->data, ac->scene, mode); | ||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| ED_masklayer_snap_frames(ale->data, ac->scene, mode); | ED_masklayer_snap_frames(ale->data, ac->scene, mode); | ||||
| } | } | ||||
| else if (adt) { | else if (adt) { | ||||
| ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0); | ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0); | ||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc); | ||||
| ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0); | ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0); | ||||
| } | } | ||||
| else { | else { | ||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc); | ||||
| } | } | ||||
| ale->update |= ANIM_UPDATE_DEFAULT; | ale->update |= ANIM_UPDATE_DEFAULT; | ||||
| } | } | ||||
| ANIM_animdata_update(ac, &anim_data); | ANIM_animdata_update(ac, &anim_data); | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| if (ale->type == ANIMTYPE_GPLAYER) { | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_layer_mirror_frames(ale->data, ac->scene, mode); | ED_gpencil_layer_mirror_frames(ale->data, ac->scene, mode); | ||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| /* TODO */ | /* TODO */ | ||||
| } | } | ||||
| else if (adt) { | else if (adt) { | ||||
| ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0); | ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0); | ||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc); | ||||
| ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0); | ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0); | ||||
| } | } | ||||
| else { | else { | ||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc); | ||||
| } | } | ||||
| ale->update |= ANIM_UPDATE_DEFAULT; | ale->update |= ANIM_UPDATE_DEFAULT; | ||||
| } | } | ||||
| ANIM_animdata_update(ac, &anim_data); | ANIM_animdata_update(ac, &anim_data); | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||