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. | |||||
| /* ------------------- */ | /* ------------------- */ | ||||
| /* helper to update grease pencil related data */ | |||||
| static void gpencil_action_redraw(bContext *C, bAnimContext *ac) | |||||
| { | |||||
| if ((ac) && (ac->datatype == ANIMCONT_GPENCIL)) { | |||||
| BKE_gpencil_batch_cache_alldirty(); | |||||
| WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL); | |||||
| } | |||||
| } | |||||
| static int actkeys_deselectall_exec(bContext *C, wmOperator *op) | static int actkeys_deselectall_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| bAnimContext ac; | bAnimContext ac; | ||||
| Context not available. | |||||
| else | else | ||||
| deselect_action_keys(&ac, 1, SELECT_ADD); | deselect_action_keys(&ac, 1, SELECT_ADD); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection have changed */ | /* set notifier that keyframe selection have changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* apply borderselect action */ | /* apply borderselect action */ | ||||
| borderselect_action(&ac, rect, mode, selectmode); | borderselect_action(&ac, rect, mode, selectmode); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection have changed */ | /* set notifier that keyframe selection have changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| MEM_freeN((void *)data_lasso.mcords); | MEM_freeN((void *)data_lasso.mcords); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* send notifier that keyframe selection has changed */ | /* send notifier that keyframe selection has changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* apply region select action */ | /* apply region select action */ | ||||
| region_select_action_keys(&ac, &rect_fl, BEZT_OK_CHANNEL_CIRCLE, selectmode, &data); | region_select_action_keys(&ac, &rect_fl, BEZT_OK_CHANNEL_CIRCLE, selectmode, &data); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* send notifier that keyframe selection has changed */ | /* send notifier that keyframe selection has changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| else | else | ||||
| columnselect_action_keys(&ac, mode); | columnselect_action_keys(&ac, mode); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection have changed */ | /* set notifier that keyframe selection have changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* Cleanup */ | /* Cleanup */ | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection has changed */ | /* set notifier that keyframe selection has changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* perform select changes */ | /* perform select changes */ | ||||
| select_moreless_action_keys(&ac, SELMAP_MORE); | select_moreless_action_keys(&ac, SELMAP_MORE); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection has changed */ | /* set notifier that keyframe selection has changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* perform select changes */ | /* perform select changes */ | ||||
| select_moreless_action_keys(&ac, SELMAP_LESS); | select_moreless_action_keys(&ac, SELMAP_LESS); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection has changed */ | /* set notifier that keyframe selection has changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* do the selecting now */ | /* do the selecting now */ | ||||
| actkeys_select_leftright(&ac, leftright, selectmode); | actkeys_select_leftright(&ac, leftright, selectmode); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection (and channels too) have changed */ | /* set notifier that keyframe selection (and channels too) have changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); | ||||
| Context not available. | |||||
| /* select keyframe(s) based upon mouse position*/ | /* select keyframe(s) based upon mouse position*/ | ||||
| mouse_action_keys(&ac, event->mval, selectmode, column, channel); | mouse_action_keys(&ac, event->mval, selectmode, column, channel); | ||||
| /* if grease pencil, redraw first */ | |||||
| gpencil_action_redraw(C, &ac); | |||||
| /* set notifier that keyframe selection (and channels too) have changed */ | /* set notifier that keyframe selection (and channels too) have changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); | ||||
| /* for tweak grab to work */ | /* for tweak grab to work */ | ||||
| return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; | return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; | ||||
| } | } | ||||
| Context not available. | |||||