Blender  V3.3
nla_select.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 Blender Foundation, Joshua Leung. All rights reserved. */
3 
8 #include <stdio.h>
9 #include <string.h>
10 
11 #include "DNA_anim_types.h"
12 #include "DNA_scene_types.h"
13 
14 #include "MEM_guardedalloc.h"
15 
16 #include "BLI_blenlib.h"
17 
18 #include "BKE_context.h"
19 #include "BKE_nla.h"
20 #include "BKE_screen.h"
21 
22 #include "ED_anim_api.h"
23 #include "ED_keyframes_edit.h"
24 #include "ED_screen.h"
25 #include "ED_select_utils.h"
26 
27 #include "RNA_access.h"
28 #include "RNA_define.h"
29 
30 #include "WM_api.h"
31 #include "WM_types.h"
32 
33 #include "UI_interface.h"
34 #include "UI_view2d.h"
35 
36 #include "nla_intern.h" /* own include */
37 
38 /* ******************** Utilities ***************************************** */
39 
40 /* Convert SELECT_* flags to ACHANNEL_SETFLAG_* flags */
41 static short selmodes_to_flagmodes(short sel)
42 {
43  /* convert selection modes to selection modes */
44  switch (sel) {
45  case SELECT_SUBTRACT:
47 
48  case SELECT_INVERT:
50 
51  case SELECT_ADD:
52  default:
53  return ACHANNEL_SETFLAG_ADD;
54  }
55 }
56 
57 /* ******************** Deselect All Operator ***************************** */
58 /* This operator works in one of three ways:
59  * 1) (de)select all (AKEY) - test if select all or deselect all
60  * 2) invert all (CTRL-IKEY) - invert selection of all keyframes
61  * 3) (de)select all - no testing is done; only for use internal tools as normal function...
62  */
63 
64 enum {
68 } /*eDeselectNlaStrips*/;
69 
70 /* Deselects strips in the NLA Editor
71  * - This is called by the deselect all operator, as well as other ones!
72  *
73  * - test: check if select or deselect all (1) or clear all active (2)
74  * - sel: how to select keyframes
75  * 0 = deselect
76  * 1 = select
77  * 2 = invert
78  */
79 static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
80 {
81  ListBase anim_data = {NULL, NULL};
82  bAnimListElem *ale;
83  int filter;
84  short smode;
85 
86  /* determine type-based settings */
87  /* FIXME: double check whether ANIMFILTER_LIST_VISIBLE is needed! */
89 
90  /* filter data */
91  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
92 
93  /* See if we should be selecting or deselecting */
94  if (test == DESELECT_STRIPS_TEST) {
95  for (ale = anim_data.first; ale; ale = ale->next) {
96  NlaTrack *nlt = (NlaTrack *)ale->data;
97  NlaStrip *strip;
98 
99  /* if any strip is selected, break out, since we should now be deselecting */
100  for (strip = nlt->strips.first; strip; strip = strip->next) {
101  if (strip->flag & NLASTRIP_FLAG_SELECT) {
102  sel = SELECT_SUBTRACT;
103  break;
104  }
105  }
106 
107  if (sel == SELECT_SUBTRACT) {
108  break;
109  }
110  }
111  }
112 
113  /* convert selection modes to selection modes */
114  smode = selmodes_to_flagmodes(sel);
115 
116  /* Now set the flags */
117  for (ale = anim_data.first; ale; ale = ale->next) {
118  NlaTrack *nlt = (NlaTrack *)ale->data;
119  NlaStrip *strip;
120 
121  /* apply same selection to all strips */
122  for (strip = nlt->strips.first; strip; strip = strip->next) {
123  /* set selection */
124  if (test != DESELECT_STRIPS_CLEARACTIVE) {
126  }
127 
128  /* clear active flag */
129  /* TODO: for clear active,
130  * do we want to limit this to only doing this on a certain set of tracks though? */
131  strip->flag &= ~NLASTRIP_FLAG_ACTIVE;
132  }
133  }
134 
135  /* Cleanup */
136  ANIM_animdata_freelist(&anim_data);
137 }
138 
139 /* ------------------- */
140 
142 {
143  bAnimContext ac;
144 
145  /* get editor data */
146  if (ANIM_animdata_get_context(C, &ac) == 0) {
147  return OPERATOR_CANCELLED;
148  }
149 
150  /* 'standard' behavior - check if selected, then apply relevant selection */
151  const int action = RNA_enum_get(op->ptr, "action");
152  switch (action) {
153  case SEL_TOGGLE:
155  break;
156  case SEL_SELECT:
158  break;
159  case SEL_DESELECT:
161  break;
162  case SEL_INVERT:
164  break;
165  default:
166  BLI_assert(0);
167  break;
168  }
169 
170  /* set notifier that things have changed */
172 
173  return OPERATOR_FINISHED;
174 }
175 
177 {
178  /* identifiers */
179  ot->name = "(De)select All";
180  ot->idname = "NLA_OT_select_all";
181  ot->description = "Select or deselect all NLA-Strips";
182 
183  /* api callbacks */
186 
187  /* flags */
188  ot->flag = OPTYPE_REGISTER /*|OPTYPE_UNDO*/;
189 
190  /* properties */
192 }
193 
194 /* ******************** Box Select Operator **************************** */
204 /* defines for box_select mode */
205 enum {
209 } /* eNLAEDIT_BoxSelect_Mode */;
210 
211 static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode)
212 {
213  ListBase anim_data = {NULL, NULL};
214  bAnimListElem *ale;
215  int filter;
216 
217  SpaceNla *snla = (SpaceNla *)ac->sl;
218  View2D *v2d = &ac->region->v2d;
219  rctf rectf;
220 
221  /* convert border-region to view coordinates */
222  UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin + 2, &rectf.xmin, &rectf.ymin);
223  UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax - 2, &rectf.xmax, &rectf.ymax);
224 
225  /* filter data */
228  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
229 
230  /* convert selection modes to selection modes */
231  selectmode = selmodes_to_flagmodes(selectmode);
232 
233  /* loop over data, doing box select */
234  float ymax = NLACHANNEL_FIRST_TOP(ac);
235  for (ale = anim_data.first; ale; ale = ale->next, ymax -= NLACHANNEL_STEP(snla)) {
236  float ymin = ymax - NLACHANNEL_HEIGHT(snla);
237 
238  /* perform vertical suitability check (if applicable) */
239  if ((mode == NLA_BOXSEL_FRAMERANGE) || !((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
240  /* loop over data selecting (only if NLA-Track) */
241  if (ale->type == ANIMTYPE_NLATRACK) {
242  NlaTrack *nlt = (NlaTrack *)ale->data;
243  NlaStrip *strip;
244 
245  /* only select strips if they fall within the required ranges (if applicable) */
246  for (strip = nlt->strips.first; strip; strip = strip->next) {
247  if ((mode == NLA_BOXSEL_CHANNELS) ||
248  BKE_nlastrip_within_bounds(strip, rectf.xmin, rectf.xmax)) {
249  /* set selection */
250  ACHANNEL_SET_FLAG(strip, selectmode, NLASTRIP_FLAG_SELECT);
251 
252  /* clear active flag */
253  strip->flag &= ~NLASTRIP_FLAG_ACTIVE;
254  }
255  }
256  }
257  }
258  }
259 
260  /* cleanup */
261  ANIM_animdata_freelist(&anim_data);
262 }
263 
264 /* ------------------- */
265 
267  bAnimContext *ac, float region_x, float region_y, bAnimListElem **r_ale, NlaStrip **r_strip)
268 {
269  *r_ale = NULL;
270  *r_strip = NULL;
271 
272  SpaceNla *snla = (SpaceNla *)ac->sl;
273  View2D *v2d = &ac->region->v2d;
274 
275  float view_x, view_y;
276  int channel_index;
277  UI_view2d_region_to_view(v2d, region_x, region_y, &view_x, &view_y);
279  0, NLACHANNEL_STEP(snla), 0, NLACHANNEL_FIRST_TOP(ac), view_x, view_y, NULL, &channel_index);
280 
281  ListBase anim_data = {NULL, NULL};
284  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
285 
286  /* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click
287  * (that is the size of keyframe icons, so user should be expecting similar tolerances)
288  */
289  float xmin = UI_view2d_region_to_view_x(v2d, region_x - 7);
290  float xmax = UI_view2d_region_to_view_x(v2d, region_x + 7);
291 
292  bAnimListElem *ale = BLI_findlink(&anim_data, channel_index);
293  if (ale != NULL) {
294  if (ale->type == ANIMTYPE_NLATRACK) {
295  NlaTrack *nlt = (NlaTrack *)ale->data;
296 
297  LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
298  if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
299  *r_ale = ale;
300  *r_strip = strip;
301 
302  BLI_remlink(&anim_data, ale);
303  }
304  }
305  }
306  }
307 
308  ANIM_animdata_freelist(&anim_data);
309 }
310 
311 static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2])
312 {
313  bAnimListElem *ale;
314  NlaStrip *strip;
315  nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
316 
317  if (ale != NULL) {
318  BLI_assert(strip != NULL);
319  MEM_freeN(ale);
320  return true;
321  }
322  return false;
323 }
324 
325 static int nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
326 {
327  bAnimContext ac;
328  if (ANIM_animdata_get_context(C, &ac) == 0) {
329  return OPERATOR_CANCELLED;
330  }
331 
332  bool tweak = RNA_boolean_get(op->ptr, "tweak");
333  if (tweak && nlaedit_mouse_is_over_strip(&ac, event->mval)) {
335  }
336  return WM_gesture_box_invoke(C, op, event);
337 }
338 
340 {
341  bAnimContext ac;
342  rcti rect;
343  short mode = 0;
344 
345  /* get editor data */
346  if (ANIM_animdata_get_context(C, &ac) == 0) {
347  return OPERATOR_CANCELLED;
348  }
349 
350  const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
351  const int selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT;
352  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
354  }
355 
356  /* get settings from operator */
358 
359  /* selection 'mode' depends on whether box_select region only matters on one axis */
360  if (RNA_boolean_get(op->ptr, "axis_range")) {
361  /* mode depends on which axis of the range is larger to determine which axis to use.
362  * - Checking this in region-space is fine,
363  * as it's fundamentally still going to be a different rect size.
364  * - The frame-range select option is favored over the channel one (x over y),
365  * as frame-range one is often.
366  * Used for tweaking timing when "blocking", while channels is not that useful.
367  */
368  if (BLI_rcti_size_x(&rect) >= BLI_rcti_size_y(&rect)) {
369  mode = NLA_BOXSEL_FRAMERANGE;
370  }
371  else {
372  mode = NLA_BOXSEL_CHANNELS;
373  }
374  }
375  else {
376  mode = NLA_BOXSEL_ALLSTRIPS;
377  }
378 
379  /* apply box_select action */
380  box_select_nla_strips(&ac, rect, mode, selectmode);
381 
382  /* set notifier that things have changed */
384 
385  return OPERATOR_FINISHED;
386 }
387 
389 {
390  /* identifiers */
391  ot->name = "Box Select";
392  ot->idname = "NLA_OT_select_box";
393  ot->description = "Use box selection to grab NLA-Strips";
394 
395  /* api callbacks */
400 
402 
403  /* flags */
405 
406  /* properties */
407  RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
408 
410  ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
412 
415 }
416 
417 /* ******************** Select Left/Right Operator ************************* */
418 /* Select keyframes left/right of the current frame indicator */
419 
420 /* defines for left-right select tool */
422  {NLAEDIT_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""},
423  {NLAEDIT_LRSEL_LEFT, "LEFT", 0, "Before Current Frame", ""},
424  {NLAEDIT_LRSEL_RIGHT, "RIGHT", 0, "After Current Frame", ""},
425  {0, NULL, 0, NULL, NULL},
426 };
427 
428 /* ------------------- */
429 
431  bAnimContext *ac,
432  short leftright,
433  short select_mode)
434 {
435  ListBase anim_data = {NULL, NULL};
436  bAnimListElem *ale;
437  int filter;
438 
439  Scene *scene = ac->scene;
440  float xmin, xmax;
441 
442  /* if currently in tweak-mode, exit tweak-mode first */
443  if (scene->flag & SCE_NLA_EDIT_ON) {
444  WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL, NULL);
445  }
446 
447  /* if select mode is replace, deselect all keyframes (and channels) first */
448  if (select_mode == SELECT_REPLACE) {
449  select_mode = SELECT_ADD;
450 
451  /* - deselect all other keyframes, so that just the newly selected remain
452  * - channels aren't deselected, since we don't re-select any as a consequence
453  */
455  }
456 
457  /* get range, and get the right flag-setting mode */
458  if (leftright == NLAEDIT_LRSEL_LEFT) {
459  xmin = MINAFRAMEF;
460  xmax = (float)(scene->r.cfra + 0.1f);
461  }
462  else {
463  xmin = (float)(scene->r.cfra - 0.1f);
464  xmax = MAXFRAMEF;
465  }
466 
467  select_mode = selmodes_to_flagmodes(select_mode);
468 
469  /* filter data */
471  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
472 
473  /* select strips on the side where most data occurs */
474  for (ale = anim_data.first; ale; ale = ale->next) {
475  NlaTrack *nlt = (NlaTrack *)ale->data;
476  NlaStrip *strip;
477 
478  /* check each strip to see if it is appropriate */
479  for (strip = nlt->strips.first; strip; strip = strip->next) {
480  if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
481  ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
482  }
483  }
484  }
485 
486  /* Cleanup */
487  ANIM_animdata_freelist(&anim_data);
488 }
489 
490 /* ------------------- */
491 
493 {
494  bAnimContext ac;
495  short leftright = RNA_enum_get(op->ptr, "mode");
496  short selectmode;
497 
498  /* get editor data */
499  if (ANIM_animdata_get_context(C, &ac) == 0) {
500  return OPERATOR_CANCELLED;
501  }
502 
503  /* select mode is either replace (deselect all, then add) or add/extend */
504  if (RNA_boolean_get(op->ptr, "extend")) {
505  selectmode = SELECT_INVERT;
506  }
507  else {
508  selectmode = SELECT_REPLACE;
509  }
510 
511  /* if "test" mode is set, we don't have any info to set this with */
512  if (leftright == NLAEDIT_LRSEL_TEST) {
513  return OPERATOR_CANCELLED;
514  }
515 
516  /* do the selecting now */
517  nlaedit_select_leftright(C, &ac, leftright, selectmode);
518 
519  /* set notifier that keyframe selection (and channels too) have changed */
522 
523  return OPERATOR_FINISHED;
524 }
525 
527 {
528  bAnimContext ac;
529  short leftright = RNA_enum_get(op->ptr, "mode");
530 
531  /* get editor data */
532  if (ANIM_animdata_get_context(C, &ac) == 0) {
533  return OPERATOR_CANCELLED;
534  }
535 
536  /* handle mode-based testing */
537  if (leftright == NLAEDIT_LRSEL_TEST) {
538  Scene *scene = ac.scene;
539  ARegion *region = ac.region;
540  View2D *v2d = &region->v2d;
541  float x;
542 
543  /* determine which side of the current frame mouse is on */
544  x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
545  if (x < scene->r.cfra) {
546  RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT);
547  }
548  else {
549  RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_RIGHT);
550  }
551  }
552 
553  /* perform selection */
554  return nlaedit_select_leftright_exec(C, op);
555 }
556 
558 {
559  PropertyRNA *prop;
560 
561  /* identifiers */
562  ot->name = "Select Left/Right";
563  ot->idname = "NLA_OT_select_leftright";
564  ot->description = "Select strips to the left or the right of the current frame";
565 
566  /* api callbacks */
570 
571  /* flags */
573 
574  /* properties */
575  ot->prop = RNA_def_enum(
578 
579  prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
581 }
582 
583 /* ******************** Mouse-Click Select Operator *********************** */
584 
585 /* select strip directly under mouse */
587  bAnimContext *ac,
588  const int mval[2],
589  short select_mode,
590  const bool deselect_all,
591  bool wait_to_deselect_others)
592 {
593  Scene *scene = ac->scene;
594 
595  bAnimListElem *ale = NULL;
596  NlaStrip *strip = NULL;
597  int ret_value = OPERATOR_FINISHED;
598 
599  nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip);
600 
601  /* if currently in tweak-mode, exit tweak-mode before changing selection states
602  * now that we've found our target...
603  */
604  if (scene->flag & SCE_NLA_EDIT_ON) {
605  WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL, NULL);
606  }
607 
608  if (select_mode != SELECT_REPLACE) {
609  wait_to_deselect_others = false;
610  }
611 
612  /* For replacing selection, if we have something to select, we have to clear existing selection.
613  * The same goes if we found nothing to select, and deselect_all is true
614  * (deselect on nothing behavior). */
615  if ((strip != NULL && select_mode == SELECT_REPLACE) || (strip == NULL && deselect_all)) {
616  /* reset selection mode for next steps */
617  select_mode = SELECT_ADD;
618 
619  if (strip && wait_to_deselect_others && (strip->flag & DESELECT_STRIPS_CLEARACTIVE)) {
620  ret_value = OPERATOR_RUNNING_MODAL;
621  }
622  else {
623  /* deselect all strips */
625 
626  /* deselect all other channels first */
628  }
629  }
630 
631  /* only select strip if we clicked on a valid channel and hit something */
632  if (ale != NULL) {
633  /* select the strip accordingly (if a matching one was found) */
634  if (strip != NULL) {
635  select_mode = selmodes_to_flagmodes(select_mode);
636  ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT);
637 
638  /* if we selected it, we can make it active too
639  * - we always need to clear the active strip flag though...
640  * - as well as selecting its track...
641  */
643 
644  if (strip->flag & NLASTRIP_FLAG_SELECT) {
645  strip->flag |= NLASTRIP_FLAG_ACTIVE;
646 
647  /* Highlight NLA-Track */
648  if (ale->type == ANIMTYPE_NLATRACK) {
649  NlaTrack *nlt = (NlaTrack *)ale->data;
650 
651  nlt->flag |= NLATRACK_SELECTED;
655  }
656  }
657  }
658 
659  /* free this channel */
660  MEM_freeN(ale);
661  }
662 
663  return ret_value;
664 }
665 
666 /* ------------------- */
667 
668 /* handle clicking */
670 {
671  bAnimContext ac;
672  int ret_value;
673 
674  /* get editor data */
675  if (ANIM_animdata_get_context(C, &ac) == 0) {
676  return OPERATOR_CANCELLED;
677  }
678 
679  /* select mode is either replace (deselect all, then add) or add/extend */
680  const short selectmode = RNA_boolean_get(op->ptr, "extend") ? SELECT_INVERT : SELECT_REPLACE;
681  const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
682  const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, "wait_to_deselect_others");
683  int mval[2];
684  mval[0] = RNA_int_get(op->ptr, "mouse_x");
685  mval[1] = RNA_int_get(op->ptr, "mouse_y");
686 
687  /* select strips based upon mouse position */
688  ret_value = mouse_nla_strips(C, &ac, mval, selectmode, deselect_all, wait_to_deselect_others);
689 
690  /* set notifier that things have changed */
692 
693  /* for tweak grab to work */
694  return ret_value | OPERATOR_PASS_THROUGH;
695 }
696 
698 {
699  PropertyRNA *prop;
700 
701  /* identifiers */
702  ot->name = "Select";
703  ot->idname = "NLA_OT_click_select";
704  ot->description = "Handle clicks to select NLA Strips";
705 
706  /* callbacks */
711 
712  /* flags */
713  ot->flag = OPTYPE_UNDO;
714 
715  /* properties */
717  prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); /* SHIFTKEY */
719 
720  prop = RNA_def_boolean(ot->srna,
721  "deselect_all",
722  false,
723  "Deselect On Nothing",
724  "Deselect all when nothing under the cursor");
726 }
727 
728 /* *********************************************** */
typedef float(TangentPoint)[2]
bool BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max)
Definition: nla.c:1308
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
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:190
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
@ NLASTRIP_FLAG_ACTIVE
@ NLASTRIP_FLAG_SELECT
@ NLATRACK_SELECTED
#define SCE_NLA_EDIT_ON
#define MAXFRAMEF
#define MINAFRAMEF
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
@ ACHANNEL_SETFLAG_ADD
Definition: ED_anim_api.h:552
@ ACHANNEL_SETFLAG_INVERT
Definition: ED_anim_api.h:554
@ ACHANNEL_SETFLAG_CLEAR
Definition: ED_anim_api.h:550
@ ANIMTYPE_NLATRACK
Definition: ED_anim_api.h:238
#define NLACHANNEL_STEP(snla)
Definition: ED_anim_api.h:466
#define NLACHANNEL_FIRST_TOP(ac)
Definition: ED_anim_api.h:460
#define ACHANNEL_SET_FLAG(channel, smode, sflag)
Definition: ED_anim_api.h:977
#define NLACHANNEL_HEIGHT(snla)
Definition: ED_anim_api.h:462
@ ANIMFILTER_DATA_VISIBLE
Definition: ED_anim_api.h:292
@ ANIMFILTER_LIST_VISIBLE
Definition: ED_anim_api.h:295
@ ANIMFILTER_LIST_CHANNELS
Definition: ED_anim_api.h:300
@ ANIMFILTER_FCURVESONLY
Definition: ED_anim_api.h:328
@ SELECT_INVERT
@ SELECT_SUBTRACT
@ SELECT_REPLACE
@ SELECT_ADD
bool ED_operator_nla_active(struct bContext *C)
Definition: screen_ops.c:349
#define SEL_OP_USE_PRE_DESELECT(sel_op)
@ SEL_SELECT
@ SEL_INVERT
@ SEL_DESELECT
@ SEL_TOGGLE
eSelectOp
@ SEL_OP_SUB
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
#define C
Definition: RandGen.cpp:25
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:1619
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.cc:1655
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_ANIMATION
Definition: WM_types.h:338
#define ND_NLA
Definition: WM_types.h:445
@ WM_OP_EXEC_DEFAULT
Definition: WM_types.h:208
#define ND_KEYFRAME
Definition: WM_types.h:442
#define ND_ANIMCHAN
Definition: WM_types.h:444
#define NA_SELECTED
Definition: WM_types.h:528
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:397
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
Definition: anim_filter.c:379
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
Definition: anim_filter.c:3447
Scene scene
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
bool nlaop_poll_tweakmode_off(bContext *C)
Definition: nla_ops.c:28
@ NLAEDIT_LRSEL_RIGHT
Definition: nla_intern.h:39
@ NLAEDIT_LRSEL_TEST
Definition: nla_intern.h:36
@ NLAEDIT_LRSEL_LEFT
Definition: nla_intern.h:38
static int nlaedit_clickselect_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:669
static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
Definition: nla_select.c:79
static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode)
Definition: nla_select.c:211
static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2])
Definition: nla_select.c:311
void NLA_OT_select_box(wmOperatorType *ot)
Definition: nla_select.c:388
@ DESELECT_STRIPS_NOTEST
Definition: nla_select.c:65
@ DESELECT_STRIPS_CLEARACTIVE
Definition: nla_select.c:67
@ DESELECT_STRIPS_TEST
Definition: nla_select.c:66
@ NLA_BOXSEL_ALLSTRIPS
Definition: nla_select.c:206
@ NLA_BOXSEL_CHANNELS
Definition: nla_select.c:208
@ NLA_BOXSEL_FRAMERANGE
Definition: nla_select.c:207
static short selmodes_to_flagmodes(short sel)
Definition: nla_select.c:41
void NLA_OT_click_select(wmOperatorType *ot)
Definition: nla_select.c:697
static int nlaedit_box_select_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:339
static int nlaedit_deselectall_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:141
void NLA_OT_select_leftright(wmOperatorType *ot)
Definition: nla_select.c:557
static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op)
Definition: nla_select.c:492
static int nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: nla_select.c:325
static void nlaedit_select_leftright(bContext *C, bAnimContext *ac, short leftright, short select_mode)
Definition: nla_select.c:430
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:266
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:586
static const EnumPropertyItem prop_nlaedit_leftright_select_types[]
Definition: nla_select.c:421
static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: nla_select.c:526
void NLA_OT_select_all(wmOperatorType *ot)
Definition: nla_select.c:176
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4910
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:5015
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
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:3783
void * first
Definition: DNA_listBase.h:31
ListBase strips
short flag
struct RenderData r
struct ARegion * region
Definition: ED_anim_api.h:76
struct Scene * scene
Definition: ED_anim_api.h:84
short datatype
Definition: ED_anim_api.h:62
void * data
Definition: ED_anim_api.h:60
struct SpaceLink * sl
Definition: ED_anim_api.h:74
struct bAnimListElem * next
Definition: ED_anim_api.h:127
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
int mval[2]
Definition: WM_types.h:684
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:935
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:927
struct StructRNA * srna
Definition: WM_types.h:969
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
PropertyRNA * prop
Definition: WM_types.h:981
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.c:3479
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:962
int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: wm_operators.c:903