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