Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_action/action_select.c
| Context not available. | |||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_nla.h" | #include "BKE_nla.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| Context not available. | |||||
| /* Now set the flags */ | /* Now set the flags */ | ||||
| for (ale = anim_data.first; ale; ale = ale->next) { | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| if (ale->type == ANIMTYPE_GPLAYER) | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gplayer_frame_select_set(ale->data, sel); | ED_gplayer_frame_select_set(ale->data, sel); | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) | ale->update |= ANIM_UPDATE_DEPS; | ||||
| } | |||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | |||||
| ED_masklayer_frame_select_set(ale->data, sel); | ED_masklayer_frame_select_set(ale->data, sel); | ||||
| else | } | ||||
| else { | |||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL); | ||||
| } | |||||
| } | } | ||||
| /* Cleanup */ | /* Cleanup */ | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { | for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { | ||||
| ED_gplayer_frames_select_border(gpl, rectf.xmin, rectf.xmax, selectmode); | ED_gplayer_frames_select_border(gpl, rectf.xmin, rectf.xmax, selectmode); | ||||
| } | } | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| break; | break; | ||||
| } | } | ||||
| #endif | #endif | ||||
| case ANIMTYPE_GPLAYER: | case ANIMTYPE_GPLAYER: | ||||
| { | |||||
| ED_gplayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode); | ED_gplayer_frames_select_border(ale->data, rectf.xmin, rectf.xmax, selectmode); | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| break; | break; | ||||
| } | |||||
| case ANIMTYPE_MASKDATABLOCK: | case ANIMTYPE_MASKDATABLOCK: | ||||
| { | { | ||||
| Mask *mask = ale->data; | Mask *mask = ale->data; | ||||
| Context not available. | |||||
| } | } | ||||
| /* cleanup */ | /* cleanup */ | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| case ANIMTYPE_GPLAYER: | case ANIMTYPE_GPLAYER: | ||||
| { | { | ||||
| ED_gplayer_frames_select_region(&ked, ale->data, mode, selectmode); | ED_gplayer_frames_select_region(&ked, ale->data, mode, selectmode); | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| break; | break; | ||||
| } | } | ||||
| case ANIMTYPE_MASKDATABLOCK: | case ANIMTYPE_MASKDATABLOCK: | ||||
| Context not available. | |||||
| } | } | ||||
| /* cleanup */ | /* cleanup */ | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_GPLAYER) { | else if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gplayer_frames_select_border(ale->data, min, max, SELECT_ADD); | ED_gplayer_frames_select_border(ale->data, min, max, SELECT_ADD); | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| ED_masklayer_frames_select_border(ale->data, min, max, SELECT_ADD); | ED_masklayer_frames_select_border(ale->data, min, max, SELECT_ADD); | ||||
| Context not available. | |||||
| } | } | ||||
| /* Cleanup */ | /* Cleanup */ | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| ked.f1 = ce->cfra; | ked.f1 = ce->cfra; | ||||
| /* select elements with frame number matching cfraelem */ | /* select elements with frame number matching cfraelem */ | ||||
| if (ale->type == ANIMTYPE_GPLAYER) | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_select_frame(ale->data, ce->cfra, SELECT_ADD); | ED_gpencil_select_frame(ale->data, ce->cfra, SELECT_ADD); | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) | ale->update |= ANIM_UPDATE_DEPS; | ||||
| } | |||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | |||||
| ED_mask_select_frame(ale->data, ce->cfra, SELECT_ADD); | ED_mask_select_frame(ale->data, ce->cfra, SELECT_ADD); | ||||
| else | } | ||||
| else { | |||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| /* free elements */ | /* free elements */ | ||||
| BLI_freelistN(&ked.list); | BLI_freelistN(&ked.list); | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ||||
| ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); | ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); | ||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_GPLAYER) | else if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gplayer_frames_select_border(ale->data, ked.f1, ked.f2, select_mode); | ED_gplayer_frames_select_border(ale->data, ked.f1, ked.f2, select_mode); | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) | ale->update |= ANIM_UPDATE_DEPS; | ||||
| } | |||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | |||||
| ED_masklayer_frames_select_border(ale->data, ked.f1, ked.f2, select_mode); | ED_masklayer_frames_select_border(ale->data, ked.f1, ked.f2, select_mode); | ||||
| else | } | ||||
| else { | |||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ||||
| } | |||||
| } | } | ||||
| /* Sync marker support */ | /* Sync marker support */ | ||||
| Context not available. | |||||
| } | } | ||||
| /* Cleanup */ | /* Cleanup */ | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| /* select the nominated keyframe on the given frame */ | /* select the nominated keyframe on the given frame */ | ||||
| if (ale->type == ANIMTYPE_GPLAYER) { | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_select_frame(ale->data, selx, select_mode); | ED_gpencil_select_frame(ale->data, selx, select_mode); | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| ED_mask_select_frame(ale->data, selx, select_mode); | ED_mask_select_frame(ale->data, selx, select_mode); | ||||
| Context not available. | |||||
| for (ale = anim_data.first; ale; ale = ale->next) { | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| if (ale->type == ANIMTYPE_GPLAYER) { | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_select_frame(ale->data, selx, select_mode); | ED_gpencil_select_frame(ale->data, selx, select_mode); | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| ED_mask_select_frame(ale->data, selx, select_mode); | ED_mask_select_frame(ale->data, selx, select_mode); | ||||
| } | } | ||||
| } | } | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| ked.f1 = selx; | ked.f1 = selx; | ||||
| /* select elements with frame number matching cfra */ | /* select elements with frame number matching cfra */ | ||||
| if (ale->type == ANIMTYPE_GPLAYER) | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_select_frame(ale->key_data, selx, select_mode); | ED_gpencil_select_frame(ale->key_data, selx, select_mode); | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) | ale->update |= ANIM_UPDATE_DEPS; | ||||
| } | |||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | |||||
| ED_mask_select_frame(ale->key_data, selx, select_mode); | ED_mask_select_frame(ale->key_data, selx, select_mode); | ||||
| else | } | ||||
| else { | |||||
| ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); | ||||
| } | |||||
| } | } | ||||
| /* free elements */ | /* free elements */ | ||||
| BLI_freelistN(&ked.list); | BLI_freelistN(&ked.list); | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| Context not available. | |||||
| /* select all keyframes in this channel */ | /* select all keyframes in this channel */ | ||||
| if (ale->type == ANIMTYPE_GPLAYER) { | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_select_frames(ale->data, select_mode); | ED_gpencil_select_frames(ale->data, select_mode); | ||||
| ale->update = ANIM_UPDATE_DEPS; | |||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| ED_mask_select_frames(ale->data, select_mode); | ED_mask_select_frames(ale->data, select_mode); | ||||
| Context not available. | |||||
| for (ale = anim_data.first; ale; ale = ale->next) { | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| if (ale->type == ANIMTYPE_GPLAYER) { | if (ale->type == ANIMTYPE_GPLAYER) { | ||||
| ED_gpencil_select_frames(ale->data, select_mode); | ED_gpencil_select_frames(ale->data, select_mode); | ||||
| ale->update |= ANIM_UPDATE_DEPS; | |||||
| } | } | ||||
| else if (ale->type == ANIMTYPE_MASKLAYER) { | else if (ale->type == ANIMTYPE_MASKLAYER) { | ||||
| ED_mask_select_frames(ale->data, select_mode); | ED_mask_select_frames(ale->data, select_mode); | ||||
| } | } | ||||
| } | } | ||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| /* remove active channel from list of channels for separate treatment (since it's needed later on) */ | /* remove active channel from list of channels for separate treatment (since it's needed later on) */ | ||||
| BLI_remlink(&anim_data, ale); | BLI_remlink(&anim_data, ale); | ||||
| ale->next = ale->prev = NULL; | |||||
| /* cleanup temporary lists */ | /* cleanup temporary lists */ | ||||
| BLI_dlrbTree_free(&anim_keys); | BLI_dlrbTree_free(&anim_keys); | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| /* flush tagged updates | |||||
| * NOTE: We temporarily add this channel back to the list so that this can happen | |||||
| */ | |||||
| anim_data.first = anim_data.last = ale; | |||||
| ANIM_animdata_update(ac, &anim_data); | |||||
| /* free this channel */ | /* free this channel */ | ||||
| MEM_freeN(ale); | MEM_freeN(ale); | ||||
| } | } | ||||
| Context not available. | |||||