Blender V5.0
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) {
452 C, "NLA_OT_tweakmode_exit", blender::wm::OpCallContext::ExecDefault, nullptr, nullptr);
453 }
454
455 /* if select mode is replace, deselect all keyframes (and tracks) first */
456 if (select_mode == SELECT_REPLACE) {
457 select_mode = SELECT_ADD;
458
459 /* - deselect all other keyframes, so that just the newly selected remain
460 * - tracks aren't deselected, since we don't re-select any as a consequence
461 */
463 }
464
465 /* get range, and get the right flag-setting mode */
466 if (leftright == NLAEDIT_LRSEL_LEFT) {
467 xmin = MINAFRAMEF;
468 xmax = float(scene->r.cfra + 0.1f);
469 }
470 else {
471 xmin = float(scene->r.cfra - 0.1f);
472 xmax = MAXFRAMEF;
473 }
474
475 select_mode = selmodes_to_flagmodes(select_mode);
476
477 /* filter data */
480 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
481
482 /* select strips on the side where most data occurs */
483 LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
484 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
485
486 /* check each strip to see if it is appropriate */
487 LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
488 if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
489 ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
490 }
491 }
492 }
493
494 /* Cleanup */
495 ANIM_animdata_freelist(&anim_data);
496}
497
498/* ------------------- */
499
501{
502 bAnimContext ac;
503 short leftright = RNA_enum_get(op->ptr, "mode");
504 short selectmode;
505
506 /* get editor data */
507 if (ANIM_animdata_get_context(C, &ac) == 0) {
508 return OPERATOR_CANCELLED;
509 }
510
511 /* select mode is either replace (deselect all, then add) or add/extend */
512 if (RNA_boolean_get(op->ptr, "extend")) {
513 selectmode = SELECT_INVERT;
514 }
515 else {
516 selectmode = SELECT_REPLACE;
517 }
518
519 /* if "test" mode is set, we don't have any info to set this with */
520 if (leftright == NLAEDIT_LRSEL_TEST) {
521 return OPERATOR_CANCELLED;
522 }
523
524 /* do the selecting now */
525 nlaedit_select_leftright(C, &ac, leftright, selectmode);
526
527 /* set notifier that keyframe selection (and tracks too) have changed */
530
531 return OPERATOR_FINISHED;
532}
533
535 wmOperator *op,
536 const wmEvent *event)
537{
538 bAnimContext ac;
539 short leftright = RNA_enum_get(op->ptr, "mode");
540
541 /* get editor data */
542 if (ANIM_animdata_get_context(C, &ac) == 0) {
543 return OPERATOR_CANCELLED;
544 }
545
546 /* handle mode-based testing */
547 if (leftright == NLAEDIT_LRSEL_TEST) {
548 Scene *scene = ac.scene;
549 ARegion *region = ac.region;
550 View2D *v2d = &region->v2d;
551 float x;
552
553 /* determine which side of the current frame mouse is on */
554 x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
555 if (x < scene->r.cfra) {
556 RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT);
557 }
558 else {
560 }
561 }
562
563 /* perform selection */
565}
566
568{
569 PropertyRNA *prop;
570
571 /* identifiers */
572 ot->name = "Select Left/Right";
573 ot->idname = "NLA_OT_select_leftright";
574 ot->description = "Select strips to the left or the right of the current frame";
575
576 /* API callbacks. */
580
581 /* flags */
583
584 /* properties */
585 ot->prop = RNA_def_enum(
586 ot->srna, "mode", prop_nlaedit_leftright_select_types, NLAEDIT_LRSEL_TEST, "Mode", "");
588
589 prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", "");
591}
592
593/* ******************** Mouse-Click Select Operator *********************** */
594
595/* select strip directly under mouse */
597 bAnimContext *ac,
598 const int mval[2],
599 short select_mode,
600 const bool deselect_all,
601 bool wait_to_deselect_others)
602{
603 Scene *scene = ac->scene;
604
605 bAnimListElem *ale = nullptr;
606 NlaStrip *strip = nullptr;
608
609 nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
610
611 /* if currently in tweak-mode, exit tweak-mode before changing selection states
612 * now that we've found our target...
613 */
614 if (scene->flag & SCE_NLA_EDIT_ON) {
616 C, "NLA_OT_tweakmode_exit", blender::wm::OpCallContext::ExecDefault, nullptr, nullptr);
617 }
618
619 if (select_mode != SELECT_REPLACE) {
620 wait_to_deselect_others = false;
621 }
622
623 /* For replacing selection, if we have something to select, we have to clear existing selection.
624 * The same goes if we found nothing to select, and deselect_all is true
625 * (deselect on nothing behavior). */
626 if ((strip != nullptr && select_mode == SELECT_REPLACE) || (strip == nullptr && deselect_all)) {
627 /* reset selection mode for next steps */
628 select_mode = SELECT_ADD;
629
630 if (strip && wait_to_deselect_others && (strip->flag & DESELECT_STRIPS_CLEARACTIVE)) {
631 ret_value = OPERATOR_RUNNING_MODAL;
632 }
633 else {
634 /* deselect all strips */
636
637 /* deselect all other tracks first */
639 }
640 }
641
642 /* only select strip if we clicked on a valid track and hit something */
643 if (ale != nullptr) {
644 /* select the strip accordingly (if a matching one was found) */
645 if (strip != nullptr) {
646 select_mode = selmodes_to_flagmodes(select_mode);
647 ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
648
649 /* if we selected it, we can make it active too
650 * - we always need to clear the active strip flag though...
651 * - as well as selecting its track...
652 */
654
655 if (strip->flag & NLASTRIP_FLAG_SELECT) {
656 strip->flag |= NLASTRIP_FLAG_ACTIVE;
657
658 /* Highlight NLA-Track */
659 if (ale->type == ANIMTYPE_NLATRACK) {
660 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
661
662 nlt->flag |= NLATRACK_SELECTED;
667 }
668 }
669 }
670
671 /* free this track */
672 MEM_freeN(ale);
673 }
674
675 return ret_value;
676}
677
678/* ------------------- */
679
680/* handle clicking */
682{
683 bAnimContext ac;
684 wmOperatorStatus ret_value;
685
686 /* get editor data */
687 if (ANIM_animdata_get_context(C, &ac) == 0) {
688 return OPERATOR_CANCELLED;
689 }
690
691 /* select mode is either replace (deselect all, then add) or add/extend */
692 const short selectmode = RNA_boolean_get(op->ptr, "extend") ? SELECT_INVERT : SELECT_REPLACE;
693 const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
694 const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, "wait_to_deselect_others");
695 int mval[2];
696 mval[0] = RNA_int_get(op->ptr, "mouse_x");
697 mval[1] = RNA_int_get(op->ptr, "mouse_y");
698
699 /* select strips based upon mouse position */
700 ret_value = mouse_nla_strips(C, &ac, mval, selectmode, deselect_all, wait_to_deselect_others);
701
702 /* set notifier that things have changed */
704
705 /* for tweak grab to work */
706 return ret_value | OPERATOR_PASS_THROUGH;
707}
708
710{
711 PropertyRNA *prop;
712
713 /* identifiers */
714 ot->name = "Select";
715 ot->idname = "NLA_OT_click_select";
716 ot->description = "Handle clicks to select NLA Strips";
717
718 /* callbacks */
723
724 /* flags */
725 ot->flag = OPTYPE_UNDO;
726
727 /* properties */
729 prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", ""); /* SHIFTKEY */
731
732 prop = RNA_def_boolean(ot->srna,
733 "deselect_all",
734 false,
735 "Deselect On Nothing",
736 "Deselect all when nothing under the cursor");
738}
739
740/* *********************************************** */
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
@ SEL_SELECT
@ SEL_INVERT
@ SEL_DESELECT
@ SEL_TOGGLE
#define SEL_OP_USE_PRE_DESELECT(sel_op)
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition RNA_types.hh:344
#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:1621
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:1668
float UI_view2d_region_to_view_x(const View2D *v2d, float x)
Definition view2d.cc:1657
#define NC_ANIMATION
Definition WM_types.hh:388
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define ND_NLA
Definition WM_types.hh:497
#define ND_KEYFRAME
Definition WM_types.hh:494
#define ND_ANIMCHAN
Definition WM_types.hh:496
#define NA_SELECTED
Definition WM_types.hh:589
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)
nullptr float
#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
@ 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 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)
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)
@ NLA_BOXSEL_ALLSTRIPS
@ NLA_BOXSEL_CHANNELS
@ NLA_BOXSEL_FRAMERANGE
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:763
struct PointerRNA * ptr
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorType * ot
Definition wm_files.cc:4237
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)