/* Main call to be exported to animation editors */ void ANIM_sync_animchannels_to_data (const bContext *C) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; /* get animation context info for filtering the channels */ // TODO: check on whether we need to set the area specially instead, since active area might not be ok? if (ANIM_animdata_get_context(C, &ac) == 0) return; /* filter data */ /* NOTE: we want all channels, since we want to be able to set selection status on some of them even when collapsed */ filter= ANIMFILTER_CHANNELS; ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* flush settings as appropriate depending on the types of the channels */ for (ale= anim_data.first; ale; ale= ale->next) { switch (ale->type) { case ANIMTYPE_GROUP: animchan_sync_group(&ac, ale); break; case ANIMTYPE_FCURVE: animchan_sync_fcurve(&ac, ale); break; } } BLI_freelistN(&anim_data); }
/* Main call to be exported to animation editors */ void ANIM_sync_animchannels_to_data(const bContext *C) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; bActionGroup *active_agrp = NULL; FCurve *active_fcurve = NULL; /* get animation context info for filtering the channels */ if (ANIM_animdata_get_context(C, &ac) == 0) return; /* filter data */ /* NOTE: we want all channels, since we want to be able to set selection status on some of them even when collapsed * However, don't include duplicates so that selection statuses don't override each other */ filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS; ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* flush settings as appropriate depending on the types of the channels */ for (ale = anim_data.first; ale; ale = ale->next) { switch (ale->type) { case ANIMTYPE_GROUP: animchan_sync_group(&ac, ale, &active_agrp); break; case ANIMTYPE_FCURVE: animchan_sync_fcurve(&ac, ale, &active_fcurve); break; } } ANIM_animdata_freelist(&anim_data); }