Blender  V2.93
nla_select.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
17  * All rights reserved.
18  */
19 
24 #include <stdio.h>
25 #include <string.h>
26 
27 #include "DNA_anim_types.h"
28 #include "DNA_scene_types.h"
29 
30 #include "MEM_guardedalloc.h"
31 
32 #include "BLI_blenlib.h"
33 
34 #include "BKE_context.h"
35 #include "BKE_nla.h"
36 #include "BKE_screen.h"
37 
38 #include "ED_anim_api.h"
39 #include "ED_keyframes_edit.h"
40 #include "ED_screen.h"
41 #include "ED_select_utils.h"
42 
43 #include "RNA_access.h"
44 #include "RNA_define.h"
45 
46 #include "WM_api.h"
47 #include "WM_types.h"
48 
49 #include "UI_interface.h"
50 #include "UI_view2d.h"
51 
52 #include "nla_intern.h" /* own include */
53 
54 /* ******************** Utilities ***************************************** */
55 
56 /* Convert SELECT_* flags to ACHANNEL_SETFLAG_* flags */
57 static short selmodes_to_flagmodes(short sel)
58 {
59  /* convert selection modes to selection modes */
60  switch (sel) {
61  case SELECT_SUBTRACT:
63 
64  case SELECT_INVERT:
66 
67  case SELECT_ADD:
68  default:
69  return ACHANNEL_SETFLAG_ADD;
70  }
71 }
72 
73 /* ******************** Deselect All Operator ***************************** */
74 /* This operator works in one of three ways:
75  * 1) (de)select all (AKEY) - test if select all or deselect all
76  * 2) invert all (CTRL-IKEY) - invert selection of all keyframes
77  * 3) (de)select all - no testing is done; only for use internal tools as normal function...
78  */
79 
80 enum {
84 } /*eDeselectNlaStrips*/;
85 
86 /* Deselects strips in the NLA Editor
87  * - This is called by the deselect all operator, as well as other ones!
88  *
89  * - test: check if select or deselect all (1) or clear all active (2)
90  * - sel: how to select keyframes
91  * 0 = deselect
92  * 1 = select
93  * 2 = invert
94  */
95 static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
96 {
97  ListBase anim_data = {NULL, NULL};
98  bAnimListElem *ale;
99  int filter;
100  short smode;
101 
102  /* determine type-based settings */
103  /* FIXME: double check whether ANIMFILTER_LIST_VISIBLE is needed! */
105 
106  /* filter data */
107  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
108 
109  /* See if we should be selecting or deselecting */
110  if (test == DESELECT_STRIPS_TEST) {
111  for (ale = anim_data.first; ale; ale = ale->next) {
112  NlaTrack *nlt = (NlaTrack *)ale->data;
113  NlaStrip *strip;
114 
115  /* if any strip is selected, break out, since we should now be deselecting */
116  for (strip = nlt->strips.first; strip; strip = strip->next) {
117  if (strip->flag & NLASTRIP_FLAG_SELECT) {
118  sel = SELECT_SUBTRACT;
119  break;
120  }
121  }
122 
123  if (sel == SELECT_SUBTRACT) {
124  break;
125  }
126  }
127  }
128 
129  /* convert selection modes to selection modes */
130  smode = selmodes_to_flagmodes(sel);
131 
132  /* Now set the flags */
133  for (ale = anim_data.first; ale; ale = ale->next) {
134  NlaTrack *nlt = (NlaTrack *)ale->data;
135  NlaStrip *strip;
136 
137  /* apply same selection to all strips */
138  for (strip = nlt->strips.first; strip; strip = strip->next) {
139  /* set selection */
140  if (test != DESELECT_STRIPS_CLEARACTIVE) {
142  }
143 
144  /* clear active flag */
145  /* TODO: for clear active,
146  * do we want to limit this to only doing this on a certain set of tracks though? */
147  strip->flag &= ~NLASTRIP_FLAG_ACTIVE;
148  }
149  }
150 
151  /* Cleanup */
152  ANIM_animdata_freelist(&anim_data);
153 }
154 
155 /* ------------------- */
156 
158 {
159  bAnimContext ac;
160 
161  /* get editor data */
162  if (ANIM_animdata_get_context(C, &ac) == 0) {
163  return OPERATOR_CANCELLED;
164  }
165 
166  /* 'standard' behavior - check if selected, then apply relevant selection */
167  const int action = RNA_enum_get(op->ptr, "action");
168  switch (action) {
169  case SEL_TOGGLE:
171  break;
172  case SEL_SELECT:
174  break;
175  case SEL_DESELECT:
177  break;
178  case SEL_INVERT:
180  break;
181  default:
182  BLI_assert(0);
183  break;
184  }
185 
186  /* set notifier that things have changed */
188 
189  return OPERATOR_FINISHED;
190 }
191 
193 {
194  /* identifiers */
195  ot->name = "(De)select All";
196  ot->idname = "NLA_OT_select_all";
197  ot->description = "Select or deselect all NLA-Strips";
198 
199  /* api callbacks */
202 
203  /* flags */
204  ot->flag = OPTYPE_REGISTER /*|OPTYPE_UNDO*/;
205 
206  /* properties */
208 }
209 
210 /* ******************** Box Select Operator **************************** */
220 /* defines for box_select mode */
221 enum {
225 } /* eNLAEDIT_BoxSelect_Mode */;
226 
227 static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode)
228 {
229  ListBase anim_data = {NULL, NULL};
230  bAnimListElem *ale;
231  int filter;
232 
233  SpaceNla *snla = (SpaceNla *)ac->sl;
234  View2D *v2d = &ac->region->v2d;
235  rctf rectf;
236 
237  /* convert border-region to view coordinates */
238  UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin + 2, &rectf.xmin, &rectf.ymin);
239  UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax - 2, &rectf.xmax, &rectf.ymax);
240 
241  /* filter data */
243  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
244 
245  /* convert selection modes to selection modes */
246  selectmode = selmodes_to_flagmodes(selectmode);
247 
248  /* loop over data, doing box select */
249  float ymax = NLACHANNEL_FIRST_TOP(ac);
250  for (ale = anim_data.first; ale; ale = ale->next, ymax -= NLACHANNEL_STEP(snla)) {
251  float ymin = ymax - NLACHANNEL_HEIGHT(snla);
252 
253  /* perform vertical suitability check (if applicable) */
254  if ((mode == NLA_BOXSEL_FRAMERANGE) || !((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
255  /* loop over data selecting (only if NLA-Track) */
256  if (ale->type == ANIMTYPE_NLATRACK) {
257  NlaTrack *nlt = (NlaTrack *)ale->data;
258  NlaStrip *strip;
259 
260  /* only select strips if they fall within the required ranges (if applicable) */
261  for (strip = nlt->strips.first; strip; strip = strip->next) {
262  if ((mode == NLA_BOXSEL_CHANNELS) ||
263  BKE_nlastrip_within_bounds(strip, rectf.xmin, rectf.xmax)) {
264  /* set selection */
265  ACHANNEL_SET_FLAG(strip, selectmode, NLASTRIP_FLAG_SELECT);
266 
267  /* clear active flag */
268  strip->flag &= ~NLASTRIP_FLAG_ACTIVE;
269  }
270  }
271  }
272  }
273  }
274 
275  /* cleanup */
276  ANIM_animdata_freelist(&anim_data);
277 }
278 
279 /* ------------------- */
280 
282  bAnimContext *ac, float region_x, float region_y, bAnimListElem **r_ale, NlaStrip **r_strip)
283 {
284  *r_ale = NULL;
285  *r_strip = NULL;
286 
287  SpaceNla *snla = (SpaceNla *)ac->sl;
288  View2D *v2d = &ac->region->v2d;
289 
290  float view_x, view_y;
291  int channel_index;
292  UI_view2d_region_to_view(v2d, region_x, region_y, &view_x, &view_y);
294  0, NLACHANNEL_STEP(snla), 0, NLACHANNEL_FIRST_TOP(ac), view_x, view_y, NULL, &channel_index);
295 
296  ListBase anim_data = {NULL, NULL};
298  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
299 
300  /* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click
301  * (that is the size of keyframe icons, so user should be expecting similar tolerances)
302  */
303  float xmin = UI_view2d_region_to_view_x(v2d, region_x - 7);
304  float xmax = UI_view2d_region_to_view_x(v2d, region_x + 7);
305 
306  bAnimListElem *ale = BLI_findlink(&anim_data, channel_index);
307  if (ale != NULL) {
308  if (ale->type == ANIMTYPE_NLATRACK) {
309  NlaTrack *nlt = (NlaTrack *)ale->data;
310 
311  LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
312  if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
313  *r_ale = ale;
314  *r_strip = strip;
315 
316  BLI_remlink(&anim_data, ale);
317  }
318  }
319  }
320  }
321 
322  ANIM_animdata_freelist(&anim_data);
323 }
324 
325 static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2])
326 {
327  bAnimListElem *ale;
328  NlaStrip *strip;
329  nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
330 
331  if (ale != NULL) {
332  BLI_assert(strip != NULL);
333  MEM_freeN(ale);
334  return true;
335  }
336  return false;
337 }
338 
339 static int nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
340 {
341  bAnimContext ac;
342  if (ANIM_animdata_get_context(C, &ac) == 0) {
343  return OPERATOR_CANCELLED;
344  }
345 
346  bool tweak = RNA_boolean_get(op->ptr, "tweak");
347  if (tweak && nlaedit_mouse_is_over_strip(&ac, event->mval)) {
349  }
350  return WM_gesture_box_invoke(C, op, event);
351 }
352 
354 {
355  bAnimContext ac;
356  rcti rect;
357  short mode = 0;
358 
359  /* get editor data */
360  if (ANIM_animdata_get_context(C, &ac) == 0) {
361  return OPERATOR_CANCELLED;
362  }
363 
364  const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
365  const int selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT;
366  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
368  }
369 
370  /* get settings from operator */
372 
373  /* selection 'mode' depends on whether box_select region only matters on one axis */
374  if (RNA_boolean_get(op->ptr, "axis_range")) {
375  /* mode depends on which axis of the range is larger to determine which axis to use.
376  * - Checking this in region-space is fine,
377  * as it's fundamentally still going to be a different rect size.
378  * - The frame-range select option is favored over the channel one (x over y),
379  * as frame-range one is often.
380  * Used for tweaking timing when "blocking", while channels is not that useful.
381  */
382  if (BLI_rcti_size_x(&rect) >= BLI_rcti_size_y(&rect)) {
383  mode = NLA_BOXSEL_FRAMERANGE;
384  }
385  else {
386  mode = NLA_BOXSEL_CHANNELS;
387  }
388  }
389  else {
390  mode = NLA_BOXSEL_ALLSTRIPS;
391  }
392 
393  /* apply box_select action */
394  box_select_nla_strips(&ac, rect, mode, selectmode);
395 
396  /* set notifier that things have changed */
398 
399  return OPERATOR_FINISHED;
400 }
401 
403 {
404  /* identifiers */
405  ot->name = "Box Select";
406  ot->idname = "NLA_OT_select_box";
407  ot->description = "Use box selection to grab NLA-Strips";
408 
409  /* api callbacks */
414 
416 
417  /* flags */
419 
420  /* properties */
421  RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
422 
424  ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
426 
429 }
430 
431 /* ******************** Select Left/Right Operator ************************* */
432 /* Select keyframes left/right of the current frame indicator */
433 
434 /* defines for left-right select tool */
436  {NLAEDIT_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""},
437  {NLAEDIT_LRSEL_LEFT, "LEFT", 0, "Before Current Frame", ""},
438  {NLAEDIT_LRSEL_RIGHT, "RIGHT", 0, "After Current Frame", ""},
439  {0, NULL, 0, NULL, NULL},
440 };
441 
442 /* ------------------- */
443 
445  bAnimContext *ac,
446  short leftright,
447  short select_mode)
448 {
449  ListBase anim_data = {NULL, NULL};
450  bAnimListElem *ale;
451  int filter;
452 
453  Scene *scene = ac->scene;
454  float xmin, xmax;
455 
456  /* if currently in tweakmode, exit tweakmode first */
457  if (scene->flag & SCE_NLA_EDIT_ON) {
458  WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL);
459  }
460 
461  /* if select mode is replace, deselect all keyframes (and channels) first */
462  if (select_mode == SELECT_REPLACE) {
463  select_mode = SELECT_ADD;
464 
465  /* - deselect all other keyframes, so that just the newly selected remain
466  * - channels aren't deselected, since we don't re-select any as a consequence
467  */
469  }
470 
471  /* get range, and get the right flag-setting mode */
472  if (leftright == NLAEDIT_LRSEL_LEFT) {
473  xmin = MINAFRAMEF;
474  xmax = (float)(CFRA + 0.1f);
475  }
476  else {
477  xmin = (float)(CFRA - 0.1f);
478  xmax = MAXFRAMEF;
479  }
480 
481  select_mode = selmodes_to_flagmodes(select_mode);
482 
483  /* filter data */
485  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
486 
487  /* select strips on the side where most data occurs */
488  for (ale = anim_data.first; ale; ale = ale->next) {
489  NlaTrack *nlt = (NlaTrack *)ale->data;
490  NlaStrip *strip;
491 
492  /* check each strip to see if it is appropriate */
493  for (strip = nlt->strips.first; strip; strip = strip->next) {
494  if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
495  ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
496  }
497  }
498  }
499 
500  /* Cleanup */
501  ANIM_animdata_freelist(&anim_data);
502 }
503 
504 /* ------------------- */
505 
507 {
508  bAnimContext ac;
509  short leftright = RNA_enum_get(op->ptr, "mode");
510  short selectmode;
511 
512  /* get editor data */
513  if (ANIM_animdata_get_context(C, &ac) == 0) {
514  return OPERATOR_CANCELLED;
515  }
516 
517  /* select mode is either replace (deselect all, then add) or add/extend */
518  if (RNA_boolean_get(op->ptr, "extend")) {
519  selectmode = SELECT_INVERT;
520  }
521  else {
522  selectmode = SELECT_REPLACE;
523  }
524 
525  /* if "test" mode is set, we don't have any info to set this with */
526  if (leftright == NLAEDIT_LRSEL_TEST) {
527  return OPERATOR_CANCELLED;
528  }
529 
530  /* do the selecting now */
531  nlaedit_select_leftright(C, &ac, leftright, selectmode);
532 
533  /* set notifier that keyframe selection (and channels too) have changed */
536 
537  return OPERATOR_FINISHED;
538 }
539 
541 {
542  bAnimContext ac;
543  short leftright = RNA_enum_get(op->ptr, "mode");
544 
545  /* get editor data */
546  if (ANIM_animdata_get_context(C, &ac) == 0) {
547  return OPERATOR_CANCELLED;
548  }
549 
550  /* handle mode-based testing */
551  if (leftright == NLAEDIT_LRSEL_TEST) {
552  Scene *scene = ac.scene;
553  ARegion *region = ac.region;
554  View2D *v2d = &region->v2d;
555  float x;
556 
557  /* determine which side of the current frame mouse is on */
558  x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
559  if (x < CFRA) {
560  RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT);
561  }
562  else {
563  RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_RIGHT);
564  }
565  }
566 
567  /* perform selection */
568  return nlaedit_select_leftright_exec(C, op);
569 }
570 
572 {
573  PropertyRNA *prop;
574 
575  /* identifiers */
576  ot->name = "Select Left/Right";
577  ot->idname = "NLA_OT_select_leftright";
578  ot->description = "Select strips to the left or the right of the current frame";
579 
580  /* api callbacks */
584 
585  /* flags */
587 
588  /* properties */
589  ot->prop = RNA_def_enum(
592 
593  prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
595 }
596 
597 /* ******************** Mouse-Click Select Operator *********************** */
598 
599 /* select strip directly under mouse */
601  bAnimContext *ac,
602  const int mval[2],
603  short select_mode,
604  const bool deselect_all,
605  bool wait_to_deselect_others)
606 {
607  Scene *scene = ac->scene;
608 
609  bAnimListElem *ale = NULL;
610  NlaStrip *strip = NULL;
611  int ret_value = OPERATOR_FINISHED;
612 
613  nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
614 
615  /* if currently in tweakmode, exit tweakmode before changing selection states
616  * now that we've found our target...
617  */
618  if (scene->flag & SCE_NLA_EDIT_ON) {
619  WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL);
620  }
621 
622  if (select_mode != SELECT_REPLACE) {
623  wait_to_deselect_others = false;
624  }
625 
626  /* For replacing selection, if we have something to select, we have to clear existing selection.
627  * The same goes if we found nothing to select, and deselect_all is true
628  * (deselect on nothing behavior). */
629  if ((strip != NULL && select_mode == SELECT_REPLACE) || (strip == NULL && deselect_all)) {
630  /* reset selection mode for next steps */
631  select_mode = SELECT_ADD;
632 
633  if (strip && wait_to_deselect_others && (strip->flag & DESELECT_STRIPS_CLEARACTIVE)) {
634  ret_value = OPERATOR_RUNNING_MODAL;
635  }
636  else {
637  /* deselect all strips */
639 
640  /* deselect all other channels first */
642  }
643  }
644 
645  /* only select strip if we clicked on a valid channel and hit something */
646  if (ale != NULL) {
647  /* select the strip accordingly (if a matching one was found) */
648  if (strip != NULL) {
649  select_mode = selmodes_to_flagmodes(select_mode);
650  ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
651 
652  /* if we selected it, we can make it active too
653  * - we always need to clear the active strip flag though...
654  * - as well as selecting its track...
655  */
657 
658  if (strip->flag & NLASTRIP_FLAG_SELECT) {
659  strip->flag |= NLASTRIP_FLAG_ACTIVE;
660 
661  /* Highlight NLA-Track */
662  if (ale->type == ANIMTYPE_NLATRACK) {
663  NlaTrack *nlt = (NlaTrack *)ale->data;
664 
665  nlt->flag |= NLATRACK_SELECTED;
669  }
670  }
671  }
672 
673  /* free this channel */
674  MEM_freeN(ale);
675  }
676 
677  return ret_value;
678 }
679 
680 /* ------------------- */
681 
682 /* handle clicking */
684 {
685  bAnimContext ac;
686  int ret_value;
687 
688  /* get editor data */
689  if (ANIM_animdata_get_context(C, &ac) == 0) {
690  return OPERATOR_CANCELLED;
691  }
692 
693  /* select mode is either replace (deselect all, then add) or add/extend */
694  const short selectmode = RNA_boolean_get(op->ptr, "extend") ? SELECT_INVERT : SELECT_REPLACE;
695  const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
696  const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, "wait_to_deselect_others");
697  int mval[2];
698  mval[0] = RNA_int_get(op->ptr, "mouse_x");
699  mval[1] = RNA_int_get(op->ptr, "mouse_y");
700 
701  /* select strips based upon mouse position */
702  ret_value = mouse_nla_strips(C, &ac, mval, selectmode, deselect_all, wait_to_deselect_others);
703 
704  /* set notifier that things have changed */
706 
707  /* for tweak grab to work */
708  return ret_value | OPERATOR_PASS_THROUGH;
709 }
710 
712 {
713  PropertyRNA *prop;
714 
715  /* identifiers */
716  ot->name = "Select";
717  ot->idname = "NLA_OT_click_select";
718  ot->description = "Handle clicks to select NLA Strips";
719 
720  /* callbacks */
725 
726  /* flags */
727  ot->flag = OPTYPE_UNDO;
728 
729  /* properties */
731  prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); /* SHIFTKEY */
733 
734  prop = RNA_def_boolean(ot->srna,
735  "deselect_all",
736  false,
737  "Deselect On Nothing",
738  "Deselect all when nothing under the cursor");
740 }
741 
742 /* *********************************************** */
typedef float(TangentPoint)[2]
bool BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max)
Definition: nla.c:1258
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:133
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:157
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
@ NLASTRIP_FLAG_ACTIVE
@ NLASTRIP_FLAG_SELECT
@ NLATRACK_SELECTED
#define SCE_NLA_EDIT_ON
#define CFRA
#define MAXFRAMEF
#define MINAFRAMEF
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
@ ACHANNEL_SETFLAG_ADD
Definition: ED_anim_api.h:510
@ ACHANNEL_SETFLAG_INVERT
Definition: ED_anim_api.h:512
@ ACHANNEL_SETFLAG_CLEAR
Definition: ED_anim_api.h:508
@ ANIMTYPE_NLATRACK
Definition: ED_anim_api.h:246
#define NLACHANNEL_STEP(snla)
Definition: ED_anim_api.h:451
#define NLACHANNEL_FIRST_TOP(ac)
Definition: ED_anim_api.h:445
#define ACHANNEL_SET_FLAG(channel, smode, sflag)
Definition: ED_anim_api.h:796
#define NLACHANNEL_HEIGHT(snla)
Definition: ED_anim_api.h:447
@ ANIMFILTER_DATA_VISIBLE
Definition: ED_anim_api.h:295
@ ANIMFILTER_LIST_VISIBLE
Definition: ED_anim_api.h:298
@ ANIMFILTER_LIST_CHANNELS
Definition: ED_anim_api.h:303
@ SELECT_INVERT
@ SELECT_SUBTRACT
@ SELECT_REPLACE
@ SELECT_ADD
bool ED_operator_nla_active(struct bContext *C)
Definition: screen_ops.c:334
#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.h:204
#define C
Definition: RandGen.cpp:39
void UI_view2d_listview_view_to_cell(float columnwidth, float rowheight, float startx, float starty, float viewx, float viewy, int *column, int *row)
Definition: view2d.c:1623
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
float UI_view2d_region_to_view_x(const struct View2D *v2d, float x)
Definition: view2d.c:1659
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define NC_ANIMATION
Definition: WM_types.h:289
@ WM_OP_EXEC_DEFAULT
Definition: WM_types.h:204
#define ND_NLA
Definition: WM_types.h:397
#define ND_KEYFRAME
Definition: WM_types.h:394
#define ND_ANIMCHAN
Definition: WM_types.h:396
#define NA_SELECTED
Definition: WM_types.h:467
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.c:425
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
Definition: anim_filter.c:405
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
Definition: anim_filter.c:3442
Scene scene
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
bool nlaop_poll_tweakmode_off(bContext *C)
Definition: nla_ops.c:43
@ NLAEDIT_LRSEL_RIGHT
Definition: nla_intern.h:55
@ NLAEDIT_LRSEL_TEST
Definition: nla_intern.h:52
@ NLAEDIT_LRSEL_LEFT
Definition: nla_intern.h:54
static int nlaedit_clickselect_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:683
static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
Definition: nla_select.c:95
static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode)
Definition: nla_select.c:227
@ DESELECT_STRIPS_NOTEST
Definition: nla_select.c:81
@ DESELECT_STRIPS_CLEARACTIVE
Definition: nla_select.c:83
@ DESELECT_STRIPS_TEST
Definition: nla_select.c:82
static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2])
Definition: nla_select.c:325
void NLA_OT_select_box(wmOperatorType *ot)
Definition: nla_select.c:402
static short selmodes_to_flagmodes(short sel)
Definition: nla_select.c:57
void NLA_OT_click_select(wmOperatorType *ot)
Definition: nla_select.c:711
@ NLA_BOXSEL_ALLSTRIPS
Definition: nla_select.c:222
@ NLA_BOXSEL_CHANNELS
Definition: nla_select.c:224
@ NLA_BOXSEL_FRAMERANGE
Definition: nla_select.c:223
static int nlaedit_box_select_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:353
static int nlaedit_deselectall_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:157
void NLA_OT_select_leftright(wmOperatorType *ot)
Definition: nla_select.c:571
static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:506
static int nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: nla_select.c:339
static void nlaedit_select_leftright(bContext *C, bAnimContext *ac, short leftright, short select_mode)
Definition: nla_select.c:444
static void nlaedit_strip_at_region_position(bAnimContext *ac, float region_x, float region_y, bAnimListElem **r_ale, NlaStrip **r_strip)
Definition: nla_select.c:281
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)
Definition: nla_select.c:600
static const EnumPropertyItem prop_nlaedit_leftright_select_types[]
Definition: nla_select.c:435
static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: nla_select.c:540
void NLA_OT_select_all(wmOperatorType *ot)
Definition: nla_select.c:192
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6308
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6413
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
void * first
Definition: DNA_listBase.h:47
ListBase strips
short flag
struct ARegion * region
Definition: ED_anim_api.h:89
struct Scene * scene
Definition: ED_anim_api.h:97
short datatype
Definition: ED_anim_api.h:75
void * data
Definition: ED_anim_api.h:73
struct SpaceLink * sl
Definition: ED_anim_api.h:87
struct bAnimListElem * next
Definition: ED_anim_api.h:135
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
int mval[2]
Definition: WM_types.h:583
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:760
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
PropertyRNA * prop
Definition: WM_types.h:814
struct PointerRNA * ptr
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3156
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(struct wmOperator *op, rcti *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)
Definition: wm_operators.c:905
int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: wm_operators.c:838