Blender V4.5
nla_select.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors, Joshua Leung. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstring>
10
11#include "DNA_anim_types.h"
12#include "DNA_scene_types.h"
13
14#include "MEM_guardedalloc.h"
15
16#include "BLI_listbase.h"
17
18#include "BKE_nla.hh"
19
20#include "ED_anim_api.hh"
21#include "ED_keyframes_edit.hh"
22#include "ED_screen.hh"
23#include "ED_select_utils.hh"
24
25#include "RNA_access.hh"
26#include "RNA_define.hh"
27
28#include "WM_api.hh"
29#include "WM_types.hh"
30
31#include "UI_view2d.hh"
32
33#include "nla_intern.hh" /* own include */
34
35/* ******************** Utilities ***************************************** */
36
37/* Convert SELECT_* flags to ACHANNEL_SETFLAG_* flags */
38static short selmodes_to_flagmodes(short sel)
39{
40 /* convert selection modes to selection modes */
41 switch (sel) {
42 case SELECT_SUBTRACT:
44
45 case SELECT_INVERT:
47
48 case SELECT_ADD:
49 default:
51 }
52}
53
54/* ******************** Deselect All Operator ***************************** */
55/* This operator works in one of three ways:
56 * 1) (de)select all (AKEY) - test if select all or deselect all
57 * 2) invert all (CTRL-IKEY) - invert selection of all keyframes
58 * 3) (de)select all - no testing is done; only for use internal tools as normal function...
59 */
60
61enum {
65} /*eDeselectNlaStrips*/;
66
67/* Deselects strips in the NLA Editor
68 * - This is called by the deselect all operator, as well as other ones!
69 *
70 * - test: check if select or deselect all (1) or clear all active (2)
71 * - sel: how to select keyframes
72 * 0 = deselect
73 * 1 = select
74 * 2 = invert
75 */
76static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
77{
78 ListBase anim_data = {nullptr, nullptr};
79 short smode;
80
81 /* determine type-based settings */
83
84 /* filter data */
85 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
86
87 /* See if we should be selecting or deselecting */
88 if (test == DESELECT_STRIPS_TEST) {
89 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
90 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
91
92 /* if any strip is selected, break out, since we should now be deselecting */
93 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
94 if (strip->flag & NLASTRIP_FLAG_SELECT) {
95 sel = SELECT_SUBTRACT;
96 break;
97 }
98 }
99
100 if (sel == SELECT_SUBTRACT) {
101 break;
102 }
103 }
104 }
105
106 /* convert selection modes to selection modes */
107 smode = selmodes_to_flagmodes(sel);
108
109 /* Now set the flags */
110 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
111 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
112
113 /* apply same selection to all strips */
114 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
115 /* set selection */
116 if (test != DESELECT_STRIPS_CLEARACTIVE) {
118 }
119
120 /* clear active flag */
121 /* TODO: for clear active,
122 * do we want to limit this to only doing this on a certain set of tracks though? */
123 strip->flag &= ~NLASTRIP_FLAG_ACTIVE;
124 }
125 }
126
127 /* Cleanup */
128 ANIM_animdata_freelist(&anim_data);
129}
130
131/* ------------------- */
132
134{
135 bAnimContext ac;
136
137 /* get editor data */
138 if (ANIM_animdata_get_context(C, &ac) == 0) {
139 return OPERATOR_CANCELLED;
140 }
141
142 /* 'standard' behavior - check if selected, then apply relevant selection */
143 const int action = RNA_enum_get(op->ptr, "action");
144 switch (action) {
145 case SEL_TOGGLE:
147 break;
148 case SEL_SELECT:
150 break;
151 case SEL_DESELECT:
153 break;
154 case SEL_INVERT:
156 break;
157 default:
158 BLI_assert(0);
159 break;
160 }
161
162 /* set notifier that things have changed */
164
165 return OPERATOR_FINISHED;
166}
167
169{
170 /* identifiers */
171 ot->name = "(De)select All";
172 ot->idname = "NLA_OT_select_all";
173 ot->description = "Select or deselect all NLA-Strips";
174
175 /* API callbacks. */
178
179 /* flags */
180 ot->flag = OPTYPE_REGISTER /*|OPTYPE_UNDO*/;
181
182 /* properties */
184}
185
186/* ******************** Box Select Operator **************************** */
195
196/* defines for box_select mode */
197enum {
201} /* eNLAEDIT_BoxSelect_Mode */;
202
203static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode)
204{
205 ListBase anim_data = {nullptr, nullptr};
206
207 SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac->sl);
208 View2D *v2d = &ac->region->v2d;
209 rctf rectf;
210
211 /* convert border-region to view coordinates */
212 UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin + 2, &rectf.xmin, &rectf.ymin);
213 UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax - 2, &rectf.xmax, &rectf.ymax);
214
215 /* filter data */
218 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
219
220 /* convert selection modes to selection modes */
221 selectmode = selmodes_to_flagmodes(selectmode);
222
223 /* loop over data, doing box select */
224 float ymax = NLATRACK_FIRST_TOP(ac);
225 for (bAnimListElem *ale = static_cast<bAnimListElem *>(anim_data.first); ale;
226 ale = ale->next, ymax -= NLATRACK_STEP(snla))
227 {
228 float ymin = ymax - NLATRACK_HEIGHT(snla);
229
230 /* perform vertical suitability check (if applicable) */
231 if ((mode == NLA_BOXSEL_FRAMERANGE) || !((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
232 /* loop over data selecting (only if NLA-Track) */
233 if (ale->type == ANIMTYPE_NLATRACK) {
234 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
235
236 /* only select strips if they fall within the required ranges (if applicable) */
237 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
238 if ((mode == NLA_BOXSEL_CHANNELS) ||
239 BKE_nlastrip_within_bounds(strip, rectf.xmin, rectf.xmax))
240 {
241 /* set selection */
242 ACHANNEL_SET_FLAG(strip, selectmode, NLASTRIP_FLAG_SELECT);
243
244 /* clear active flag */
245 strip->flag &= ~NLASTRIP_FLAG_ACTIVE;
246 }
247 }
248 }
249 }
250 }
251
252 /* cleanup */
253 ANIM_animdata_freelist(&anim_data);
254}
255
256/* ------------------- */
257
259 bAnimContext *ac, float region_x, float region_y, bAnimListElem **r_ale, NlaStrip **r_strip)
260{
261 *r_ale = nullptr;
262 *r_strip = nullptr;
263
264 SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac->sl);
265 View2D *v2d = &ac->region->v2d;
266
267 float view_x, view_y;
268 int track_index;
269 UI_view2d_region_to_view(v2d, region_x, region_y, &view_x, &view_y);
271 0, NLATRACK_STEP(snla), 0, NLATRACK_FIRST_TOP(ac), view_x, view_y, nullptr, &track_index);
272
273 ListBase anim_data = {nullptr, nullptr};
276 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
277
278 /* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click
279 * (that is the size of keyframe icons, so user should be expecting similar tolerances)
280 */
281 const float mouse_x = UI_view2d_region_to_view_x(v2d, region_x);
282 const float xmin = UI_view2d_region_to_view_x(v2d, region_x - 7);
283 const float xmax = UI_view2d_region_to_view_x(v2d, region_x + 7);
284
285 bAnimListElem *ale = static_cast<bAnimListElem *>(BLI_findlink(&anim_data, track_index));
286 if (ale != nullptr) {
287 if (ale->type == ANIMTYPE_NLATRACK) {
288 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
289 float best_distance = MAXFRAMEF;
290
291 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
292 if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
293 const float distance = BKE_nlastrip_distance_to_frame(strip, mouse_x);
294
295 /* Skip if strip is further away from mouse cursor than any previous strip. */
296 if (distance > best_distance) {
297 continue;
298 }
299
300 *r_ale = ale;
301 *r_strip = strip;
302 best_distance = distance;
303
304 BLI_remlink(&anim_data, ale);
305
306 /* Mouse cursor was directly on strip, no need to check other strips. */
307 if (distance == 0.0f) {
308 break;
309 }
310 }
311 }
312 }
313 }
314
315 ANIM_animdata_freelist(&anim_data);
316}
317
318static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2])
319{
320 bAnimListElem *ale;
321 NlaStrip *strip;
322 nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
323
324 if (ale != nullptr) {
325 BLI_assert(strip != nullptr);
326 MEM_freeN(ale);
327 return true;
328 }
329 return false;
330}
331
333 wmOperator *op,
334 const wmEvent *event)
335{
336 bAnimContext ac;
337 if (ANIM_animdata_get_context(C, &ac) == 0) {
338 return OPERATOR_CANCELLED;
339 }
340
341 bool tweak = RNA_boolean_get(op->ptr, "tweak");
342 if (tweak && nlaedit_mouse_is_over_strip(&ac, event->mval)) {
344 }
345 return WM_gesture_box_invoke(C, op, event);
346}
347
349{
350 bAnimContext ac;
351 rcti rect;
352 short mode = 0;
353
354 /* get editor data */
355 if (ANIM_animdata_get_context(C, &ac) == 0) {
356 return OPERATOR_CANCELLED;
357 }
358
359 const eSelectOp sel_op = eSelectOp(RNA_enum_get(op->ptr, "mode"));
360 const int selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT;
361 if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
363 }
364
365 /* get settings from operator */
367
368 /* selection 'mode' depends on whether box_select region only matters on one axis */
369 if (RNA_boolean_get(op->ptr, "axis_range")) {
370 /* mode depends on which axis of the range is larger to determine which axis to use.
371 * - Checking this in region-space is fine,
372 * as it's fundamentally still going to be a different rect size.
373 * - The frame-range select option is favored over the track one (x over y),
374 * as frame-range one is often.
375 * Used for tweaking timing when "blocking", while tracks is not that useful.
376 */
377 if (BLI_rcti_size_x(&rect) >= BLI_rcti_size_y(&rect)) {
379 }
380 else {
381 mode = NLA_BOXSEL_CHANNELS;
382 }
383 }
384 else {
386 }
387
388 /* apply box_select action */
389 box_select_nla_strips(&ac, rect, mode, selectmode);
390
391 /* set notifier that things have changed */
393
394 return OPERATOR_FINISHED;
395}
396
398{
399 /* identifiers */
400 ot->name = "Box Select";
401 ot->idname = "NLA_OT_select_box";
402 ot->description = "Use box selection to grab NLA-Strips";
403
404 /* API callbacks. */
407 ot->modal = WM_gesture_box_modal;
408 ot->cancel = WM_gesture_box_cancel;
409
411
412 /* flags */
413 ot->flag = OPTYPE_UNDO;
414
415 /* properties */
416 RNA_def_boolean(ot->srna, "axis_range", false, "Axis Range", "");
417
419 ot->srna, "tweak", false, "Tweak", "Operator has been activated using a click-drag event");
421
424}
425
426/* ******************** Select Left/Right Operator ************************* */
427/* Select keyframes left/right of the current frame indicator */
428
429/* defines for left-right select tool */
431 {NLAEDIT_LRSEL_TEST, "CHECK", 0, "Based on Mouse Position", ""},
432 {NLAEDIT_LRSEL_LEFT, "LEFT", 0, "Before Current Frame", ""},
433 {NLAEDIT_LRSEL_RIGHT, "RIGHT", 0, "After Current Frame", ""},
434 {0, nullptr, 0, nullptr, nullptr},
435};
436
437/* ------------------- */
438
440 bAnimContext *ac,
441 short leftright,
442 short select_mode)
443{
444 ListBase anim_data = {nullptr, nullptr};
445
446 Scene *scene = ac->scene;
447 float xmin, xmax;
448
449 /* if currently in tweak-mode, exit tweak-mode first */
450 if (scene->flag & SCE_NLA_EDIT_ON) {
451 WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, nullptr, nullptr);
452 }
453
454 /* if select mode is replace, deselect all keyframes (and tracks) first */
455 if (select_mode == SELECT_REPLACE) {
456 select_mode = SELECT_ADD;
457
458 /* - deselect all other keyframes, so that just the newly selected remain
459 * - tracks aren't deselected, since we don't re-select any as a consequence
460 */
462 }
463
464 /* get range, and get the right flag-setting mode */
465 if (leftright == NLAEDIT_LRSEL_LEFT) {
466 xmin = MINAFRAMEF;
467 xmax = float(scene->r.cfra + 0.1f);
468 }
469 else {
470 xmin = float(scene->r.cfra - 0.1f);
471 xmax = MAXFRAMEF;
472 }
473
474 select_mode = selmodes_to_flagmodes(select_mode);
475
476 /* filter data */
479 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
480
481 /* select strips on the side where most data occurs */
482 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
483 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
484
485 /* check each strip to see if it is appropriate */
486 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
487 if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
488 ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
489 }
490 }
491 }
492
493 /* Cleanup */
494 ANIM_animdata_freelist(&anim_data);
495}
496
497/* ------------------- */
498
500{
501 bAnimContext ac;
502 short leftright = RNA_enum_get(op->ptr, "mode");
503 short selectmode;
504
505 /* get editor data */
506 if (ANIM_animdata_get_context(C, &ac) == 0) {
507 return OPERATOR_CANCELLED;
508 }
509
510 /* select mode is either replace (deselect all, then add) or add/extend */
511 if (RNA_boolean_get(op->ptr, "extend")) {
512 selectmode = SELECT_INVERT;
513 }
514 else {
515 selectmode = SELECT_REPLACE;
516 }
517
518 /* if "test" mode is set, we don't have any info to set this with */
519 if (leftright == NLAEDIT_LRSEL_TEST) {
520 return OPERATOR_CANCELLED;
521 }
522
523 /* do the selecting now */
524 nlaedit_select_leftright(C, &ac, leftright, selectmode);
525
526 /* set notifier that keyframe selection (and tracks too) have changed */
529
530 return OPERATOR_FINISHED;
531}
532
534 wmOperator *op,
535 const wmEvent *event)
536{
537 bAnimContext ac;
538 short leftright = RNA_enum_get(op->ptr, "mode");
539
540 /* get editor data */
541 if (ANIM_animdata_get_context(C, &ac) == 0) {
542 return OPERATOR_CANCELLED;
543 }
544
545 /* handle mode-based testing */
546 if (leftright == NLAEDIT_LRSEL_TEST) {
547 Scene *scene = ac.scene;
548 ARegion *region = ac.region;
549 View2D *v2d = &region->v2d;
550 float x;
551
552 /* determine which side of the current frame mouse is on */
553 x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
554 if (x < scene->r.cfra) {
555 RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT);
556 }
557 else {
559 }
560 }
561
562 /* perform selection */
564}
565
567{
568 PropertyRNA *prop;
569
570 /* identifiers */
571 ot->name = "Select Left/Right";
572 ot->idname = "NLA_OT_select_leftright";
573 ot->description = "Select strips to the left or the right of the current frame";
574
575 /* API callbacks. */
579
580 /* flags */
582
583 /* properties */
584 ot->prop = RNA_def_enum(
585 ot->srna, "mode", prop_nlaedit_leftright_select_types, NLAEDIT_LRSEL_TEST, "Mode", "");
587
588 prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", "");
590}
591
592/* ******************** Mouse-Click Select Operator *********************** */
593
594/* select strip directly under mouse */
596 bAnimContext *ac,
597 const int mval[2],
598 short select_mode,
599 const bool deselect_all,
600 bool wait_to_deselect_others)
601{
602 Scene *scene = ac->scene;
603
604 bAnimListElem *ale = nullptr;
605 NlaStrip *strip = nullptr;
607
608 nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
609
610 /* if currently in tweak-mode, exit tweak-mode before changing selection states
611 * now that we've found our target...
612 */
613 if (scene->flag & SCE_NLA_EDIT_ON) {
614 WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, nullptr, nullptr);
615 }
616
617 if (select_mode != SELECT_REPLACE) {
618 wait_to_deselect_others = false;
619 }
620
621 /* For replacing selection, if we have something to select, we have to clear existing selection.
622 * The same goes if we found nothing to select, and deselect_all is true
623 * (deselect on nothing behavior). */
624 if ((strip != nullptr && select_mode == SELECT_REPLACE) || (strip == nullptr && deselect_all)) {
625 /* reset selection mode for next steps */
626 select_mode = SELECT_ADD;
627
628 if (strip && wait_to_deselect_others && (strip->flag & DESELECT_STRIPS_CLEARACTIVE)) {
629 ret_value = OPERATOR_RUNNING_MODAL;
630 }
631 else {
632 /* deselect all strips */
634
635 /* deselect all other tracks first */
637 }
638 }
639
640 /* only select strip if we clicked on a valid track and hit something */
641 if (ale != nullptr) {
642 /* select the strip accordingly (if a matching one was found) */
643 if (strip != nullptr) {
644 select_mode = selmodes_to_flagmodes(select_mode);
645 ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
646
647 /* if we selected it, we can make it active too
648 * - we always need to clear the active strip flag though...
649 * - as well as selecting its track...
650 */
652
653 if (strip->flag & NLASTRIP_FLAG_SELECT) {
654 strip->flag |= NLASTRIP_FLAG_ACTIVE;
655
656 /* Highlight NLA-Track */
657 if (ale->type == ANIMTYPE_NLATRACK) {
658 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
659
660 nlt->flag |= NLATRACK_SELECTED;
665 }
666 }
667 }
668
669 /* free this track */
670 MEM_freeN(ale);
671 }
672
673 return ret_value;
674}
675
676/* ------------------- */
677
678/* handle clicking */
680{
681 bAnimContext ac;
682 wmOperatorStatus ret_value;
683
684 /* get editor data */
685 if (ANIM_animdata_get_context(C, &ac) == 0) {
686 return OPERATOR_CANCELLED;
687 }
688
689 /* select mode is either replace (deselect all, then add) or add/extend */
690 const short selectmode = RNA_boolean_get(op->ptr, "extend") ? SELECT_INVERT : SELECT_REPLACE;
691 const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
692 const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, "wait_to_deselect_others");
693 int mval[2];
694 mval[0] = RNA_int_get(op->ptr, "mouse_x");
695 mval[1] = RNA_int_get(op->ptr, "mouse_y");
696
697 /* select strips based upon mouse position */
698 ret_value = mouse_nla_strips(C, &ac, mval, selectmode, deselect_all, wait_to_deselect_others);
699
700 /* set notifier that things have changed */
702
703 /* for tweak grab to work */
704 return ret_value | OPERATOR_PASS_THROUGH;
705}
706
708{
709 PropertyRNA *prop;
710
711 /* identifiers */
712 ot->name = "Select";
713 ot->idname = "NLA_OT_click_select";
714 ot->description = "Handle clicks to select NLA Strips";
715
716 /* callbacks */
721
722 /* flags */
723 ot->flag = OPTYPE_UNDO;
724
725 /* properties */
727 prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", ""); /* SHIFTKEY */
729
730 prop = RNA_def_boolean(ot->srna,
731 "deselect_all",
732 false,
733 "Deselect On Nothing",
734 "Deselect all when nothing under the cursor");
736}
737
738/* *********************************************** */
bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
float BKE_nlastrip_distance_to_frame(const NlaStrip *strip, float timeline_frame)
#define BLI_assert(a)
Definition BLI_assert.h:46
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:131
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:198
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:194
@ NLASTRIP_FLAG_ACTIVE
@ NLASTRIP_FLAG_SELECT
@ NLATRACK_SELECTED
#define MAXFRAMEF
@ SCE_NLA_EDIT_ON
#define MINAFRAMEF
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
@ ACHANNEL_SETFLAG_ADD
@ ACHANNEL_SETFLAG_INVERT
@ ACHANNEL_SETFLAG_CLEAR
@ ANIMTYPE_NLATRACK
#define NLATRACK_FIRST_TOP(ac)
#define NLATRACK_STEP(snla)
eAnimCont_Types
#define ACHANNEL_SET_FLAG(channel, smode, sflag)
eAnimFilter_Flags
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
@ ANIMFILTER_FCURVESONLY
#define NLATRACK_HEIGHT(snla)
@ SELECT_INVERT
@ SELECT_SUBTRACT
@ SELECT_REPLACE
@ SELECT_ADD
bool ED_operator_nla_active(bContext *C)
eSelectOp
@ SEL_OP_SUB
#define SEL_OP_USE_PRE_DESELECT(sel_op)
@ SEL_SELECT
@ SEL_INVERT
@ SEL_DESELECT
@ SEL_TOGGLE
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition RNA_types.hh:330
#define C
Definition RandGen.cpp:29
void UI_view2d_listview_view_to_cell(float columnwidth, float rowheight, float startx, float starty, float viewx, float viewy, int *r_column, int *r_row)
Definition view2d.cc:1620
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1667
float UI_view2d_region_to_view_x(const View2D *v2d, float x)
Definition view2d.cc:1656
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define NC_ANIMATION
Definition WM_types.hh:385
#define ND_NLA
Definition WM_types.hh:494
@ WM_OP_EXEC_DEFAULT
Definition WM_types.hh:245
#define ND_KEYFRAME
Definition WM_types.hh:491
#define ND_ANIMCHAN
Definition WM_types.hh:493
#define NA_SELECTED
Definition WM_types.hh:586
void ANIM_anim_channels_select_set(bAnimContext *ac, eAnimChannels_SetFlag sel)
void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datatype, eAnimFilter_Flags filter, void *channel_data, eAnim_ChannelType channel_type)
void ANIM_animdata_freelist(ListBase *anim_data)
Definition anim_deps.cc:463
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
#define filter
float distance(VecOp< float, D >, VecOp< float, D >) RET
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
bool nlaop_poll_tweakmode_off(bContext *C)
Definition nla_ops.cc:27
@ NLAEDIT_LRSEL_RIGHT
Definition nla_intern.hh:53
@ NLAEDIT_LRSEL_TEST
Definition nla_intern.hh:50
@ NLAEDIT_LRSEL_LEFT
Definition nla_intern.hh:52
@ NLA_BOXSEL_ALLSTRIPS
@ NLA_BOXSEL_CHANNELS
@ NLA_BOXSEL_FRAMERANGE
static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
Definition nla_select.cc:76
static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode)
static wmOperatorStatus nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2])
void NLA_OT_select_box(wmOperatorType *ot)
@ DESELECT_STRIPS_NOTEST
Definition nla_select.cc:62
@ DESELECT_STRIPS_CLEARACTIVE
Definition nla_select.cc:64
@ DESELECT_STRIPS_TEST
Definition nla_select.cc:63
static wmOperatorStatus nlaedit_select_leftright_exec(bContext *C, wmOperator *op)
static wmOperatorStatus nlaedit_clickselect_exec(bContext *C, wmOperator *op)
static wmOperatorStatus nlaedit_box_select_exec(bContext *C, wmOperator *op)
static wmOperatorStatus nlaedit_deselectall_exec(bContext *C, wmOperator *op)
static wmOperatorStatus mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], short select_mode, const bool deselect_all, bool wait_to_deselect_others)
static short selmodes_to_flagmodes(short sel)
Definition nla_select.cc:38
void NLA_OT_click_select(wmOperatorType *ot)
void NLA_OT_select_leftright(wmOperatorType *ot)
static wmOperatorStatus nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void nlaedit_select_leftright(bContext *C, bAnimContext *ac, short leftright, short select_mode)
static void nlaedit_strip_at_region_position(bAnimContext *ac, float region_x, float region_y, bAnimListElem **r_ale, NlaStrip **r_strip)
static const EnumPropertyItem prop_nlaedit_leftright_select_types[]
void NLA_OT_select_all(wmOperatorType *ot)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void * first
ListBase strips
struct RenderData r
SpaceLink * sl
eAnimCont_Types datatype
ARegion * region
bAnimListElem * next
eAnim_ChannelType type
float xmax
float xmin
float ymax
float ymin
int ymin
int ymax
int xmin
int xmax
int mval[2]
Definition WM_types.hh:760
struct PointerRNA * ptr
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition wm_files.cc:4225
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *r_rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_generic_select(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
wmOperatorStatus WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)