Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_channels_edit.c
| Show First 20 Lines • Show All 1,633 Lines • ▼ Show 20 Lines | static void animchannels_group_channels(bAnimContext *ac, | ||||
| AnimData *adt = adt_ref->adt; | AnimData *adt = adt_ref->adt; | ||||
| bAction *act = adt->action; | bAction *act = adt->action; | ||||
| if (act) { | if (act) { | ||||
| ListBase anim_data = {NULL, NULL}; | ListBase anim_data = {NULL, NULL}; | ||||
| int filter; | int filter; | ||||
| /* find selected F-Curves to re-group */ | /* find selected F-Curves to re-group */ | ||||
| filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL); | filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | | ||||
| ANIMFILTER_FCURVESONLY); | |||||
| ANIM_animdata_filter(ac, &anim_data, filter, adt_ref, ANIMCONT_CHANNEL); | ANIM_animdata_filter(ac, &anim_data, filter, adt_ref, ANIMCONT_CHANNEL); | ||||
| if (anim_data.first) { | if (anim_data.first) { | ||||
| bActionGroup *agrp; | bActionGroup *agrp; | ||||
| bAnimListElem *ale; | bAnimListElem *ale; | ||||
| /* create new group, which should now be part of the action */ | /* create new group, which should now be part of the action */ | ||||
| agrp = action_groups_add_new(act, name); | agrp = action_groups_add_new(act, name); | ||||
| ▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | static int animchannels_ungroup_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| /* get editor data */ | /* get editor data */ | ||||
| if (ANIM_animdata_get_context(C, &ac) == 0) { | if (ANIM_animdata_get_context(C, &ac) == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* just selected F-Curves... */ | /* just selected F-Curves... */ | ||||
| filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | | filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | | ||||
| ANIMFILTER_NODUPLIS); | ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); | ||||
| ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ||||
| for (ale = anim_data.first; ale; ale = ale->next) { | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| /* find action for this F-Curve... */ | /* find action for this F-Curve... */ | ||||
| if (ale->adt && ale->adt->action) { | if (ale->adt && ale->adt->action) { | ||||
| FCurve *fcu = (FCurve *)ale->data; | FCurve *fcu = (FCurve *)ale->data; | ||||
| bAction *act = ale->adt->action; | bAction *act = ale->adt->action; | ||||
| ▲ Show 20 Lines • Show All 683 Lines • ▼ Show 20 Lines | static int animchannels_enable_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| int filter; | int filter; | ||||
| /* get editor data */ | /* get editor data */ | ||||
| if (ANIM_animdata_get_context(C, &ac) == 0) { | if (ANIM_animdata_get_context(C, &ac) == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* filter data */ | /* filter data */ | ||||
| filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS); | filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); | ||||
| ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ||||
| /* loop through filtered data and clean curves */ | /* loop through filtered data and clean curves */ | ||||
| for (ale = anim_data.first; ale; ale = ale->next) { | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| FCurve *fcu = (FCurve *)ale->data; | FCurve *fcu = (FCurve *)ale->data; | ||||
| /* remove disabled flags from F-Curves */ | /* remove disabled flags from F-Curves */ | ||||
| fcu->flag &= ~FCURVE_DISABLED; | fcu->flag &= ~FCURVE_DISABLED; | ||||
| ▲ Show 20 Lines • Show All 983 Lines • ▼ Show 20 Lines | static bool select_anim_channel_keys(bAnimContext *ac, int channel_index, bool extend) | ||||
| bAnimListElem *ale; | bAnimListElem *ale; | ||||
| int filter; | int filter; | ||||
| bool success = false; | bool success = false; | ||||
| FCurve *fcu; | FCurve *fcu; | ||||
| int i; | int i; | ||||
| /* get the channel that was clicked on */ | /* get the channel that was clicked on */ | ||||
| /* filter channels */ | /* filter channels */ | ||||
| filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS); | filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS | | ||||
| ANIMFILTER_FCURVESONLY); | |||||
| ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); | ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); | ||||
| /* get channel from index */ | /* get channel from index */ | ||||
| ale = BLI_findlink(&anim_data, channel_index); | ale = BLI_findlink(&anim_data, channel_index); | ||||
| if (ale == NULL) { | if (ale == NULL) { | ||||
| /* channel not found */ | /* channel not found */ | ||||
| if (G.debug & G_DEBUG) { | if (G.debug & G_DEBUG) { | ||||
| printf("Error: animation channel (index = %d) not found in rename_anim_channels()\n", | printf("Error: animation channel (index = %d) not found in rename_anim_channels()\n", | ||||
| ▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines | |||||