Blender V4.3
action_select.cc File Reference
#include <cfloat>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dlrbTree.h"
#include "BLI_lasso_2d.hh"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_grease_pencil.hh"
#include "BKE_nla.hh"
#include "UI_interface.hh"
#include "UI_view2d.hh"
#include "ED_anim_api.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_grease_pencil.hh"
#include "ED_keyframes_edit.hh"
#include "ED_keyframes_keylist.hh"
#include "ED_markers.hh"
#include "ED_mask.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "action_intern.hh"

Go to the source code of this file.

Classes

struct  BoxSelectData
 
struct  RegionSelectData
 

Functions

Keyframes Stuff
static bAnimListElemactkeys_find_list_element_at_position (bAnimContext *ac, eAnimFilter_Flags filter, float region_x, float region_y)
 
static void actkeys_list_element_to_keylist (bAnimContext *ac, AnimKeylist *keylist, bAnimListElem *ale)
 
static void actkeys_find_key_in_list_element (bAnimContext *ac, bAnimListElem *ale, float region_x, float *r_selx, float *r_frame, bool *r_found, bool *r_is_selected)
 
static void actkeys_find_key_at_position (bAnimContext *ac, eAnimFilter_Flags filter, float region_x, float region_y, bAnimListElem **r_ale, float *r_selx, float *r_frame, bool *r_found, bool *r_is_selected)
 
static bool actkeys_is_key_at_position (bAnimContext *ac, float region_x, float region_y)
 
Deselect All Operator

This operator works in one of three ways: 1) (de)select all (AKEY) - test if select all or deselect all. 2) invert all (CTRL-IKEY) - invert selection of all keyframes. 3) (de)select all - no testing is done; only for use internal tools as normal function.

static void deselect_action_keys (bAnimContext *ac, short test, eEditKeyframes_Select sel)
 
static int actkeys_deselectall_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_select_all (wmOperatorType *ot)
 
Region Select Operators

"Region Select" operators include the Lasso and Circle Select operators. These two ended up being lumped together, as it was easier in the original Graph Editor implementation of these to do it this way.

static void region_select_elem (RegionSelectData *sel_data, bAnimListElem *ale, bool summary)
 
static void region_select_action_keys (bAnimContext *ac, const rctf *rectf_view, short mode, eEditKeyframes_Select selectmode, void *data)
 
static int actkeys_lassoselect_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_select_lasso (wmOperatorType *ot)
 
static int action_circle_select_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_select_circle (wmOperatorType *ot)
 
Select Linked Operator
static int actkeys_select_linked_exec (bContext *C, wmOperator *)
 
void ACTION_OT_select_linked (wmOperatorType *ot)
 
Select More/Less Operators
static void select_moreless_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_select_more_exec (bContext *C, wmOperator *)
 
void ACTION_OT_select_more (wmOperatorType *ot)
 
static int actkeys_select_less_exec (bContext *C, wmOperator *)
 
void ACTION_OT_select_less (wmOperatorType *ot)
 
Mouse-Click Select Operator

This operator works in one of three ways:

  • 1) keyframe under mouse - no special modifiers
  • 2) all keyframes on the same side of current frame indicator as mouse - ALT modifier
  • 3) column select all keyframes in frame under mouse - CTRL modifier
  • 4) all keyframes in channel under mouse - CTRL+ALT modifiers

In addition to these basic options, the SHIFT modifier can be used to toggle the selection mode between replacing the selection (without) and inverting the selection (with).

static void actkeys_mselect_single (bAnimContext *ac, bAnimListElem *ale, const eEditKeyframes_Select select_mode, float selx)
 
static void actkeys_mselect_column (bAnimContext *ac, eEditKeyframes_Select select_mode, float selx)
 
static void actkeys_mselect_channel_only (bAnimContext *ac, bAnimListElem *ale, eEditKeyframes_Select select_mode)
 
static int mouse_action_keys (bAnimContext *ac, const int mval[2], eEditKeyframes_Select select_mode, const bool deselect_all, const bool column, const bool same_channel, bool wait_to_deselect_others)
 
static int actkeys_clickselect_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_clickselect (wmOperatorType *ot)
 

Box Select Operator

This operator currently works in one of three ways:

enum  { ACTKEYS_BORDERSEL_ALLKEYS = 0 , ACTKEYS_BORDERSEL_FRAMERANGE , ACTKEYS_BORDERSEL_CHANNELS }
 
static void box_select_elem (BoxSelectData *sel_data, bAnimListElem *ale, float xmin, float xmax, bool summary)
 
static void box_select_action (bAnimContext *ac, const rcti rect, short mode, const eEditKeyframes_Select selectmode)
 
static int actkeys_box_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int actkeys_box_select_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_select_box (wmOperatorType *ot)
 

Column Select Operator

This operator works in one of four ways:

  • 1) select all keyframes in the same frame as a selected one (KKEY)
  • 2) select all keyframes in the same frame as the current frame marker (CTRL-KKEY)
  • 3) select all keyframes in the same frame as a selected markers (SHIFT-KKEY)
  • 4) select all keyframes that occur between selected markers (ALT-KKEY)
static const EnumPropertyItem prop_column_select_types []
 
static void markers_selectkeys_between (bAnimContext *ac)
 
static void columnselect_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_columnselect_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_select_column (wmOperatorType *ot)
 

Select Left/Right Operator

Select keyframes left/right of the current frame indicator.

static const EnumPropertyItem prop_actkeys_leftright_select_types []
 
static void actkeys_select_leftright (bAnimContext *ac, short leftright, eEditKeyframes_Select select_mode)
 
static int actkeys_select_leftright_exec (bContext *C, wmOperator *op)
 
static int actkeys_select_leftright_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void ACTION_OT_select_leftright (wmOperatorType *ot)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ACTKEYS_BORDERSEL_ALLKEYS 
ACTKEYS_BORDERSEL_FRAMERANGE 
ACTKEYS_BORDERSEL_CHANNELS 

Definition at line 437 of file action_select.cc.

Function Documentation

◆ action_circle_select_exec()

◆ ACTION_OT_clickselect()

◆ ACTION_OT_select_all()

◆ ACTION_OT_select_box()

◆ ACTION_OT_select_circle()

◆ ACTION_OT_select_column()

◆ ACTION_OT_select_lasso()

◆ ACTION_OT_select_leftright()

◆ ACTION_OT_select_less()

◆ ACTION_OT_select_linked()

◆ ACTION_OT_select_more()

◆ actkeys_box_select_exec()

◆ actkeys_box_select_invoke()

◆ actkeys_clickselect_exec()

◆ actkeys_columnselect_exec()

◆ actkeys_deselectall_exec()

◆ actkeys_find_key_at_position()

static void actkeys_find_key_at_position ( bAnimContext * ac,
eAnimFilter_Flags filter,
float region_x,
float region_y,
bAnimListElem ** r_ale,
float * r_selx,
float * r_frame,
bool * r_found,
bool * r_is_selected )
static

◆ actkeys_find_key_in_list_element()

◆ actkeys_find_list_element_at_position()

◆ actkeys_is_key_at_position()

static bool actkeys_is_key_at_position ( bAnimContext * ac,
float region_x,
float region_y )
static

◆ actkeys_lassoselect_exec()

◆ actkeys_list_element_to_keylist()

◆ actkeys_mselect_channel_only()

◆ actkeys_mselect_column()

◆ actkeys_mselect_single()

◆ actkeys_select_leftright()

◆ actkeys_select_leftright_exec()

◆ actkeys_select_leftright_invoke()

◆ actkeys_select_less_exec()

◆ actkeys_select_linked_exec()

◆ actkeys_select_more_exec()

◆ box_select_action()

◆ box_select_elem()

◆ columnselect_action_keys()

◆ deselect_action_keys()

◆ markers_selectkeys_between()

◆ mouse_action_keys()

◆ region_select_action_keys()

◆ region_select_elem()

◆ select_moreless_action_keys()

Variable Documentation

◆ prop_actkeys_leftright_select_types

const EnumPropertyItem prop_actkeys_leftright_select_types[]
static
Initial value:
= {
{ACTKEYS_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""},
{ACTKEYS_LRSEL_LEFT, "LEFT", 0, "Before Current Frame", ""},
{ACTKEYS_LRSEL_RIGHT, "RIGHT", 0, "After Current Frame", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ ACTKEYS_LRSEL_TEST
@ ACTKEYS_LRSEL_LEFT
@ ACTKEYS_LRSEL_RIGHT

Definition at line 1514 of file action_select.cc.

Referenced by ACTION_OT_select_leftright().

◆ prop_column_select_types

const EnumPropertyItem prop_column_select_types[]
static
Initial value:
= {
{ACTKEYS_COLUMNSEL_KEYS, "KEYS", 0, "On Selected Keyframes", ""},
{ACTKEYS_COLUMNSEL_CFRA, "CFRA", 0, "On Current Frame", ""},
{ACTKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", 0, "On Selected Markers", ""},
"MARKERS_BETWEEN",
0,
"Between Min/Max Selected Markers",
""},
{0, nullptr, 0, nullptr, nullptr},
}
@ ACTKEYS_COLUMNSEL_CFRA
@ ACTKEYS_COLUMNSEL_MARKERS_BETWEEN
@ ACTKEYS_COLUMNSEL_MARKERS_COLUMN
@ ACTKEYS_COLUMNSEL_KEYS

Definition at line 1065 of file action_select.cc.

Referenced by ACTION_OT_select_column().